hfp_ag: use explicit cases for vra_state_requested

This commit is contained in:
Matthias Ringwald 2021-08-29 10:28:06 +02:00
parent 9a8f78c1e2
commit 6e13e408eb

View File

@ -891,11 +891,12 @@ static int hfp_ag_voice_recognition_state_machine(hfp_connection_t * hfp_connect
hfp_connection->vra_state_requested = hfp_connection->vra_state; hfp_connection->vra_state_requested = hfp_connection->vra_state;
return done; return done;
default: case HFP_VRA_W2_SEND_VOICE_RECOGNITION_ACTIVATED:
case HFP_VRA_W2_SEND_VOICE_RECOGNITION_OFF:
done = hfp_ag_send_voice_recognition_cmd(hfp_connection, hfp_connection->ag_activate_voice_recognition_value); done = hfp_ag_send_voice_recognition_cmd(hfp_connection, hfp_connection->ag_activate_voice_recognition_value);
if (done == 0){ if (done == 0){
hfp_connection->vra_state_requested = hfp_connection->vra_state; hfp_connection->vra_state_requested = hfp_connection->vra_state;
if (hfp_connection->ag_activate_voice_recognition_value == 1){ if (hfp_connection->ag_activate_voice_recognition_value == 1){
hfp_emit_voice_recognition_enabled(hfp_connection, done); hfp_emit_voice_recognition_enabled(hfp_connection, done);
} else { } else {
@ -904,6 +905,10 @@ static int hfp_ag_voice_recognition_state_machine(hfp_connection_t * hfp_connect
return 0; return 0;
} }
break; break;
default:
log_error("state %u", hfp_connection->vra_state_requested);
btstack_assert(false);
break;
} }
break; break;