mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-02 22:13:36 +00:00
gap: add gap_inquiry_lap to allow for limited inquiry
This commit is contained in:
parent
59c9672f30
commit
496bb88446
@ -688,6 +688,12 @@ int gap_inquiry_start(uint8_t duration_in_1280ms_units);
|
||||
*/
|
||||
int gap_inquiry_stop(void);
|
||||
|
||||
/**
|
||||
* @brief Set LAP for GAP Classic Inquiry
|
||||
* @param lap GAP_IAC_GENERAL_INQUIRY (default), GAP_IAC_LIMITED_INQUIRY
|
||||
*/
|
||||
void gap_inquiry_set_lap(uint32_t lap);
|
||||
|
||||
/**
|
||||
* @brief Remote Name Request
|
||||
* @param addr
|
||||
|
11
src/hci.c
11
src/hci.c
@ -3131,10 +3131,11 @@ static void hci_state_reset(void){
|
||||
|
||||
hci_stack->secure_connections_active = false;
|
||||
|
||||
#ifdef ENABLE_CLASSIC
|
||||
#ifdef ENABLE_CLASSIC
|
||||
hci_stack->new_page_scan_interval = 0xffff;
|
||||
hci_stack->new_page_scan_window = 0xffff;
|
||||
hci_stack->new_page_scan_type = 0xff;
|
||||
hci_stack->inquiry_lap = GAP_IAC_GENERAL_INQUIRY;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CLASSIC_PAIRING_OOB
|
||||
@ -3828,7 +3829,7 @@ static bool hci_run_general_gap_classic(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_W4_ACTIVE;
|
||||
hci_send_cmd(&hci_inquiry, GAP_IAC_GENERAL_INQUIRY, duration, 0);
|
||||
hci_send_cmd(&hci_inquiry, hci_stack->inquiry_lap, duration, 0);
|
||||
return true;
|
||||
}
|
||||
if (hci_stack->inquiry_state == GAP_INQUIRY_STATE_W2_CANCEL){
|
||||
@ -5989,7 +5990,11 @@ int gap_inquiry_stop(void){
|
||||
hci_stack->inquiry_state = GAP_INQUIRY_STATE_W2_CANCEL;
|
||||
hci_run();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void gap_inquiry_set_lap(uint32_t lap){
|
||||
hci_stack->inquiry_lap = lap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -853,6 +853,8 @@ typedef struct {
|
||||
uint8_t gap_required_encyrption_key_size;
|
||||
uint16_t link_supervision_timeout;
|
||||
gap_security_level_t gap_security_level;
|
||||
|
||||
uint32_t inquiry_lap; // GAP_IAC_GENERAL_INQUIRY or GAP_IAC_LIMITED_INQUIRY
|
||||
#endif
|
||||
|
||||
// single buffer for HCI packet assembly + additional prebuffer for H4 drivers
|
||||
|
Loading…
x
Reference in New Issue
Block a user