mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-03 10:20:18 +00:00
forward HCI Events to app
This commit is contained in:
parent
ed361f5fa1
commit
1e3940b9de
10
src/hsp_hs.c
10
src/hsp_hs.c
@ -474,6 +474,9 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// forward event to app
|
||||||
|
hsp_hs_callback(packet, size);
|
||||||
|
|
||||||
hsp_state = HSP_ACTIVE;
|
hsp_state = HSP_ACTIVE;
|
||||||
emit_event(HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE, 0);
|
emit_event(HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE, 0);
|
||||||
break;
|
break;
|
||||||
@ -521,12 +524,13 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
|||||||
break;
|
break;
|
||||||
case DAEMON_EVENT_HCI_PACKET_SENT:
|
case DAEMON_EVENT_HCI_PACKET_SENT:
|
||||||
case RFCOMM_EVENT_CREDITS:
|
case RFCOMM_EVENT_CREDITS:
|
||||||
|
hsp_hs_callback(packet, size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
||||||
printf("HCI_EVENT_DISCONNECTION_COMPLETE \n");
|
printf("HCI_EVENT_DISCONNECTION_COMPLETE \n");
|
||||||
if (hsp_state != HSP_W4_SCO_DISCONNECTED){
|
if (hsp_state != HSP_W4_SCO_DISCONNECTED){
|
||||||
printf("received gap disconnect in wrong hsp state");
|
printf("received gap disconnect in wrong hsp state\n");
|
||||||
}
|
}
|
||||||
handle = READ_BT_16(packet,3);
|
handle = READ_BT_16(packet,3);
|
||||||
if (handle == sco_handle){
|
if (handle == sco_handle){
|
||||||
@ -537,9 +541,9 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RFCOMM_EVENT_CHANNEL_CLOSED:
|
case RFCOMM_EVENT_CHANNEL_CLOSED:
|
||||||
printf(" RFCOMM_EVENT_CHANNEL_CLOSED\n");
|
printf("RFCOMM_EVENT_CHANNEL_CLOSED\n");
|
||||||
if (hsp_state != HSP_W4_RFCOMM_DISCONNECTED){
|
if (hsp_state != HSP_W4_RFCOMM_DISCONNECTED){
|
||||||
printf("received RFCOMM disconnect in wrong hsp state");
|
printf("received RFCOMM disconnect in wrong hsp state\n");
|
||||||
}
|
}
|
||||||
printf("RFCOMM channel closed\n");
|
printf("RFCOMM channel closed\n");
|
||||||
hsp_hs_reset_state();
|
hsp_hs_reset_state();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user