mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
hfp: separate reset vra and handle disconnect for vra
This commit is contained in:
parent
4bb67668b8
commit
e6afdfd82c
@ -594,9 +594,6 @@ static void hfp_vra_handle_disconnect(hfp_connection_t * hfp_connection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void hfp_reset_voice_recognition(hfp_connection_t * hfp_connection){
|
static void hfp_reset_voice_recognition(hfp_connection_t * hfp_connection){
|
||||||
|
|
||||||
hfp_vra_handle_disconnect(hfp_connection);
|
|
||||||
|
|
||||||
hfp_connection->vra_state_requested = HFP_VRA_VOICE_RECOGNITION_OFF;
|
hfp_connection->vra_state_requested = HFP_VRA_VOICE_RECOGNITION_OFF;
|
||||||
hfp_connection->activate_voice_recognition = false;
|
hfp_connection->activate_voice_recognition = false;
|
||||||
hfp_connection->deactivate_voice_recognition = false;
|
hfp_connection->deactivate_voice_recognition = false;
|
||||||
@ -607,7 +604,6 @@ static void hfp_reset_voice_recognition(hfp_connection_t * hfp_connection){
|
|||||||
|
|
||||||
void hfp_reset_context_flags(hfp_connection_t * hfp_connection){
|
void hfp_reset_context_flags(hfp_connection_t * hfp_connection){
|
||||||
hfp_connection->establish_audio_connection = 0;
|
hfp_connection->establish_audio_connection = 0;
|
||||||
hfp_reset_voice_recognition(hfp_connection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static hfp_connection_t * create_hfp_connection_context(void){
|
static hfp_connection_t * create_hfp_connection_context(void){
|
||||||
@ -649,6 +645,7 @@ static hfp_connection_t * create_hfp_connection_context(void){
|
|||||||
hfp_connection->negotiated_codec = 0;
|
hfp_connection->negotiated_codec = 0;
|
||||||
hfp_connection->codec_confirmed = 0;
|
hfp_connection->codec_confirmed = 0;
|
||||||
|
|
||||||
|
hfp_reset_voice_recognition(hfp_connection);
|
||||||
hfp_reset_context_flags(hfp_connection);
|
hfp_reset_context_flags(hfp_connection);
|
||||||
|
|
||||||
btstack_linked_list_add_tail(&hfp_connections, (btstack_linked_item_t*)hfp_connection);
|
btstack_linked_list_add_tail(&hfp_connections, (btstack_linked_item_t*)hfp_connection);
|
||||||
@ -1034,7 +1031,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
|||||||
hfp_connection->ag_audio_connection_opened_before_vra = false;
|
hfp_connection->ag_audio_connection_opened_before_vra = false;
|
||||||
|
|
||||||
if (hfp_connection->acl_handle == HCI_CON_HANDLE_INVALID){
|
if (hfp_connection->acl_handle == HCI_CON_HANDLE_INVALID){
|
||||||
hfp_reset_voice_recognition(hfp_connection);
|
hfp_vra_handle_disconnect(hfp_connection);
|
||||||
hfp_emit_event(hfp_connection, HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED, 0);
|
hfp_emit_event(hfp_connection, HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED, 0);
|
||||||
hfp_finalize_connection_context(hfp_connection);
|
hfp_finalize_connection_context(hfp_connection);
|
||||||
break;
|
break;
|
||||||
@ -1151,7 +1148,7 @@ void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
// regular case
|
// regular case
|
||||||
hfp_reset_voice_recognition(hfp_connection);
|
hfp_vra_handle_disconnect(hfp_connection);
|
||||||
hfp_emit_event(hfp_connection, HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED, 0);
|
hfp_emit_event(hfp_connection, HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED, 0);
|
||||||
hfp_finalize_connection_context(hfp_connection);
|
hfp_finalize_connection_context(hfp_connection);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user