Skip to content

Commit 66f8ab5

Browse files
ThalleyMaureenHelm
authored andcommitted
Bluetooth: BAP: Add specific error code for stopping stopped sink
If the broadcast sink is already stopped (i.e. the streams have all been disconnected), then we can return a more useful error code than EINVAL. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent d31a7b4 commit 66f8ab5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/audio/bap_broadcast_sink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,8 +1674,8 @@ int bt_bap_broadcast_sink_stop(struct bt_bap_broadcast_sink *sink)
16741674
}
16751675

16761676
if (sys_slist_is_empty(&sink->streams)) {
1677-
LOG_DBG("Source does not have any streams");
1678-
return -EINVAL;
1677+
LOG_DBG("Source does not have any streams (already stopped)");
1678+
return -EALREADY;
16791679
}
16801680

16811681
head_node = sys_slist_peek_head(&sink->streams);

0 commit comments

Comments
 (0)