mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-25 09:02:30 +00:00
forward more events to app, fix race-condition for synchronous transport
This commit is contained in:
parent
8e91fbe287
commit
deb81c610f
@ -318,12 +318,15 @@ static void hsp_run(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hs_send_button_press){
|
if (hs_send_button_press){
|
||||||
|
hs_send_button_press = 0;
|
||||||
if (hsp_state == HSP_W4_USER_ACTION){
|
if (hsp_state == HSP_W4_USER_ACTION){
|
||||||
err = hsp_hs_send_str_over_rfcomm(rfcomm_cid, HSP_HS_AT_CKPD);
|
err = hsp_hs_send_str_over_rfcomm(rfcomm_cid, HSP_HS_AT_CKPD);
|
||||||
} else {
|
} else {
|
||||||
err = hsp_hs_send_str_over_rfcomm(rfcomm_cid, HSP_HS_BUTTON_PRESS);
|
err = hsp_hs_send_str_over_rfcomm(rfcomm_cid, HSP_HS_BUTTON_PRESS);
|
||||||
}
|
}
|
||||||
if (!err) hs_send_button_press = 0;
|
if (err) {
|
||||||
|
hs_send_button_press = 1;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,6 +422,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
|||||||
if (packet[2] == HCI_STATE_WORKING){
|
if (packet[2] == HCI_STATE_WORKING){
|
||||||
printf("BTstack activated, get started .\n");
|
printf("BTstack activated, get started .\n");
|
||||||
}
|
}
|
||||||
|
hsp_hs_callback(packet, size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_PIN_CODE_REQUEST:
|
case HCI_EVENT_PIN_CODE_REQUEST:
|
||||||
@ -446,7 +450,6 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
|||||||
|
|
||||||
if (status != 0){
|
if (status != 0){
|
||||||
log_error("(e)SCO Connection is not established, status %u", status);
|
log_error("(e)SCO Connection is not established, status %u", status);
|
||||||
exit(0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (link_type){
|
switch (link_type){
|
||||||
@ -522,6 +525,7 @@ 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 HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS:
|
||||||
case RFCOMM_EVENT_CREDITS:
|
case RFCOMM_EVENT_CREDITS:
|
||||||
hsp_hs_callback(packet, size);
|
hsp_hs_callback(packet, size);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user