public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Danis" <frederic.danis@collabora.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/2] profiles: Add remote endpoint path to SelectProperties
Date: Mon, 29 Aug 2022 22:31:21 +0200	[thread overview]
Message-ID: <20220829203122.51343-2-frederic.danis@collabora.com> (raw)
In-Reply-To: <20220829203122.51343-1-frederic.danis@collabora.com>

---
 profiles/audio/bap.c   | 2 +-
 profiles/audio/media.c | 3 +++
 src/shared/bap.c       | 2 ++
 src/shared/bap.h       | 2 ++
 4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index d388afe56..cf27ec0ae 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -613,7 +613,7 @@ static bool pac_found(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 
 	/* TODO: Cache LRU? */
 	if (btd_service_is_initiator(service))
-		bt_bap_select(lpac, rpac, select_cb, ep);
+		bt_bap_select(lpac, rpac, ep->path, select_cb, ep);
 
 	return true;
 }
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index ff3fa197b..8d777eedd 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -891,6 +891,7 @@ done:
 
 static int pac_select(struct bt_bap_pac *pac, struct bt_bap_pac_qos *qos,
 			struct iovec *caps, struct iovec *metadata,
+			const char *remote_ep_path,
 			bt_bap_pac_select_t cb, void *cb_data, void *user_data)
 {
 	struct media_endpoint *endpoint = user_data;
@@ -917,6 +918,8 @@ static int pac_select(struct bt_bap_pac *pac, struct bt_bap_pac_qos *qos,
 
 	dbus_message_iter_init_append(msg, &iter);
 
+	dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH, &remote_ep_path);
+
 	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &dict);
 
 	g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &key,
diff --git a/src/shared/bap.c b/src/shared/bap.c
index 8edc7b72e..691fec2fa 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -4058,6 +4058,7 @@ static bool match_pac(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 }
 
 int bt_bap_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
+			const char *remote_ep_path,
 			bt_bap_pac_select_t func, void *user_data)
 {
 	if (!lpac || !rpac || !func)
@@ -4067,6 +4068,7 @@ int bt_bap_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 		return -EOPNOTSUPP;
 
 	lpac->ops->select(lpac, &rpac->qos, rpac->data, rpac->metadata,
+					remote_ep_path,
 					func, user_data, lpac->user_data);
 
 	return 0;
diff --git a/src/shared/bap.h b/src/shared/bap.h
index ff4bac330..da5fe1431 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
@@ -122,6 +122,7 @@ struct bt_bap_pac *bt_bap_add_pac(struct gatt_db *db, const char *name,
 struct bt_bap_pac_ops {
 	int (*select) (struct bt_bap_pac *pac, struct bt_bap_pac_qos *qos,
 			struct iovec *caps, struct iovec *metadata,
+			const char *remote_ep_path,
 			bt_bap_pac_select_t cb, void *cb_data, void *user_data);
 	int (*config) (struct bt_bap_stream *stream, struct iovec *cfg,
 			struct bt_bap_qos *qos, bt_bap_pac_config_t cb,
@@ -188,6 +189,7 @@ int bt_bap_pac_get_codec(struct bt_bap_pac *pac, uint8_t *id,
 
 /* Stream related functions */
 int bt_bap_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
+			const char *remote_ep_path,
 			bt_bap_pac_select_t func, void *user_data);
 
 struct bt_bap_stream *bt_bap_config(struct bt_bap *bap,
-- 
2.25.1


  reply	other threads:[~2022-08-29 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 20:31 [PATCH BlueZ 0/2] profiles: Add remote endpoint path to SelectProperties Frédéric Danis
2022-08-29 20:31 ` Frédéric Danis [this message]
2022-08-29 21:29   ` bluez.test.bot
2022-08-29 21:55   ` [PATCH BlueZ 1/2] " Luiz Augusto von Dentz
2022-08-29 20:31 ` [PATCH BlueZ 2/2] doc: " Frédéric Danis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220829203122.51343-2-frederic.danis@collabora.com \
    --to=frederic.danis@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox