diff --git a/src/classic/hfp.c b/src/classic/hfp.c index f83df0783..8fa8c232e 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -604,12 +604,7 @@ static void hfp_reset_voice_recognition(hfp_connection_t * hfp_connection){ } void hfp_reset_context_flags(hfp_connection_t * hfp_connection){ - // establish codecs hfp_connection - hfp_connection->suggested_codec = 0; - hfp_connection->negotiated_codec = 0; - hfp_connection->codec_confirmed = 0; - - hfp_connection->establish_audio_connection = 0; + hfp_connection->establish_audio_connection = 0; hfp_connection->enable_status_update_for_ag_indicators = 0xFF; hfp_reset_voice_recognition(hfp_connection); } @@ -647,6 +642,11 @@ static hfp_connection_t * create_hfp_connection_context(void){ hfp_connection->enable_extended_audio_gateway_error_report = 0; hfp_connection->call_waiting_notification_enabled = 0; + // Codec negotiation + hfp_connection->suggested_codec = 0; + hfp_connection->negotiated_codec = 0; + hfp_connection->codec_confirmed = 0; + hfp_reset_context_flags(hfp_connection); btstack_linked_list_add_tail(&hfp_connections, (btstack_linked_item_t*)hfp_connection);