Diff between 08bf0b2a85f33a09b0a832aa3c984377209b38b5 and d994c9d45dad68bc060add77642fdc37834cd7c1

Changed Files

File Additions Deletions Status
profiles/audio/bap.c +13 -1 modified

Full Patch

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 6184c9d..a4036bb 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -801,8 +801,20 @@ static void config_cb(struct bt_bap_stream *stream,
 
 	setup->id = 0;
 
-	if (!code)
+	if (!code) {
+		/* Check state is already set to config then proceed to qos */
+		if (bt_bap_stream_get_state(stream) ==
+					BT_BAP_STREAM_STATE_CONFIG) {
+			setup->id = bt_bap_stream_qos(stream, &setup->qos,
+							qos_cb, setup);
+			if (!setup->id) {
+				error("Failed to Configure QoS");
+				bt_bap_stream_release(stream, NULL, NULL);
+			}
+		}
+
 		return;
+	}
 
 	if (!setup->msg)
 		return;