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 <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-04-22 10:51:07 +02:00 committed by Carles Cufí
commit 55de0fd353

View file

@ -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); 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_ascs_ase *ase = CONTAINER_OF(work, struct bt_ascs_ase, work);
struct bt_gatt_attr attr; 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); ascs_ep_get_status(&ase->ep, &ase_buf);
memset(&attr, 0, sizeof(attr)); memset(&attr, 0, sizeof(attr));