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 v2 2/3] transport: Add support to update the transport config
Date: Wed, 13 Mar 2024 19:02:59 +0200	[thread overview]
Message-ID: <20240313170300.40974-3-silviu.barbulescu@nxp.com> (raw)
In-Reply-To: <20240313170300.40974-1-silviu.barbulescu@nxp.com>

Add support to update the transport configuration

---
 profiles/audio/transport.c | 21 +++++++++++++++++++++
 profiles/audio/transport.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 159fbd575..122c3339e 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -1483,6 +1483,27 @@ static void bap_update_bcast_qos(const struct media_transport *transport)
 			"Configuration");
 }
 
+void bap_update_bcast_config(struct media_transport *transport)
+{
+	struct bap_transport *bap = transport->data;
+	struct iovec *cc;
+
+	cc = bt_bap_stream_get_config(bap->stream);
+
+	if (((int)cc->iov_len != transport->size) ||
+		(memcmp(cc->iov_base, transport->configuration,
+			transport->size) != 0)) {
+		free(transport->configuration);
+		transport->configuration = util_memdup(cc->iov_base,
+							cc->iov_len);
+		transport->size = cc->iov_len;
+
+		g_dbus_emit_property_changed(btd_get_dbus_connection(),
+			transport->path, MEDIA_TRANSPORT_INTERFACE,
+			"Configuration");
+	}
+}
+
 static guint transport_bap_resume(struct media_transport *transport,
 				struct media_owner *owner)
 {
diff --git a/profiles/audio/transport.h b/profiles/audio/transport.h
index b46bc8025..6df419a67 100644
--- a/profiles/audio/transport.h
+++ b/profiles/audio/transport.h
@@ -16,6 +16,7 @@ struct media_transport *media_transport_create(struct btd_device *device,
 						uint8_t *configuration,
 						size_t size, void *data,
 						void *stream);
+void bap_update_bcast_config(struct media_transport *transport);
 
 void media_transport_destroy(struct media_transport *transport);
 const char *media_transport_get_path(struct media_transport *transport);
-- 
2.39.2


  parent reply	other threads:[~2024-03-13 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 17:02 [PATCH BlueZ v2 0/3] Broadcast source reconfiguration support Silviu Florian Barbulescu
2024-03-13 17:02 ` [PATCH BlueZ v2 1/3] player: Add reconfiguration prompt for broadcast source Silviu Florian Barbulescu
2024-03-13 19:31   ` Broadcast source reconfiguration support bluez.test.bot
2024-03-13 17:02 ` Silviu Florian Barbulescu [this message]
2024-03-13 17:03 ` [PATCH BlueZ v2 3/3] bap: Broadcast source reconfiguration support added Silviu Florian Barbulescu
2024-03-13 20:04 ` [PATCH BlueZ v2 0/3] Broadcast source reconfiguration support Luiz Augusto von Dentz
2024-03-13 20:49   ` Luiz Augusto von Dentz

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=20240313170300.40974-3-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.