From 15fd57f26079d7bfd7b5797dd1cbd0192e68ac1f Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 7 Apr 2025 09:35:37 -0400 Subject: [PATCH] shared/bap: Fix not notifying idle state The idle state must be notified like any other state. --- src/shared/bap.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index dbeb43fe5..ec23e882f 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1138,6 +1138,21 @@ static void stream_notify_release(struct bt_bap_stream *stream) bt_bap_get_att(stream->bap)); } +static void stream_notify_idle(struct bt_bap_stream *stream) +{ + struct bt_bap_endpoint *ep = stream->ep; + struct bt_ascs_ase_status status; + + DBG(stream->bap, "stream %p", stream); + + memset(&status, 0, sizeof(status)); + status.id = ep->id; + status.state = BT_ASCS_ASE_STATE_IDLE; + + gatt_db_attribute_notify(ep->attr, (void *)&status, sizeof(status), + bt_bap_get_att(stream->bap)); +} + static struct bt_bap *bt_bap_ref_safe(struct bt_bap *bap) { if (!bap || !bap->ref_count || !queue_find(sessions, NULL, bap)) @@ -1712,6 +1727,7 @@ static void stream_notify(struct bt_bap_stream *stream, uint8_t state) switch (state) { case BT_ASCS_ASE_STATE_IDLE: + stream_notify_idle(stream); break; case BT_ASCS_ASE_STATE_CONFIG: stream_notify_config(stream); -- 2.47.3