Skip to content

Commit

Permalink
shared/bap: Fix initiating QoS and Enable procedures as server
Browse files Browse the repository at this point in the history
According to Table 3.2: ASE state machine transition these procedures
can only be initated by clients.
  • Loading branch information
Vudentz committed Dec 2, 2022
1 parent b6a6f6a commit 636c786
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/shared/bap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4166,13 +4166,11 @@ 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))
return 0;

if (!stream->client) {
stream_qos(stream, data, NULL);
/* Table 3.2: ASE state machine transition
* Initiating device - client Only
*/
if (!bap_stream_valid(stream) || !stream->client)
return 0;
}

memset(&qos, 0, sizeof(qos));

Expand Down Expand Up @@ -4259,13 +4257,11 @@ unsigned int bt_bap_stream_enable(struct bt_bap_stream *stream,
{
int ret;

if (!bap_stream_valid(stream))
return 0;

if (!stream->client) {
stream_enable(stream, metadata, NULL);
/* Table 3.2: ASE state machine transition
* Initiating device - client Only
*/
if (!bap_stream_valid(stream) || !stream->client)
return 0;
}

ret = bap_stream_metadata(stream, BT_ASCS_ENABLE, metadata, func,
user_data);
Expand Down

0 comments on commit 636c786

Please sign in to comment.