From 55de0fd353ef3029527011c498b9f9992c4178b9 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Fri, 22 Apr 2022 10:51:07 +0200 Subject: [PATCH] Bluetooth: ASCS: Fixed wrong state for detaching stream The audio stream should be detached from the endpoint when the endpoint goes into the releasing state, instead of the idle state. Signed-off-by: Emil Gydesen --- subsys/bluetooth/audio/ascs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 7f49a34e07d..2ed0bae5205 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -141,7 +141,7 @@ void ascs_ep_set_state(struct bt_audio_ep *ep, uint8_t state) } } - if (state == BT_AUDIO_EP_STATE_IDLE) { + if (state == BT_AUDIO_EP_STATE_RELEASING) { bt_audio_stream_detach(ep->stream); } } @@ -755,6 +755,8 @@ static void ase_process(struct k_work *work) struct bt_ascs_ase *ase = CONTAINER_OF(work, struct bt_ascs_ase, work); struct bt_gatt_attr attr; + BT_DBG("ase %p, ep %p, ep.stream %p", ase, &ase->ep, ase->ep.stream); + ascs_ep_get_status(&ase->ep, &ase_buf); memset(&attr, 0, sizeof(attr));