[PATCH BlueZ 2/5] shared/bap: Fix initiating QoS and Enable procedures as server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

According to Table 3.2: ASE state machine transition these procedures
can only be initated by clients.
---
 src/shared/bap.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 7a24824a71fc..f4812a4b9f51 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -4166,14 +4166,12 @@ unsigned int bt_bap_stream_qos(struct bt_bap_stream *stream,
 	struct bt_ascs_qos qos;
 	struct bt_bap_req *req;
 
-	if (!bap_stream_valid(stream))
+	/* Table 3.2: ASE state machine transition
+	 * Initiating device - client Only
+	 */
+	if (!bap_stream_valid(stream) || !stream->client)
 		return 0;
 
-	if (!stream->client) {
-		stream_qos(stream, data, NULL);
-		return 0;
-	}
-
 	memset(&qos, 0, sizeof(qos));
 
 	/* TODO: Figure out how to pass these values around */
@@ -4259,14 +4257,12 @@ unsigned int bt_bap_stream_enable(struct bt_bap_stream *stream,
 {
 	int ret;
 
-	if (!bap_stream_valid(stream))
+	/* Table 3.2: ASE state machine transition
+	 * Initiating device - client Only
+	 */
+	if (!bap_stream_valid(stream) || !stream->client)
 		return 0;
 
-	if (!stream->client) {
-		stream_enable(stream, metadata, NULL);
-		return 0;
-	}
-
 	ret = bap_stream_metadata(stream, BT_ASCS_ENABLE, metadata, func,
 								user_data);
 	if (!ret || !enable_links)
-- 
2.37.3




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux