hsp_ag: fix state on sco connection setup error

This commit is contained in:
Matthias Ringwald 2020-08-27 10:37:07 +02:00
parent 9c30c50ad9
commit 2277d11237

View File

@ -564,6 +564,9 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
case HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE:{
uint8_t status = hci_event_synchronous_connection_complete_get_status(packet);
if (status != 0){
if (hsp_state == HSP_W4_SCO_CONNECTED){
hsp_state = HSP_RFCOMM_CONNECTION_ESTABLISHED;
}
log_error("(e)SCO Connection failed, status %u", status);
emit_event_audio_connected(status, sco_handle);
break;