public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/4] shared/bap: add bt_bap_stream_config_update for updating QoS choice
@ 2023-11-12 16:00 Pauli Virtanen
  2023-11-12 16:00 ` [PATCH BlueZ 2/4] shared/bap: move bcast configure finish out from set_user_data Pauli Virtanen
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Pauli Virtanen @ 2023-11-12 16:00 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add bt_bap_stream_config_update for updating the QoS while in Codec
Configured state.
---
 src/shared/bap.c | 18 ++++++++++++++++++
 src/shared/bap.h |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 13bbcf793..d90e39f7c 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -4600,6 +4600,24 @@ unsigned int bt_bap_stream_config(struct bt_bap_stream *stream,
 	return 0;
 }
 
+int bt_bap_stream_config_update(struct bt_bap_stream *stream,
+					struct bt_bap_qos *qos)
+{
+	if (!bap_stream_valid(stream))
+		return -EINVAL;
+
+	if (stream->ep->state != BT_BAP_STREAM_STATE_CONFIG)
+		return -EINVAL;
+
+	switch (bt_bap_stream_get_type(stream)) {
+	case BT_BAP_STREAM_TYPE_UCAST:
+		stream->qos = *qos;
+		return 0;
+	}
+
+	return -EINVAL;
+}
+
 static bool match_pac(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 							void *user_data)
 {
diff --git a/src/shared/bap.h b/src/shared/bap.h
index 23edbf4c6..099c2edd0 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
@@ -255,6 +255,9 @@ unsigned int bt_bap_stream_config(struct bt_bap_stream *stream,
 					bt_bap_stream_func_t func,
 					void *user_data);
 
+int bt_bap_stream_config_update(struct bt_bap_stream *stream,
+					struct bt_bap_qos *pqos);
+
 unsigned int bt_bap_stream_qos(struct bt_bap_stream *stream,
 					struct bt_bap_qos *qos,
 					bt_bap_stream_func_t func,
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-13 16:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-12 16:00 [PATCH BlueZ 1/4] shared/bap: add bt_bap_stream_config_update for updating QoS choice Pauli Virtanen
2023-11-12 16:00 ` [PATCH BlueZ 2/4] shared/bap: move bcast configure finish out from set_user_data Pauli Virtanen
2023-11-12 16:00 ` [PATCH BlueZ 3/4] bap: call explicitly bt_bap_stream_bcast_configured when needed Pauli Virtanen
2023-11-12 16:00 ` [PATCH BlueZ 4/4] bap: skip Config Codec when it is not needed Pauli Virtanen
2023-11-12 17:26 ` [BlueZ,1/4] shared/bap: add bt_bap_stream_config_update for updating QoS choice bluez.test.bot
2023-11-13 15:39 ` [PATCH BlueZ 1/4] " Luiz Augusto von Dentz
2023-11-13 16:27   ` Pauli Virtanen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox