diff --git a/platform/daemon/example/inquiry.c b/platform/daemon/example/inquiry.c index 426513d40..97d7367e6 100644 --- a/platform/daemon/example/inquiry.c +++ b/platform/daemon/example/inquiry.c @@ -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){ diff --git a/port/msp-exp430f5438-cc2564b/example/hid_demo.c b/port/msp-exp430f5438-cc2564b/example/hid_demo.c index 87ec7ace2..ed1ea646e 100644 --- a/port/msp-exp430f5438-cc2564b/example/hid_demo.c +++ b/port/msp-exp430f5438-cc2564b/example/hid_demo.c @@ -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; diff --git a/src/bluetooth.h b/src/bluetooth.h index 0c35931ac..2fce59f44 100644 --- a/src/bluetooth.h +++ b/src/bluetooth.h @@ -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 diff --git a/src/hci.c b/src/hci.c index b8c9623b5..f8e8af3b1 100644 --- a/src/hci.c +++ b/src/hci.c @@ -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){ diff --git a/test/hfp/hfp_ag_client_test.c b/test/hfp/hfp_ag_client_test.c index 53f66ca7b..767e11c83 100644 --- a/test/hfp/hfp_ag_client_test.c +++ b/test/hfp/hfp_ag_client_test.c @@ -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"); diff --git a/test/pts/classic_test.c b/test/pts/classic_test.c index b96e678a3..d772ccdaf 100644 --- a/test/pts/classic_test.c +++ b/test/pts/classic_test.c @@ -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){