mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-26 12:35:25 +00:00
hfp: remove redundant checks
This commit is contained in:
parent
d751f069b9
commit
4be6b67e24
@ -725,24 +725,16 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
||||
|
||||
if (!hfp_connection) break;
|
||||
|
||||
if (hfp_connection->state != HFP_W4_SCO_DISCONNECTED){
|
||||
log_info("Received gap disconnect in wrong hfp state");
|
||||
}
|
||||
log_info("Check SCO handle: incoming 0x%02x, hfp_connection 0x%02x\n", handle, hfp_connection->sco_handle);
|
||||
|
||||
if (handle == hfp_connection->sco_handle){
|
||||
log_info("SCO disconnected, w2 disconnect RFCOMM\n");
|
||||
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
||||
hfp_connection->release_audio_connection = 0;
|
||||
hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED;
|
||||
hfp_emit_event(hfp_connection, HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED, 0);
|
||||
if (hfp_connection->release_slc_connection){
|
||||
hfp_connection->state = HFP_W4_RFCOMM_DISCONNECTED;
|
||||
hfp_connection->release_slc_connection = 0;
|
||||
rfcomm_disconnect(hfp_connection->rfcomm_cid);
|
||||
}
|
||||
break;
|
||||
}
|
||||
log_info("SCO disconnected, w2 disconnect RFCOMM\n");
|
||||
hfp_connection->sco_handle = HCI_CON_HANDLE_INVALID;
|
||||
hfp_connection->release_audio_connection = 0;
|
||||
hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED;
|
||||
hfp_emit_event(hfp_connection, HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED, 0);
|
||||
if (hfp_connection->release_slc_connection){
|
||||
hfp_connection->state = HFP_W4_RFCOMM_DISCONNECTED;
|
||||
hfp_connection->release_slc_connection = 0;
|
||||
rfcomm_disconnect(hfp_connection->rfcomm_cid);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user