From 0e0be2033c3f91c12fc466fc4da0d4cd07b40614 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 10 Jan 2017 15:57:58 +0100 Subject: [PATCH] hfp_hf: consider codec accepted when we support the requested one - before we get the OK --- src/classic/hfp_hf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index 3a80ab5ef..03890067c 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -530,6 +530,8 @@ static int codecs_exchange_state_machine(hfp_connection_t * hfp_connection){ hfp_connection->codec_confirmed = hfp_connection->suggested_codec; hfp_connection->ok_pending = 1; hfp_connection->codecs_state = HFP_CODECS_HF_CONFIRMED_CODEC; + hfp_connection->negotiated_codec = hfp_connection->suggested_codec; + log_info("hfp: codec confirmed: %s", hfp_connection->negotiated_codec == HFP_CODEC_MSBC ? "mSBC" : "CVSD"); hfp_hf_cmd_confirm_codec(hfp_connection->rfcomm_cid, hfp_connection->codec_confirmed); } else { hfp_connection->codec_confirmed = 0; @@ -965,8 +967,6 @@ static void hfp_hf_switch_on_ok(hfp_connection_t *hfp_connection){ break; case HFP_CODECS_HF_CONFIRMED_CODEC: hfp_connection->codecs_state = HFP_CODECS_EXCHANGED; - hfp_connection->negotiated_codec = hfp_connection->suggested_codec; - log_info("hfp: codec confirmed: %s", hfp_connection->negotiated_codec == HFP_CODEC_MSBC ? "mSBC" : "CVSD"); break; default: break;