Skip to content

Commit

Permalink
gap: introduce GIAC and LIAC, use gap_start_inquiry wrapper function
Browse files Browse the repository at this point in the history
  • Loading branch information
milamikica committed Sep 24, 2018
1 parent 18a0042 commit 8aee7be
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion platform/daemon/example/inquiry.c
Expand Up @@ -85,7 +85,7 @@ int getDeviceIndexForAddress( bd_addr_t addr){

void start_scan(void){
printf("Starting inquiry scan..\n");
bt_send_cmd(&hci_inquiry, HCI_INQUIRY_LAP, INQUIRY_INTERVAL, 0);
bt_send_cmd(&hci_inquiry, GAP_IAC_GENERAL_INQUIRY, INQUIRY_INTERVAL, 0);
}

int has_more_remote_name_requests(void){
Expand Down
2 changes: 1 addition & 1 deletion port/msp-exp430f5438-cc2564b/example/hid_demo.c
Expand Up @@ -285,7 +285,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
printLine("Inquiry");
state = inquiry;
hci_send_cmd(&hci_inquiry, HCI_INQUIRY_LAP, INQUIRY_INTERVAL, 0);
gap_inquiry_start(INQUIRY_INTERVAL);
break;
}
break;
Expand Down
3 changes: 2 additions & 1 deletion src/bluetooth.h
Expand Up @@ -298,7 +298,8 @@ typedef enum {
/**
* Default INQ Mode
*/
#define HCI_INQUIRY_LAP 0x9E8B33L // 0x9E8B33: General/Unlimited Inquiry Access Code (GIAC)
#define GAP_IAC_GENERAL_INQUIRY 0x9E8B33L // General/Unlimited Inquiry Access Code (GIAC)
#define GAP_IAC_LIMITED_INQUIRY 0x9E8B00L // Limited Dedicated Inquiry Access Code (LIAC)

/**
* SSP IO Capabilities
Expand Down
2 changes: 1 addition & 1 deletion src/hci.c
Expand Up @@ -3105,7 +3105,7 @@ static void hci_run(void){
if (hci_stack->inquiry_state >= GAP_INQUIRY_DURATION_MIN && hci_stack->inquiry_state <= GAP_INQUIRY_DURATION_MAX){
uint8_t duration = hci_stack->inquiry_state;
hci_stack->inquiry_state = GAP_INQUIRY_STATE_ACTIVE;
hci_send_cmd(&hci_inquiry, HCI_INQUIRY_LAP, duration, 0);
hci_send_cmd(&hci_inquiry, GAP_IAC_GENERAL_INQUIRY, duration, 0);
return;
}
if (hci_stack->inquiry_state == GAP_INQUIRY_STATE_W2_CANCEL){
Expand Down
2 changes: 1 addition & 1 deletion test/hfp/hfp_ag_client_test.c
Expand Up @@ -278,7 +278,7 @@ static void user_command(char cmd){
break;
case 'v':
printf("Starting inquiry scan..\n");
// hci_send_cmd(&hci_inquiry, HCI_INQUIRY_LAP, INQUIRY_INTERVAL, 0);
gap_inquiry_start(INQUIRY_INTERVAL);
break;
case 'w':
printf("AG: Put incoming call on hold (Response and Hold)\n");
Expand Down
2 changes: 1 addition & 1 deletion test/pts/classic_test.c
Expand Up @@ -137,7 +137,7 @@ static int getDeviceIndexForAddress( bd_addr_t addr){

static void start_scan(void){
printf("Starting inquiry scan..\n");
hci_send_cmd(&hci_inquiry, HCI_INQUIRY_LAP, INQUIRY_INTERVAL, 0);
gap_inquiry_start(INQUIRY_INTERVAL);
}

static int has_more_remote_name_requests(void){
Expand Down

0 comments on commit 8aee7be

Please sign in to comment.