mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-23 09:41:03 +00:00
example: avoid HCI_EVENT_IS_COMMAND_COMPLETE macro
This commit is contained in:
parent
c70df5f87e
commit
98318a9712
@ -463,13 +463,14 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
|
|||||||
switch (packet_type){
|
switch (packet_type){
|
||||||
case HCI_EVENT_PACKET:
|
case HCI_EVENT_PACKET:
|
||||||
switch(hci_event_packet_get_type(event)){
|
switch(hci_event_packet_get_type(event)){
|
||||||
#ifndef HAVE_BTSTACK_STDIN
|
|
||||||
case BTSTACK_EVENT_STATE:
|
case BTSTACK_EVENT_STATE:
|
||||||
if (btstack_event_state_get_state(event) != HCI_STATE_WORKING) break;
|
if (btstack_event_state_get_state(event) != HCI_STATE_WORKING) break;
|
||||||
|
dump_supported_codecs();
|
||||||
|
#ifndef HAVE_BTSTACK_STDIN
|
||||||
printf("Establish HFP AG service level connection to %s...\n", bd_addr_to_str(device_addr));
|
printf("Establish HFP AG service level connection to %s...\n", bd_addr_to_str(device_addr));
|
||||||
hfp_ag_establish_service_level_connection(device_addr);
|
hfp_ag_establish_service_level_connection(device_addr);
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
case GAP_EVENT_INQUIRY_RESULT:
|
case GAP_EVENT_INQUIRY_RESULT:
|
||||||
gap_event_inquiry_result_get_bd_addr(event, addr);
|
gap_event_inquiry_result_get_bd_addr(event, addr);
|
||||||
// print info
|
// print info
|
||||||
@ -493,11 +494,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
|
|||||||
case HCI_EVENT_SCO_CAN_SEND_NOW:
|
case HCI_EVENT_SCO_CAN_SEND_NOW:
|
||||||
sco_demo_send(sco_handle);
|
sco_demo_send(sco_handle);
|
||||||
break;
|
break;
|
||||||
case HCI_EVENT_COMMAND_COMPLETE:
|
|
||||||
if (HCI_EVENT_IS_COMMAND_COMPLETE(event, hci_read_local_supported_features)){
|
|
||||||
dump_supported_codecs();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -462,14 +462,13 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
|
|||||||
|
|
||||||
case HCI_EVENT_PACKET:
|
case HCI_EVENT_PACKET:
|
||||||
switch (hci_event_packet_get_type(event)){
|
switch (hci_event_packet_get_type(event)){
|
||||||
case HCI_EVENT_SCO_CAN_SEND_NOW:
|
case BTSTACK_EVENT_STATE:
|
||||||
sco_demo_send(sco_handle);
|
if (btstack_event_state_get_state(event) != HCI_STATE_WORKING) break;
|
||||||
|
dump_supported_codecs();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_COMMAND_COMPLETE:
|
case HCI_EVENT_SCO_CAN_SEND_NOW:
|
||||||
if (HCI_EVENT_IS_COMMAND_COMPLETE(event, hci_read_local_supported_features)){
|
sco_demo_send(sco_handle);
|
||||||
dump_supported_codecs();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_HFP_META:
|
case HCI_EVENT_HFP_META:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user