All of lore.kernel.org
 help / color / mirror / Atom feed
From: Silviu Florian Barbulescu <silviu.barbulescu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com,
	vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com,
	luiz.dentz@gmail.com, iulia.tanasescu@nxp.com
Subject: [PATCH BlueZ 1/2] bap: Add bcast source support for MediaEndpoint Codec
Date: Wed, 20 Mar 2024 16:41:52 +0200	[thread overview]
Message-ID: <20240320144153.46408-2-silviu.barbulescu@nxp.com> (raw)
In-Reply-To: <20240320144153.46408-1-silviu.barbulescu@nxp.com>

MediaEndpoint property Codec returns 0 for the broadcast source endpoint

---
 profiles/audio/bap.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 964ba9c21..3ab13a51e 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -277,7 +277,13 @@ static gboolean get_codec(const GDBusPropertyTable *property,
 	struct bap_ep *ep = data;
 	uint8_t codec;
 
-	bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL);
+	/* For broadcast source, rpac is null so the codec
+	 * is retrieved from the lpac
+	 */
+	if (ep->rpac == NULL)
+		bt_bap_pac_get_codec(ep->lpac, &codec, NULL, NULL);
+	else
+		bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL);
 
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &codec);
 
-- 
2.39.2


  reply	other threads:[~2024-03-20 14:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 14:41 [PATCH BlueZ 0/2] Allow endpoint config without local endpoint argument Silviu Florian Barbulescu
2024-03-20 14:41 ` Silviu Florian Barbulescu [this message]
2024-03-20 17:05   ` bluez.test.bot
2024-03-20 14:41 ` [PATCH BlueZ 2/2] player: " Silviu Florian Barbulescu
2024-03-20 17:32   ` Luiz Augusto von Dentz
2024-03-21 11:33     ` Silviu Florian Barbulescu
2024-03-28 14:40 ` [PATCH BlueZ 0/2] " patchwork-bot+bluetooth

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=20240320144153.46408-2-silviu.barbulescu@nxp.com \
    --to=silviu.barbulescu@nxp.com \
    --cc=andrei.istodorescu@nxp.com \
    --cc=iulia.tanasescu@nxp.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=mihai-octavian.urzica@nxp.com \
    --cc=vlad.pruteanu@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.