From d2e34ffbec341d76e0624304909e07d63f1ccd92 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 11 May 2023 09:30:43 +0200 Subject: [PATCH] hfp: fix setup/accept of synchronous connection --- CHANGELOG.md | 1 + src/classic/hfp_ag.c | 1 + src/classic/hfp_hf.c | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79acee3e4..d914867da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - A2DP: emit A2DP_SUBEVENT_STREAM_ESTABLISHED with if connection fails, e.g. because of Page Timeout - A2DP: use samples as timestamp, fixes issue with Apple Airpods Pro 2nd Gen - AVRCP: re-register for notification +- HFP: fix setup/accept of synchronous connection - PBAP Client: make pbap_set_property_selector work for Pull Phonebook - esp32: fix power amplifier control on Lyra T v4.3 diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c index c5974f343..041792974 100644 --- a/src/classic/hfp_ag.c +++ b/src/classic/hfp_ag.c @@ -1133,6 +1133,7 @@ static int hfp_ag_run_for_audio_connection(hfp_connection_t * hfp_connection){ if (sent) return 1; if (hfp_connection->codecs_state != HFP_CODECS_EXCHANGED) return 0; + if (hci_can_send_command_packet_now() == false) return 0; if (hfp_connection->establish_audio_connection){ hfp_connection->state = HFP_W4_SCO_CONNECTED; hfp_connection->establish_audio_connection = 0; diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index 65efe3513..6be93629b 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -711,6 +711,7 @@ static int hfp_hf_run_for_audio_connection(hfp_connection_t * hfp_connection){ if (done) return 1; if (hfp_connection->codecs_state != HFP_CODECS_EXCHANGED) return 0; + if (hci_can_send_command_packet_now() == false) return 0; if (hfp_connection->establish_audio_connection){ hfp_connection->state = HFP_W4_SCO_CONNECTED; hfp_connection->establish_audio_connection = 0;