bluez5: hfp-hf: don't change hf_state after sending AT+BCS

The +BCS event may interrupt any of the initialization commands after
SLC is established and by changing the state here we may lose track
of the initialization sequence.

There is no reason to have the hfp_hf_bcs state anyway. If the
initialization sequence is over, we can remain in the hfp_hf_vgm state.
This commit is contained in:
George Kiagiadakis 2025-04-25 20:24:27 +03:00 committed by Wim Taymans
parent 7f07448a80
commit 8e62b08e58

View file

@ -142,8 +142,7 @@ enum hfp_hf_state {
hfp_hf_slc1,
hfp_hf_slc2,
hfp_hf_vgs,
hfp_hf_vgm,
hfp_hf_bcs
hfp_hf_vgm
};
enum hsp_hs_state {
@ -2012,8 +2011,6 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* token)
/* send codec selection to AG */
rfcomm_send_cmd(rfcomm, "AT+BCS=%u", selected_codec);
rfcomm->hf_state = hfp_hf_bcs;
if (!rfcomm->transport || (rfcomm->transport->codec != selected_codec) ) {
if (rfcomm_new_transport(rfcomm, selected_codec) < 0) {
// TODO: We should manage the missing transport