mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +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;
|
||||
}
|
||||
|
||||
// forward event to app
|
||||
hsp_hs_callback(packet, size);
|
||||
|
||||
hsp_state = HSP_ACTIVE;
|
||||
emit_event(HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE, 0);
|
||||
break;
|
||||
@ -521,12 +524,13 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
||||
break;
|
||||
case DAEMON_EVENT_HCI_PACKET_SENT:
|
||||
case RFCOMM_EVENT_CREDITS:
|
||||
hsp_hs_callback(packet, size);
|
||||
break;
|
||||
|
||||
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
||||
printf("HCI_EVENT_DISCONNECTION_COMPLETE \n");
|
||||
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);
|
||||
if (handle == sco_handle){
|
||||
@ -537,9 +541,9 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
||||
}
|
||||
break;
|
||||
case RFCOMM_EVENT_CHANNEL_CLOSED:
|
||||
printf(" RFCOMM_EVENT_CHANNEL_CLOSED\n");
|
||||
printf("RFCOMM_EVENT_CHANNEL_CLOSED\n");
|
||||
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");
|
||||
hsp_hs_reset_state();
|
||||
|
Loading…
x
Reference in New Issue
Block a user