mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-10 10:13:33 +00:00
examples: check event type of BTSTACK_EVENT_STATE event
This commit is contained in:
parent
3de6de0559
commit
62d809aba1
@ -150,10 +150,16 @@ static void packet_handler (uint8_t packet_type, uint8_t *packet, uint16_t size)
|
||||
/* @text In INIT, an inquiry scan is started, and the application transits to
|
||||
* ACTIVE state.
|
||||
*/
|
||||
case INIT:
|
||||
if (packet[2] == HCI_STATE_WORKING) {
|
||||
start_scan();
|
||||
state = ACTIVE;
|
||||
case INIT:
|
||||
switch(event){
|
||||
case BTSTACK_EVENT_STATE:
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
start_scan();
|
||||
state = ACTIVE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -137,9 +137,15 @@ static void packet_handler (uint8_t packet_type, uint8_t *packet, uint16_t size)
|
||||
switch(state){
|
||||
|
||||
case INIT:
|
||||
if (packet[2] == HCI_STATE_WORKING) {
|
||||
hci_send_cmd(&hci_write_inquiry_mode, 0x01); // with RSSI
|
||||
state = W4_INQUIRY_MODE_COMPLETE;
|
||||
switch(event){
|
||||
case BTSTACK_EVENT_STATE:
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
hci_send_cmd(&hci_write_inquiry_mode, 0x01); // with RSSI
|
||||
state = W4_INQUIRY_MODE_COMPLETE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user