Permalink
Browse files

gap: introduce GIAC and LIAC, use gap_start_inquiry wrapper function

  • Loading branch information...
milamikica committed Sep 24, 2018
1 parent 18a0042 commit 8aee7be2bb0c8b43bca4bd821fe34961b31db7aa
@@ -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){
@@ -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;
View
@@ -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
View
@@ -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){
@@ -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");
View
@@ -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){

0 comments on commit 8aee7be

Please sign in to comment.