mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(ble/bluedroid): Delete BLE_VND_INCLUDED
(cherry picked from commit 57c52bd4ec)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -125,10 +125,6 @@ static void bta_dm_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC *p_data);
|
||||
extern tBTA_DM_CONTRL_STATE bta_dm_pm_obtain_controller_state(void);
|
||||
#endif
|
||||
|
||||
#if BLE_VND_INCLUDED == TRUE
|
||||
static void bta_dm_ctrl_features_rd_cmpl_cback(tBTM_STATUS result);
|
||||
#endif
|
||||
|
||||
#ifndef BTA_DM_BLE_ADV_CHNL_MAP
|
||||
#define BTA_DM_BLE_ADV_CHNL_MAP (BTM_BLE_ADV_CHNL_37|BTM_BLE_ADV_CHNL_38|BTM_BLE_ADV_CHNL_39)
|
||||
#endif
|
||||
@@ -527,10 +523,6 @@ static void bta_dm_sys_hw_cback( tBTA_SYS_HW_EVT status )
|
||||
BTM_RegBusyLevelNotif (bta_dm_bl_change_cback, NULL, BTM_BL_UPDATE_MASK | BTM_BL_ROLE_CHG_MASK);
|
||||
BTM_RegAclLinkStatNotif (bta_dm_acl_link_stat_cback);
|
||||
|
||||
#if BLE_VND_INCLUDED == TRUE
|
||||
BTM_BleReadControllerFeatures (bta_dm_ctrl_features_rd_cmpl_cback);
|
||||
#endif
|
||||
|
||||
/* Earlier, we used to invoke BTM_ReadLocalAddr which was just copying the bd_addr
|
||||
from the control block and invoking the callback which was sending the DM_ENABLE_EVT.
|
||||
But then we have a few HCI commands being invoked above which were still in progress
|
||||
@@ -6737,28 +6729,4 @@ static void bta_dm_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
|
||||
#endif /* #if (GATTC_INCLUDED == TRUE) */
|
||||
#endif /* BTA_GATT_INCLUDED */
|
||||
|
||||
#if BLE_VND_INCLUDED == TRUE
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_ctrl_features_rd_cmpl_cback
|
||||
**
|
||||
** Description callback to handle controller feature read complete
|
||||
**
|
||||
** Parameters:
|
||||
**
|
||||
*******************************************************************************/
|
||||
static void bta_dm_ctrl_features_rd_cmpl_cback(tBTM_STATUS result)
|
||||
{
|
||||
APPL_TRACE_DEBUG("%s status = %d ", __FUNCTION__, result);
|
||||
if (result == BTM_SUCCESS) {
|
||||
if (bta_dm_cb.p_sec_cback) {
|
||||
bta_dm_cb.p_sec_cback(BTA_DM_LE_FEATURES_READ, NULL);
|
||||
}
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s Ctrl BLE feature read failed: status :%d", __FUNCTION__, result);
|
||||
}
|
||||
|
||||
}
|
||||
#endif /* BLE_VND_INCLUDED */
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
@@ -2837,25 +2837,8 @@ void BTA_VendorCleanup (void)
|
||||
{
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb);
|
||||
|
||||
#if (BLE_INCLUDED == TRUE && BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
|
||||
btm_ble_adv_filter_cleanup(); // when BLE_VND_INCLUDED is false, this function will be ignore, so move it out of "if"
|
||||
|
||||
#if 0 //by TH, comment out temporarily
|
||||
if (cmn_ble_vsc_cb.max_filter > 0) {
|
||||
btm_ble_adv_filter_cleanup();
|
||||
#if BLE_PRIVACY_SPT == TRUE
|
||||
btm_ble_resolving_list_cleanup ();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cmn_ble_vsc_cb.tot_scan_results_strg > 0) {
|
||||
btm_ble_batchscan_cleanup();
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
void BTA_DmBleGapReadPHY(BD_ADDR addr)
|
||||
{
|
||||
|
||||
@@ -2036,9 +2036,6 @@ typedef struct {
|
||||
tBTA_DM_SEC_CBACK *p_sec_cback;
|
||||
#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
|
||||
tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback;
|
||||
tBTA_DM_BLE_PF_CFG_CBACK *p_scan_filt_cfg_cback;
|
||||
tBTA_DM_BLE_PF_STATUS_CBACK *p_scan_filt_status_cback;
|
||||
tBTA_DM_BLE_PF_PARAM_CBACK *p_scan_filt_param_cback;
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
tBTA_BLE_ENERGY_INFO_CBACK *p_energy_info_cback;
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
@@ -1670,14 +1670,6 @@
|
||||
#define BLE_LOCAL_PRIVACY_ENABLED TRUE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Toggles support for vendor specific extensions such as RPA offloading,
|
||||
* feature discovery, multi-adv etc.
|
||||
*/
|
||||
#ifndef BLE_VND_INCLUDED
|
||||
#define BLE_VND_INCLUDED FALSE
|
||||
#endif
|
||||
|
||||
#ifndef BTM_BLE_ADV_TX_POWER
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
|
||||
|
||||
@@ -66,10 +66,6 @@ static tBTM_BLE_VSC_CB *cmn_ble_gap_vsc_cb_ptr;
|
||||
#define cmn_ble_gap_vsc_cb (*cmn_ble_gap_vsc_cb_ptr)
|
||||
#endif
|
||||
|
||||
#if BLE_VND_INCLUDED == TRUE
|
||||
static tBTM_BLE_CTRL_FEATURES_CBACK *p_ctrl_le_feature_rd_cmpl_cback = NULL;
|
||||
#endif
|
||||
|
||||
tBTM_CallbackFunc conn_callback_func;
|
||||
// BLE vendor HCI event callback
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
@@ -716,78 +712,6 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if BLE_VND_INCLUDED == TRUE
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_vsc_brcm_features_complete
|
||||
**
|
||||
** Description Command Complete callback for HCI_BLE_VENDOR_CAP_OCF
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
static void btm_ble_vendor_capability_vsc_cmpl_cback (tBTM_VSC_CMPL *p_vcs_cplt_params)
|
||||
{
|
||||
UINT8 status = 0xFF;
|
||||
UINT8 *p;
|
||||
|
||||
BTM_TRACE_DEBUG("%s", __func__);
|
||||
|
||||
/* Check status of command complete event */
|
||||
if ((p_vcs_cplt_params->opcode == HCI_BLE_VENDOR_CAP_OCF) &&
|
||||
(p_vcs_cplt_params->param_len > 0)) {
|
||||
p = p_vcs_cplt_params->p_param_buf;
|
||||
STREAM_TO_UINT8(status, p);
|
||||
}
|
||||
|
||||
if (status == HCI_SUCCESS) {
|
||||
STREAM_TO_UINT8(btm_cb.cmn_ble_vsc_cb.adv_inst_max, p);
|
||||
STREAM_TO_UINT8(btm_cb.cmn_ble_vsc_cb.rpa_offloading, p);
|
||||
STREAM_TO_UINT16(btm_cb.cmn_ble_vsc_cb.tot_scan_results_strg, p);
|
||||
STREAM_TO_UINT8(btm_cb.cmn_ble_vsc_cb.max_irk_list_sz, p);
|
||||
STREAM_TO_UINT8(btm_cb.cmn_ble_vsc_cb.filter_support, p);
|
||||
STREAM_TO_UINT8(btm_cb.cmn_ble_vsc_cb.max_filter, p);
|
||||
STREAM_TO_UINT8(btm_cb.cmn_ble_vsc_cb.energy_support, p);
|
||||
|
||||
if (p_vcs_cplt_params->param_len > BTM_VSC_CHIP_CAPABILITY_RSP_LEN_L_RELEASE) {
|
||||
STREAM_TO_UINT16(btm_cb.cmn_ble_vsc_cb.version_supported, p);
|
||||
} else {
|
||||
btm_cb.cmn_ble_vsc_cb.version_supported = BTM_VSC_CHIP_CAPABILITY_L_VERSION;
|
||||
}
|
||||
|
||||
if (btm_cb.cmn_ble_vsc_cb.version_supported >= BTM_VSC_CHIP_CAPABILITY_M_VERSION) {
|
||||
STREAM_TO_UINT16(btm_cb.cmn_ble_vsc_cb.total_trackable_advertisers, p);
|
||||
STREAM_TO_UINT16(btm_cb.cmn_ble_vsc_cb.extended_scan_support, p);
|
||||
STREAM_TO_UINT16(btm_cb.cmn_ble_vsc_cb.debug_logging_supported, p);
|
||||
}
|
||||
btm_cb.cmn_ble_vsc_cb.values_read = TRUE;
|
||||
}
|
||||
|
||||
BTM_TRACE_DEBUG("%s: stat=%d, irk=%d, ADV ins:%d, rpa=%d, ener=%d, ext_scan=%d",
|
||||
__func__, status, btm_cb.cmn_ble_vsc_cb.max_irk_list_sz,
|
||||
btm_cb.cmn_ble_vsc_cb.adv_inst_max, btm_cb.cmn_ble_vsc_cb.rpa_offloading,
|
||||
btm_cb.cmn_ble_vsc_cb.energy_support, btm_cb.cmn_ble_vsc_cb.extended_scan_support);
|
||||
if (btm_cb.cmn_ble_vsc_cb.max_filter > 0) {
|
||||
btm_ble_adv_filter_init();
|
||||
}
|
||||
|
||||
#if (defined BLE_PRIVACY_SPT && BLE_PRIVACY_SPT == TRUE)
|
||||
/* VS capability included and non-4.2 device */
|
||||
if (btm_cb.cmn_ble_vsc_cb.max_irk_list_sz > 0 &&
|
||||
controller_get_interface()->get_ble_resolving_list_max_size() == 0) {
|
||||
btm_ble_resolving_list_init(btm_cb.cmn_ble_vsc_cb.max_irk_list_sz);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (btm_cb.cmn_ble_vsc_cb.tot_scan_results_strg > 0) {
|
||||
btm_ble_batchscan_init();
|
||||
}
|
||||
|
||||
if (p_ctrl_le_feature_rd_cmpl_cback != NULL) {
|
||||
p_ctrl_le_feature_rd_cmpl_cback(status);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -809,40 +733,6 @@ extern void BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB *p_cmn_vsc_cb)
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadControllerFeatures
|
||||
**
|
||||
** Description Reads BLE specific controller features
|
||||
**
|
||||
** Parameters: tBTM_BLE_CTRL_FEATURES_CBACK : Callback to notify when features are read
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTM_BleReadControllerFeatures(tBTM_BLE_CTRL_FEATURES_CBACK *p_vsc_cback)
|
||||
{
|
||||
if (TRUE == btm_cb.cmn_ble_vsc_cb.values_read) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if BLE_VND_INCLUDED == TRUE
|
||||
BTM_TRACE_DEBUG("BTM_BleReadControllerFeatures");
|
||||
|
||||
p_ctrl_le_feature_rd_cmpl_cback = p_vsc_cback;
|
||||
if ( BTM_VendorSpecificCommand (HCI_BLE_VENDOR_CAP_OCF,
|
||||
0,
|
||||
NULL,
|
||||
btm_ble_vendor_capability_vsc_cmpl_cback)
|
||||
!= BTM_CMD_STARTED) {
|
||||
BTM_TRACE_ERROR("LE Get_Vendor Capabilities Command Failed.");
|
||||
}
|
||||
#else
|
||||
UNUSED(p_vsc_cback);
|
||||
#endif
|
||||
return ;
|
||||
}
|
||||
|
||||
void BTM_VendorHciEchoCmdCallback(tBTM_VSC_CMPL *p1)
|
||||
{
|
||||
#if (!CONFIG_BT_STACK_NO_LOG)
|
||||
@@ -4578,9 +4468,7 @@ void btm_ble_init (void)
|
||||
assert(p_cb->adv_rpt_ready != NULL);
|
||||
osi_event_bind(p_cb->adv_rpt_ready, btu_get_current_thread(), 0);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#if BLE_VND_INCLUDED == FALSE
|
||||
|
||||
#endif
|
||||
#if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
BTM_RegisterForVSEvents(btm_ble_vs_evt_callback, TRUE);
|
||||
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
|
||||
|
||||
@@ -518,11 +518,7 @@ void btm_ble_add_default_entry_to_resolving_list(void);
|
||||
void btm_ble_set_privacy_mode_complete(UINT8 *p, UINT16 evt_len);
|
||||
#endif
|
||||
|
||||
char btm_ble_map_adv_tx_power(int tx_power_index);
|
||||
void btm_ble_batchscan_init(void);
|
||||
void btm_ble_batchscan_cleanup(void);
|
||||
void btm_ble_adv_filter_init(void);
|
||||
void btm_ble_adv_filter_cleanup(void);
|
||||
char btm_ble_map_adv_tx_power(int tx_power_index);;
|
||||
BOOLEAN btm_ble_topology_check(tBTM_BLE_STATE_MASK request);
|
||||
BOOLEAN btm_ble_clear_topology_mask(tBTM_BLE_STATE_MASK request_state);
|
||||
BOOLEAN btm_ble_set_topology_mask(tBTM_BLE_STATE_MASK request_state);
|
||||
|
||||
@@ -394,17 +394,8 @@ typedef UINT8 tBTM_BLE_ADV_TX_POWER;
|
||||
|
||||
/* adv tx power in dBm */
|
||||
typedef struct {
|
||||
UINT8 rpa_offloading;
|
||||
UINT16 tot_scan_results_strg;
|
||||
UINT8 max_irk_list_sz;
|
||||
UINT8 filter_support;
|
||||
UINT8 max_filter;
|
||||
UINT8 energy_support;
|
||||
BOOLEAN values_read;
|
||||
UINT16 version_supported;
|
||||
UINT16 total_trackable_advertisers;
|
||||
UINT8 extended_scan_support;
|
||||
UINT8 debug_logging_supported;
|
||||
} tBTM_BLE_VSC_CB;
|
||||
|
||||
/* slave preferred connection interval range */
|
||||
@@ -948,7 +939,6 @@ typedef struct {
|
||||
} tBTM_BLE_ENERGY_INFO_CB;
|
||||
|
||||
typedef BOOLEAN (tBTM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name);
|
||||
typedef void (tBTM_BLE_CTRL_FEATURES_CBACK)(tBTM_STATUS status);
|
||||
|
||||
/* callback function for SMP signing algorithm, signed data in little endian order with tlen bits long */
|
||||
typedef void (tBTM_BLE_SIGN_CBACK)(void *p_ref_data, UINT8 *p_signing_data);
|
||||
@@ -2672,20 +2662,6 @@ void BTM_BleSetPrefConnParams (BD_ADDR bd_addr,
|
||||
//extern
|
||||
void BTM_BleSetConnScanParams (UINT32 scan_interval, UINT32 scan_window);
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadControllerFeatures
|
||||
**
|
||||
** Description Reads BLE specific controller features
|
||||
**
|
||||
** Parameters: tBTM_BLE_CTRL_FEATURES_CBACK : Callback to notify when features are read
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
void BTM_BleReadControllerFeatures(tBTM_BLE_CTRL_FEATURES_CBACK *p_vsc_cback);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_CheckAdvData
|
||||
|
||||
Reference in New Issue
Block a user