From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> When EATT is enabled it is possible that response are generated out of order, since they may come from different sockets/fds, so this attempts to detect when that happens by checking if the state has already been changed. --- profiles/audio/bap.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 6184c9d178a8..a4036bbbdfa8 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -801,8 +801,20 @@ static void config_cb(struct bt_bap_stream *stream, setup->id = 0; - if (!code) + if (!code) { + /* Check state is already set to config then proceed to qos */ + if (bt_bap_stream_get_state(stream) == + BT_BAP_STREAM_STATE_CONFIG) { + setup->id = bt_bap_stream_qos(stream, &setup->qos, + qos_cb, setup); + if (!setup->id) { + error("Failed to Configure QoS"); + bt_bap_stream_release(stream, NULL, NULL); + } + } + return; + } if (!setup->msg) return; -- 2.43.0