mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-24 15:02:43 +00:00
hfp: clear VRA requested status on SCO disconnect
This commit is contained in:
parent
74350e1564
commit
4fe47d69db
@ -594,11 +594,15 @@ hfp_connection_t * get_hfp_connection_context_for_acl_handle(uint16_t handle, hf
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void hfp_vra_handle_disconnect(hfp_connection_t * hfp_connection) {
|
static void hfp_vra_handle_disconnect(hfp_connection_t * hfp_connection) {
|
||||||
hfp_voice_recognition_activation_status_t current_vra_state = hfp_connection->vra_state;
|
bool emit_vra_disabled = (hfp_connection->vra_state != HFP_VRA_VOICE_RECOGNITION_OFF) ||
|
||||||
|
(hfp_connection->vra_state_requested != HFP_VRA_VOICE_RECOGNITION_OFF);
|
||||||
|
|
||||||
hfp_connection->vra_state = HFP_VRA_VOICE_RECOGNITION_OFF;
|
hfp_connection->vra_state = HFP_VRA_VOICE_RECOGNITION_OFF;
|
||||||
if (current_vra_state != HFP_VRA_VOICE_RECOGNITION_OFF){
|
hfp_connection->vra_state_requested = hfp_connection->vra_state;
|
||||||
hfp_emit_voice_recognition_disabled(hfp_connection, ERROR_CODE_SUCCESS);
|
// ignore subsequent ok/error response
|
||||||
} else if (hfp_connection->vra_state_requested != HFP_VRA_VOICE_RECOGNITION_OFF){
|
hfp_connection->ok_pending = 0;
|
||||||
|
|
||||||
|
if (emit_vra_disabled){
|
||||||
hfp_emit_voice_recognition_disabled(hfp_connection, ERROR_CODE_SUCCESS);
|
hfp_emit_voice_recognition_disabled(hfp_connection, ERROR_CODE_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user