use btstack_event_state_get_state

This commit is contained in:
Milanka Ringwald 2016-04-01 12:07:08 +02:00
parent b4469d4b59
commit fb42b6e599
11 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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();

View File

@ -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);
}

View File

@ -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();
}