mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(ble/bluedroid): Delete btm_ble_send_extended_scan_params
This commit is contained in:
@@ -2636,21 +2636,6 @@ void BTA_VendorInit (void)
|
||||
APPL_TRACE_API("BTA_VendorInit");
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_VendorCleanup
|
||||
**
|
||||
** Description This function frees up Broadcom specific VS specific dynamic memory
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_VendorCleanup (void)
|
||||
{
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb);
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
void BTA_DmBleGapReadPHY(BD_ADDR addr)
|
||||
{
|
||||
|
||||
@@ -3023,17 +3023,6 @@ void BTA_DmBleGapCsProcEnable(uint16_t conn_handle, uint8_t config_id, uint8_t e
|
||||
*******************************************************************************/
|
||||
extern void BTA_VendorInit (void);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_BrcmCleanup
|
||||
**
|
||||
** Description This function frees up Broadcom specific VS specific dynamic memory
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_VendorCleanup (void);
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
extern void BTA_DmBleGapReadPHY(BD_ADDR addr);
|
||||
|
||||
|
||||
@@ -105,9 +105,6 @@ int bte_main_boot_entry(bluedroid_init_done_cb_t cb)
|
||||
******************************************************************************/
|
||||
void bte_main_shutdown(void)
|
||||
{
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
BTA_VendorCleanup();
|
||||
#endif
|
||||
|
||||
#if (BT_BLE_DYNAMIC_ENV_MEMORY == TRUE)
|
||||
free_controller_param();
|
||||
|
||||
@@ -137,16 +137,11 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy)
|
||||
p_inq->sfp = scan_policy;
|
||||
p_inq->scan_type = p_inq->scan_type == BTM_BLE_SCAN_MODE_NONE ? BTM_BLE_SCAN_MODE_ACTI : p_inq->scan_type;
|
||||
|
||||
if (btm_cb.cmn_ble_vsc_cb.extended_scan_support == 0) {
|
||||
btsnd_hcic_ble_set_scan_params(p_inq->scan_type, (UINT16)scan_interval,
|
||||
(UINT16)scan_window,
|
||||
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type,
|
||||
scan_policy);
|
||||
} else {
|
||||
btm_ble_send_extended_scan_params(p_inq->scan_type, scan_interval, scan_window,
|
||||
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type,
|
||||
scan_policy);
|
||||
}
|
||||
|
||||
btsnd_hcic_ble_set_scan_params(p_inq->scan_type, (UINT16)scan_interval,
|
||||
(UINT16)scan_window,
|
||||
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type,
|
||||
scan_policy);
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -604,23 +599,13 @@ BOOLEAN btm_ble_start_select_conn(BOOLEAN start, tBTM_BLE_SEL_CBACK *p_select_cb
|
||||
btm_cb.ble_ctr_cb.inq_var.scan_type = BTM_BLE_SCAN_MODE_PASS;
|
||||
|
||||
/* Process advertising packets only from devices in the white list */
|
||||
if (btm_cb.cmn_ble_vsc_cb.extended_scan_support == 0) {
|
||||
/* use passive scan by default */
|
||||
if (!btsnd_hcic_ble_set_scan_params(BTM_BLE_SCAN_MODE_PASS,
|
||||
scan_int,
|
||||
scan_win,
|
||||
p_cb->addr_mgnt_cb.own_addr_type,
|
||||
SP_ADV_WL)) {
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
if (!btm_ble_send_extended_scan_params(BTM_BLE_SCAN_MODE_PASS,
|
||||
scan_int,
|
||||
scan_win,
|
||||
p_cb->addr_mgnt_cb.own_addr_type,
|
||||
SP_ADV_WL)) {
|
||||
return FALSE;
|
||||
}
|
||||
/* use passive scan by default */
|
||||
if (!btsnd_hcic_ble_set_scan_params(BTM_BLE_SCAN_MODE_PASS,
|
||||
scan_int,
|
||||
scan_win,
|
||||
p_cb->addr_mgnt_cb.own_addr_type,
|
||||
SP_ADV_WL)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!btm_ble_topology_check(BTM_BLE_STATE_PASSIVE_SCAN)) {
|
||||
|
||||
@@ -379,45 +379,6 @@ void BTM_BleClearWhitelist(tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||
btm_ble_clear_white_list(update_wl_cb);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_send_extended_scan_params
|
||||
**
|
||||
** Description This function sends out the extended scan parameters command to the controller
|
||||
**
|
||||
** Parameters scan_type - Scan type
|
||||
** scan_int - Scan interval
|
||||
** scan_win - Scan window
|
||||
** addr_type_own - Own address type
|
||||
** scan_filter_policy - Scan filter policy
|
||||
**
|
||||
** Returns TRUE or FALSE
|
||||
**
|
||||
*******************************************************************************/
|
||||
BOOLEAN btm_ble_send_extended_scan_params(UINT8 scan_type, UINT32 scan_int,
|
||||
UINT32 scan_win, UINT8 addr_type_own,
|
||||
UINT8 scan_filter_policy)
|
||||
{
|
||||
UINT8 scan_param[HCIC_PARAM_SIZE_BLE_WRITE_EXTENDED_SCAN_PARAM];
|
||||
UINT8 *pp_scan = scan_param;
|
||||
|
||||
memset(scan_param, 0, HCIC_PARAM_SIZE_BLE_WRITE_EXTENDED_SCAN_PARAM);
|
||||
|
||||
UINT8_TO_STREAM(pp_scan, scan_type);
|
||||
UINT32_TO_STREAM(pp_scan, scan_int);
|
||||
UINT32_TO_STREAM(pp_scan, scan_win);
|
||||
UINT8_TO_STREAM(pp_scan, addr_type_own);
|
||||
UINT8_TO_STREAM(pp_scan, scan_filter_policy);
|
||||
|
||||
BTM_TRACE_DEBUG("%s, %d, %d", __func__, scan_int, scan_win);
|
||||
if ((BTM_VendorSpecificCommand(HCI_BLE_EXTENDED_SCAN_PARAMS_OCF,
|
||||
HCIC_PARAM_SIZE_BLE_WRITE_EXTENDED_SCAN_PARAM, scan_param, NULL)) != BTM_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s error sending extended scan parameters", __func__);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -513,9 +474,9 @@ tBTM_STATUS BTM_BleScan(BOOLEAN start, UINT32 duration,
|
||||
tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_stop_adv_cback)
|
||||
{
|
||||
tBTM_STATUS status = BTM_NO_RESOURCES;
|
||||
tBTM_LE_RANDOM_CB *p_addr_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
|
||||
// tBTM_LE_RANDOM_CB *p_addr_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
|
||||
tBTM_BLE_INQ_CB *p_cb = &btm_cb.ble_ctr_cb.inq_var;
|
||||
UINT8 evt_type = p_cb->scan_rsp ? BTM_BLE_DISCOVER_EVT : BTM_BLE_NON_CONNECT_EVT;
|
||||
//UINT8 evt_type = p_cb->scan_rsp ? BTM_BLE_DISCOVER_EVT : BTM_BLE_NON_CONNECT_EVT;
|
||||
|
||||
if (!controller_get_interface()->supports_ble()) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
@@ -562,26 +523,6 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleGetVendorCapabilities
|
||||
**
|
||||
** Description This function reads local LE features
|
||||
**
|
||||
** Parameters p_cmn_vsc_cb : Locala LE capability structure
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB *p_cmn_vsc_cb)
|
||||
{
|
||||
BTM_TRACE_DEBUG("BTM_BleGetVendorCapabilities");
|
||||
|
||||
if (NULL != p_cmn_vsc_cb) {
|
||||
*p_cmn_vsc_cb = btm_cb.cmn_ble_vsc_cb;
|
||||
}
|
||||
}
|
||||
|
||||
void BTM_VendorHciEchoCmdCallback(tBTM_VSC_CMPL *p1)
|
||||
{
|
||||
#if (!CONFIG_BT_STACK_NO_LOG)
|
||||
@@ -1349,15 +1290,10 @@ tBTM_STATUS BTM_BleSetScanFilterParams(tGATT_IF client_if, UINT32 scan_interval,
|
||||
if (BTM_BleUpdateOwnType(&addr_type_own, NULL) != 0) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
/* If not supporting extended scan support, use the older range for checking */
|
||||
if (btm_cb.cmn_ble_vsc_cb.extended_scan_support == 0) {
|
||||
max_scan_interval = BTM_BLE_SCAN_INT_MAX;
|
||||
max_scan_window = BTM_BLE_SCAN_WIN_MAX;
|
||||
} else {
|
||||
/* If supporting extended scan support, use the new extended range for checking */
|
||||
max_scan_interval = BTM_BLE_EXT_SCAN_INT_MAX;
|
||||
max_scan_window = BTM_BLE_EXT_SCAN_WIN_MAX;
|
||||
}
|
||||
|
||||
max_scan_interval = BTM_BLE_SCAN_INT_MAX;
|
||||
max_scan_window = BTM_BLE_SCAN_WIN_MAX;
|
||||
|
||||
|
||||
osi_mutex_lock(&scan_param_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
|
||||
@@ -4063,8 +3999,6 @@ void btm_ble_init (void)
|
||||
btu_free_timer(&p_cb->scan_timer_ent);
|
||||
btu_free_timer(&p_cb->inq_var.fast_adv_timer);
|
||||
memset(p_cb, 0, sizeof(tBTM_BLE_CB));
|
||||
memset(&(btm_cb.cmn_ble_vsc_cb), 0 , sizeof(tBTM_BLE_VSC_CB));
|
||||
btm_cb.cmn_ble_vsc_cb.values_read = FALSE;
|
||||
p_cb->cur_states = 0;
|
||||
|
||||
p_cb->conn_pending_q = fixed_queue_new(QUEUE_SIZE_MAX);
|
||||
|
||||
@@ -406,7 +406,6 @@ tBTM_STATUS btm_ble_set_connectability(UINT16 combined_mode);
|
||||
void btm_ble_stop_scan(void);
|
||||
void btm_clear_all_pending_le_entry(void);
|
||||
|
||||
BOOLEAN btm_ble_send_extended_scan_params(UINT8 scan_type, UINT32 scan_int, UINT32 scan_win, UINT8 addr_type_own, UINT8 scan_filter_policy);
|
||||
void btm_ble_init (void);
|
||||
void btm_ble_free (void);
|
||||
void btm_ble_connected (UINT8 *bda, UINT16 handle, UINT8 enc_mode, UINT8 role, tBLE_ADDR_TYPE addr_type, BOOLEAN addr_matched);
|
||||
|
||||
@@ -899,7 +899,6 @@ typedef struct {
|
||||
BT_OCTET8 enc_rand; /* received rand value from LTK request*/
|
||||
UINT16 ediv; /* received ediv value from LTK request */
|
||||
UINT8 key_size;
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
BOOLEAN addr_res_en; /* internal use for test: address resolution enable/disable */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -122,8 +122,6 @@ typedef UINT8 tBTM_BLE_SFP;
|
||||
#define BTM_BLE_SCAN_INT_MAX 0x4000
|
||||
#define BTM_BLE_SCAN_WIN_MIN 0x0004
|
||||
#define BTM_BLE_SCAN_WIN_MAX 0x4000
|
||||
#define BTM_BLE_EXT_SCAN_INT_MAX 0x00FFFFFF
|
||||
#define BTM_BLE_EXT_SCAN_WIN_MAX 0xFFFF
|
||||
#define BTM_BLE_CONN_INT_MIN 0x0006
|
||||
#define BTM_BLE_CONN_INT_MAX 0x0C80
|
||||
#define BTM_BLE_CONN_LATENCY_MAX 499
|
||||
@@ -386,10 +384,7 @@ typedef UINT8 tBTM_BLE_AD_TYPE;
|
||||
typedef UINT8 tBTM_BLE_ADV_TX_POWER;
|
||||
|
||||
/* adv tx power in dBm */
|
||||
typedef struct {
|
||||
BOOLEAN values_read;
|
||||
UINT8 extended_scan_support;
|
||||
} tBTM_BLE_VSC_CB;
|
||||
|
||||
|
||||
/* slave preferred connection interval range */
|
||||
typedef struct {
|
||||
@@ -2097,20 +2092,6 @@ tBTM_STATUS BTM_BleSetScanFilterParams(tGATT_IF client_if, UINT32 scan_interval,
|
||||
tBLE_SCAN_PARAM_SETUP_CBACK scan_setup_status_cback);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleGetVendorCapabilities
|
||||
**
|
||||
** Description This function reads local LE features
|
||||
**
|
||||
** Parameters p_cmn_vsc_cb : Locala LE capability structure
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
void BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB *p_cmn_vsc_cb);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteScanRsp
|
||||
|
||||
Reference in New Issue
Block a user