diff --git a/components/bt/host/bluedroid/bta/include/bta/bta_api.h b/components/bt/host/bluedroid/bta/include/bta/bta_api.h index afadad4fe24..b5e94c15c8c 100644 --- a/components/bt/host/bluedroid/bta/include/bta/bta_api.h +++ b/components/bt/host/bluedroid/bta/include/bta/bta_api.h @@ -293,9 +293,6 @@ typedef struct { BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */ tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */ tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */ -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - UINT8 intl_duration[4];/*duration array storing the interleave scan's time portions*/ -#endif } tBTA_DM_INQ; /* Config EIR callback */ diff --git a/components/bt/host/bluedroid/stack/btm/btm_inq.c b/components/bt/host/bluedroid/stack/btm/btm_inq.c index c74f2b43961..b6b7c472056 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_inq.c +++ b/components/bt/host/bluedroid/stack/btm/btm_inq.c @@ -718,9 +718,6 @@ tBTM_STATUS BTM_CancelInquiry(void) { tBTM_STATUS status = BTM_SUCCESS; tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - UINT8 active_mode = p_inq->inq_active; -#endif BTM_TRACE_API ("BTM_CancelInquiry called\n"); /*** Make sure the device is ready ***/ @@ -745,9 +742,6 @@ tBTM_STATUS BTM_CancelInquiry(void) /* Initiate the cancel inquiry */ else { if (((p_inq->inqparms.mode & BTM_BR_INQUIRY_MASK) != 0) -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - && (active_mode & BTM_BR_INQUIRY_MASK) -#endif ) { if (!btsnd_hcic_inq_cancel()) { status = BTM_NO_RESOURCES; @@ -755,9 +749,6 @@ tBTM_STATUS BTM_CancelInquiry(void) } #if BLE_INCLUDED == TRUE if (((p_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK) != 0) -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - && (active_mode & BTM_BLE_INQ_ACTIVE_MASK) -#endif ) { btm_ble_stop_inquiry(); } @@ -852,13 +843,6 @@ tBTM_STATUS BTM_StartInquiry (tBTM_INQ_PARMS *p_inqparms, tBTM_INQ_RESULTS_CB *p return (BTM_ILLEGAL_VALUE); } -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - if (p_inq->next_state == BTM_FINISH) { - return BTM_ILLEGAL_VALUE; - } -#endif - - /* Save the inquiry parameters to be used upon the completion of setting/clearing the inquiry filter */ p_inq->inqparms = *p_inqparms; @@ -870,38 +854,12 @@ tBTM_STATUS BTM_StartInquiry (tBTM_INQ_PARMS *p_inqparms, tBTM_INQ_RESULTS_CB *p p_inq->inq_active = p_inqparms->mode; BTM_TRACE_DEBUG("BTM_StartInquiry: p_inq->inq_active = 0x%02x\n", p_inq->inq_active); - - /* interleave scan minimal conditions */ -#if (BLE_INCLUDED==TRUE && (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE)) - - /* check if both modes are present */ - if ((p_inqparms->mode & BTM_BLE_INQUIRY_MASK) && (p_inqparms->mode & BTM_BR_INQUIRY_MASK)) { - BTM_TRACE_API("BTM:Interleave Inquiry Mode Set\n"); - p_inqparms->duration = p_inqparms->intl_duration[p_inq->next_state]; - p_inq->inqparms.duration = p_inqparms->duration; - } else { - BTM_TRACE_API("BTM:Single Mode: No interleaving, Mode:0x%02x\n", p_inqparms->mode); - p_inq->next_state = BTM_NO_INTERLEAVING; - } -#endif - - - /* start LE inquiry here if requested */ #if BLE_INCLUDED == TRUE if ((p_inqparms->mode & BTM_BLE_INQUIRY_MASK) -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - && (p_inq->next_state == BTM_BLE_ONE || p_inq->next_state == BTM_BLE_TWO || - p_inq->next_state == BTM_NO_INTERLEAVING) -#endif ) { -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - p_inq->inq_active = (p_inqparms->mode & BTM_BLE_INQUIRY_MASK); - BTM_TRACE_API("BTM:Starting LE Scan with duration %d and activeMode:0x%02x\n", - p_inqparms->duration, (p_inqparms->mode & BTM_BLE_INQUIRY_MASK)); -#endif if (!controller_get_interface()->supports_ble()) { p_inq->inqparms.mode &= ~ BTM_BLE_INQUIRY_MASK; status = BTM_ILLEGAL_VALUE; @@ -912,27 +870,7 @@ tBTM_STATUS BTM_StartInquiry (tBTM_INQ_PARMS *p_inqparms, tBTM_INQ_RESULTS_CB *p BTM_TRACE_ERROR("Err Starting LE Inquiry.\n"); p_inq->inqparms.mode &= ~ BTM_BLE_INQUIRY_MASK; } -#if (!defined(BTA_HOST_INTERLEAVE_SEARCH) || BTA_HOST_INTERLEAVE_SEARCH == FALSE) p_inqparms->mode &= ~BTM_BLE_INQUIRY_MASK; -#endif - -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - if (p_inq->next_state == BTM_NO_INTERLEAVING) { - p_inq->next_state = BTM_FINISH; - } else { - BTM_TRACE_API("BTM:Interleaving: started LE scan, Advancing to next state: %d\n", - p_inq->next_state + 1); - p_inq->next_state += 1; - } - /* reset next_state if status <> BTM_Started */ - if (status != BTM_CMD_STARTED) { - p_inq->next_state = BTM_BR_ONE; - } - - /* if interleave scan..return here */ - return status; -#endif - BTM_TRACE_DEBUG("BTM_StartInquiry: mode = %02x\n", p_inqparms->mode); } @@ -944,11 +882,6 @@ tBTM_STATUS BTM_StartInquiry (tBTM_INQ_PARMS *p_inqparms, tBTM_INQ_RESULTS_CB *p } /* BR/EDR inquiry portion */ -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - if ((p_inq->next_state == BTM_BR_ONE || p_inq->next_state == BTM_BR_TWO || - p_inq->next_state == BTM_NO_INTERLEAVING )) { - p_inq->inq_active = (p_inqparms->mode & BTM_BR_INQUIRY_MASK); -#endif /* If a filter is specified, then save it for later and clear the current filter. The setting of the filter is done upon completion of clearing of the previous filter. @@ -977,25 +910,6 @@ tBTM_STATUS BTM_StartInquiry (tBTM_INQ_PARMS *p_inqparms, tBTM_INQ_RESULTS_CB *p p_inq->state = BTM_INQ_INACTIVE_STATE; } -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - if (p_inq->next_state == BTM_NO_INTERLEAVING) { - p_inq->next_state = BTM_FINISH; - } else { - BTM_TRACE_API("BTM:Interleaving: Started BTM inq, Advancing to next state: %d\n", - p_inq->next_state + 1); - p_inq->next_state += 1; - } - } - if (status != BTM_CMD_STARTED) { - /* Some error beginning the scan process. - Reset the next_state parameter.. Do we need to reset the inq_active also? - */ - BTM_TRACE_API("BTM:Interleaving: Error in Starting inquiry, status: 0x%02x\n", status); - p_inq->next_state = BTM_BR_ONE; - } -#endif - - return (status); } @@ -2053,22 +1967,7 @@ void btm_process_inq_complete (UINT8 status, UINT8 mode) tBTM_CMPL_CB *p_inq_cb = btm_cb.btm_inq_vars.p_inq_cmpl_cb; tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - /* inquiry inactive case happens when inquiry is cancelled. - Make mode 0 for no further inquiries from the current inquiry process - */ - if (status != HCI_SUCCESS || p_inq->next_state == BTM_FINISH || !p_inq->inq_active) { - /* re-initialize for next inquiry request */ - p_inq->next_state = BTM_BR_ONE; - /* make the mode 0 here */ - p_inq->inqparms.mode &= ~(p_inq->inqparms.mode); - - } -#endif - -#if (!defined(BTA_HOST_INTERLEAVE_SEARCH) || BTA_HOST_INTERLEAVE_SEARCH == FALSE) p_inq->inqparms.mode &= ~(mode); -#endif if (p_inq->scan_type == INQ_LE_OBSERVE && !p_inq->inq_active) { /*end of LE observe*/ @@ -2117,14 +2016,6 @@ void btm_process_inq_complete (UINT8 status, UINT8 mode) (p_inq_cb)((tBTM_INQUIRY_CMPL *) &p_inq->inq_cmpl_info); } } -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - if (p_inq->inqparms.mode != 0 && !(p_inq->inq_active & BTM_PERIODIC_INQUIRY_ACTIVE)) { - /* make inquiry inactive for next iteration */ - p_inq->inq_active = BTM_INQUIRY_INACTIVE; - /* call the inquiry again */ - BTM_StartInquiry(&p_inq->inqparms, p_inq->p_inq_results_cb, p_inq->p_inq_cmpl_cb); - } -#endif } if (p_inq->inqparms.mode == 0 && p_inq->scan_type == INQ_GENERAL) { //this inquiry is complete p_inq->scan_type = INQ_NONE; diff --git a/components/bt/host/bluedroid/stack/btm/include/btm_int.h b/components/bt/host/bluedroid/stack/btm/include/btm_int.h index b41c59cad3a..54f5fcab2ea 100644 --- a/components/bt/host/bluedroid/stack/btm/include/btm_int.h +++ b/components/bt/host/bluedroid/stack/btm/include/btm_int.h @@ -387,9 +387,6 @@ typedef struct { UINT8 state; /* Current state that the inquiry process is in */ UINT8 inq_active; /* Bit Mask indicating type of inquiry is active */ BOOLEAN no_inc_ssp; /* TRUE, to stop inquiry on incoming SSP */ -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - btm_inq_state next_state; /*interleaving state to determine next mode to be inquired*/ -#endif } tBTM_INQUIRY_VAR_ST; /* The MSB of the clock offset field indicates that the offset is valid if TRUE */ diff --git a/components/bt/host/bluedroid/stack/include/stack/btm_api.h b/components/bt/host/bluedroid/stack/include/stack/btm_api.h index cf96327669f..a0a2659138e 100644 --- a/components/bt/host/bluedroid/stack/include/stack/btm_api.h +++ b/components/bt/host/bluedroid/stack/include/stack/btm_api.h @@ -80,19 +80,6 @@ enum { typedef uint8_t tBTM_STATUS; -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) -typedef enum { - BTM_BR_ONE, /*0 First state or BR/EDR scan 1*/ - BTM_BLE_ONE, /*1BLE scan 1*/ - BTM_BR_TWO, /*2 BR/EDR scan 2*/ - BTM_BLE_TWO, /*3 BLE scan 2*/ - BTM_FINISH, /*4 End of Interleave Scan, or normal scan*/ - BTM_NO_INTERLEAVING /*5 No Interleaving*/ -} btm_inq_state; -#endif - - - /************************* ** Device Control Types **************************/ @@ -647,9 +634,6 @@ typedef struct { /* contains the parameters passed to the inquiry fun BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */ UINT8 filter_cond_type; /* new devices, BD ADDR, COD, or No filtering */ tBTM_INQ_FILT_COND filter_cond; /* filter value based on filter cond type */ -#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) - UINT8 intl_duration[4]; /*duration array storing the interleave scan's time portions*/ -#endif } tBTM_INQ_PARMS; #define BTM_INQ_RESULT_BR 0x01