mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-31 09:32:57 +00:00
use btstack_event_state_get_state
This commit is contained in:
parent
b4469d4b59
commit
fb42b6e599
@ -631,7 +631,7 @@ registered callback, as shown in Listing [below](#lst:SDPClientRFCOMM).
|
||||
switch (event) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// bt stack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
sdp_client_query_rfcomm_channel_and_name_for_uuid(remote, 0x0003);
|
||||
}
|
||||
break;
|
||||
|
@ -54,7 +54,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
switch (hci_event_packet_get_type(packet)) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// bt stack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
gap_dedicated_bonding(remote, 1);
|
||||
}
|
||||
break;
|
||||
|
@ -145,7 +145,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
case INIT:
|
||||
switch(event){
|
||||
case BTSTACK_EVENT_STATE:
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
start_scan();
|
||||
state = ACTIVE;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
case INIT:
|
||||
switch(event){
|
||||
case BTSTACK_EVENT_STATE:
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
hci_send_cmd(&hci_write_inquiry_mode, 0x01); // with RSSI
|
||||
state = W4_INQUIRY_MODE_COMPLETE;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
switch (event) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// BTstack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
printf("Start SDP BNEP query.\n");
|
||||
sdp_client_query_uuid16(&handle_sdp_client_query_result, remote, SDP_BNEPProtocol);
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
|
||||
switch (event) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
sdp_client_query_uuid16(&handle_sdp_client_query_result, remote, SDP_PublicBrowseGroup);
|
||||
}
|
||||
break;
|
||||
|
@ -77,7 +77,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
switch (event) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// bt stack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
sdp_client_query_rfcomm_channel_and_name_for_uuid(&handle_query_rfcomm_event, remote, SDP_PublicBrowseGroup);
|
||||
}
|
||||
break;
|
||||
|
@ -155,7 +155,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
switch (event) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// bt stack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
printf("SDP Query for RFCOMM services on %s started\n", bd_addr_to_str(remote));
|
||||
sdp_client_query_rfcomm_channel_and_name_for_uuid(&handle_query_rfcomm_event, remote, SDP_PublicBrowseGroup);
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// bt stack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
printf("BTstack Bluetooth Classic Test Ready\n");
|
||||
hci_send_cmd(&hci_write_inquiry_mode, 0x01); // with RSSI
|
||||
show_usage();
|
||||
|
@ -105,7 +105,7 @@ static void packet_handler(void * connection, uint8_t packet_type, uint16_t chan
|
||||
switch (event) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// bt stack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
printf("Start SDP RFCOMM Query for UUID 0x%02x\n", SDP_Handsfree);
|
||||
sdp_client_query_rfcomm_channel_and_name_for_uuid(&handle_query_rfcomm_event, remote, SDP_Handsfree);
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
switch (packet[0]) {
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// bt stack activated, get started
|
||||
if (packet[2] == HCI_STATE_WORKING){
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
printf("BTstack L2CAP Test Ready\n");
|
||||
show_usage();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user