mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
feat(ble/bluedroid): disable bluedroid host unused functions
This commit is contained in:
@@ -2060,6 +2060,7 @@ tBTM_STATUS BTM_ReadLinkQuality (BD_ADDR remote_bda, tBTM_CMPL_CB *p_cb)
|
||||
return (BTM_UNKNOWN_ADDR);
|
||||
}
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_ReadTxPower
|
||||
@@ -2116,6 +2117,7 @@ tBTM_STATUS BTM_ReadTxPower (BD_ADDR remote_bda, tBT_TRANSPORT transport, tBTM_C
|
||||
/* If here, no BD Addr found */
|
||||
return (BTM_UNKNOWN_ADDR);
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
tBTM_STATUS BTM_SetAclPktTypes(BD_ADDR remote_bda, UINT16 pkt_types, tBTM_CMPL_CB *p_cb)
|
||||
{
|
||||
@@ -2182,6 +2184,7 @@ void btm_acl_pkt_types_changed(UINT8 status, UINT16 handle, UINT16 pkt_types)
|
||||
}
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
tBTM_STATUS BTM_BleReadAdvTxPower(tBTM_CMPL_CB *p_cb)
|
||||
{
|
||||
BOOLEAN ret;
|
||||
@@ -2208,6 +2211,7 @@ tBTM_STATUS BTM_BleReadAdvTxPower(tBTM_CMPL_CB *p_cb)
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
void BTM_BleGetWhiteListSize(uint16_t *length)
|
||||
{
|
||||
@@ -2220,6 +2224,7 @@ void BTM_BleGetWhiteListSize(uint16_t *length)
|
||||
}
|
||||
#endif ///BLE_INCLUDED == TRUE
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_read_tx_power_complete
|
||||
@@ -2273,6 +2278,7 @@ void btm_read_tx_power_complete (UINT8 *p, BOOLEAN is_ble)
|
||||
(*p_cb)(&results);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -553,6 +553,7 @@ void BTM_BleSecureConnectionCreateOobData(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetConnScanParams
|
||||
@@ -591,6 +592,7 @@ void BTM_BleSetConnScanParams (UINT32 scan_interval, UINT32 scan_window)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
|
||||
/********************************************************
|
||||
**
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "common/bt_target.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#include "stack/bt_types.h"
|
||||
#include "stack/hcimsgs.h"
|
||||
#include "stack/btu.h"
|
||||
@@ -445,11 +446,11 @@ BOOLEAN btm_ble_dealloc_addr_filter_counter(tBLE_BD_ADDR *p_bd_addr, UINT8 filte
|
||||
**
|
||||
** Function btm_ble_update_pf_local_name
|
||||
**
|
||||
** Description this function update(add,delete or clear) the adv lcoal name filtering condition.
|
||||
** Description this function update(add,delete or clear) the adv local name filtering condition.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_pf_local_name(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -506,8 +507,8 @@ tBTM_STATUS btm_ble_update_pf_local_name(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description this function update(add/remove) service data change filter.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_srvc_data_change(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -534,8 +535,8 @@ tBTM_STATUS btm_ble_update_srvc_data_change(tBTM_BLE_SCAN_COND_OP action,
|
||||
** data filtering condition.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_pf_manu_data(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -708,8 +709,8 @@ UINT8 btm_ble_cs_update_pf_counter(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description this function update(add,delete or clear) the address filter of adv.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_addr_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -757,8 +758,8 @@ tBTM_STATUS btm_ble_update_addr_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description this function update(add,delete or clear) service UUID filter.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -872,7 +873,7 @@ tBTM_STATUS btm_ble_update_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
memset(&btm_ble_adv_filt_cb.cur_filter_target, 0, sizeof(tBLE_BD_ADDR));
|
||||
}
|
||||
} else {
|
||||
BTM_TRACE_ERROR("UUID filter udpating failed");
|
||||
BTM_TRACE_ERROR("UUID filter updating failed");
|
||||
}
|
||||
|
||||
return st;
|
||||
@@ -886,8 +887,8 @@ tBTM_STATUS btm_ble_update_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description clear all adv payload filter by de-select all the adv pf feature bits
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_clear_scan_pf_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -1303,4 +1304,5 @@ void btm_ble_adv_filter_cleanup(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#endif
|
||||
|
||||
@@ -29,15 +29,22 @@
|
||||
#include "stack/hcimsgs.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
#if BTM_DYNAMIC_MEMORY == FALSE
|
||||
tBTM_BLE_BATCH_SCAN_CB ble_batchscan_cb;
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
tBTM_BLE_ADV_TRACK_CB ble_advtrack_cb;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#else
|
||||
tBTM_BLE_BATCH_SCAN_CB *ble_batchscan_cb_ptr;
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
tBTM_BLE_ADV_TRACK_CB *ble_advtrack_cb_ptr;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#define ble_batchscan_cb (*ble_batchscan_cb_ptr)
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#define ble_advtrack_cb (*ble_advtrack_cb_ptr)
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#endif
|
||||
|
||||
/* length of each batch scan command */
|
||||
@@ -66,10 +73,11 @@ void btm_ble_batchscan_cleanup(void);
|
||||
*******************************************************************************/
|
||||
void btm_ble_batchscan_filter_track_adv_vse_cback(UINT8 len, UINT8 *p)
|
||||
{
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
tBTM_BLE_TRACK_ADV_DATA adv_data;
|
||||
|
||||
UINT8 sub_event = 0;
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
UINT8 sub_event = 0;
|
||||
STREAM_TO_UINT8(sub_event, p);
|
||||
|
||||
BTM_TRACE_EVENT("btm_ble_batchscan_filter_track_adv_vse_cback called with event:%x", sub_event);
|
||||
@@ -78,7 +86,7 @@ void btm_ble_batchscan_filter_track_adv_vse_cback(UINT8 len, UINT8 *p)
|
||||
ble_batchscan_cb.p_thres_cback(ble_batchscan_cb.ref_value);
|
||||
return;
|
||||
}
|
||||
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
if (HCI_VSE_SUBCODE_BLE_TRACKING_SUB_EVT == sub_event && NULL != ble_advtrack_cb.p_track_cback) {
|
||||
if (len < 10) {
|
||||
return;
|
||||
@@ -125,6 +133,7 @@ void btm_ble_batchscan_filter_track_adv_vse_cback(UINT8 len, UINT8 *p)
|
||||
ble_advtrack_cb.p_track_cback(&adv_data);
|
||||
return;
|
||||
}
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -598,6 +607,7 @@ tBTM_STATUS btm_ble_enable_disable_batchscan(BOOLEAN should_enable)
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetStorageConfig
|
||||
@@ -676,7 +686,7 @@ tBTM_STATUS BTM_BleSetStorageConfig(UINT8 batch_scan_full_max, UINT8 batch_scan_
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -796,6 +806,7 @@ tBTM_STATUS BTM_BleDisableBatchScan(tBTM_BLE_REF_VALUE ref_value)
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadScanReports
|
||||
@@ -854,8 +865,9 @@ tBTM_STATUS BTM_BleReadScanReports(tBTM_BLE_BATCH_SCAN_MODE scan_mode,
|
||||
}
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleTrackAdvertiser
|
||||
@@ -888,6 +900,7 @@ tBTM_STATUS BTM_BleTrackAdvertiser(tBTM_BLE_TRACK_ADV_CBACK *p_track_cback,
|
||||
ble_advtrack_cb.ref_value = ref_value;
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -904,7 +917,9 @@ void btm_ble_batchscan_init(void)
|
||||
{
|
||||
#if BTM_DYNAMIC_MEMORY == TRUE
|
||||
ble_batchscan_cb_ptr = (tBTM_BLE_BATCH_SCAN_CB *)osi_malloc(sizeof(tBTM_BLE_BATCH_SCAN_CB));
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
ble_advtrack_cb_ptr = (tBTM_BLE_ADV_TRACK_CB *)osi_malloc(sizeof(tBTM_BLE_ADV_TRACK_CB));
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
if (ble_batchscan_cb_ptr == NULL || ble_advtrack_cb_ptr == NULL) {
|
||||
BTM_TRACE_ERROR("%s malloc failed", __func__);
|
||||
return;
|
||||
@@ -912,7 +927,9 @@ void btm_ble_batchscan_init(void)
|
||||
#endif
|
||||
BTM_TRACE_EVENT (" btm_ble_batchscan_init");
|
||||
memset(&ble_batchscan_cb, 0, sizeof(tBTM_BLE_BATCH_SCAN_CB));
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
memset(&ble_advtrack_cb, 0, sizeof(tBTM_BLE_ADV_TRACK_CB));
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
BTM_RegisterForVSEvents(btm_ble_batchscan_filter_track_adv_vse_cback, TRUE);
|
||||
}
|
||||
|
||||
@@ -940,14 +957,21 @@ void btm_ble_batchscan_cleanup(void)
|
||||
}
|
||||
|
||||
memset(&ble_batchscan_cb, 0, sizeof(tBTM_BLE_BATCH_SCAN_CB));
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
memset(&ble_advtrack_cb, 0, sizeof(tBTM_BLE_ADV_TRACK_CB));
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
#if BTM_DYNAMIC_MEMORY == TRUE
|
||||
osi_free(ble_batchscan_cb_ptr);
|
||||
osi_free(ble_advtrack_cb_ptr);
|
||||
ble_batchscan_cb_ptr = NULL;
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
osi_free(ble_advtrack_cb_ptr);
|
||||
ble_advtrack_cb_ptr = NULL;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "common/bt_target.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
#include "stack/bt_types.h"
|
||||
#include "stack/hcimsgs.h"
|
||||
#include "stack/btu.h"
|
||||
@@ -104,5 +105,6 @@ tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK *p_ener_cback)
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -76,8 +76,10 @@ tBTM_CallbackFunc conn_callback_func;
|
||||
*******************************************************************************/
|
||||
static void btm_ble_update_adv_flag(UINT8 flag);
|
||||
static void btm_ble_process_adv_pkt_cont(BD_ADDR bda, UINT8 addr_type, UINT8 evt_type, UINT8 *p);
|
||||
|
||||
UINT8 *btm_ble_build_adv_data(tBTM_BLE_AD_MASK *p_data_mask, UINT8 **p_dst,
|
||||
tBTM_BLE_ADV_DATA *p_data);
|
||||
|
||||
static UINT8 btm_set_conn_mode_adv_init_addr(tBTM_BLE_INQ_CB *p_cb,
|
||||
BD_ADDR_PTR p_peer_addr_ptr,
|
||||
tBLE_ADDR_TYPE *p_peer_addr_type,
|
||||
@@ -752,11 +754,11 @@ static void btm_ble_vendor_capability_vsc_cmpl_cback (tBTM_VSC_CMPL *p_vcs_cplt_
|
||||
__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 (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
if (BTM_BleMaxMultiAdvInstanceCount() > 0) {
|
||||
btm_ble_multi_adv_init();
|
||||
}
|
||||
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
if (btm_cb.cmn_ble_vsc_cb.max_filter > 0) {
|
||||
btm_ble_adv_filter_init();
|
||||
}
|
||||
@@ -934,9 +936,11 @@ BOOLEAN BTM_BleConfigPrivacy(BOOLEAN privacy_mode, tBTM_SET_LOCAL_PRIVACY_CBACK
|
||||
btm_gen_resolvable_private_addr((void *)btm_gen_resolve_paddr_low);
|
||||
#endif
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
if (BTM_BleMaxMultiAdvInstanceCount() > 0) {
|
||||
btm_ble_multi_adv_enb_privacy(privacy_mode);
|
||||
}
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
|
||||
/* 4.2 controller only allow privacy 1.2 or mixed mode, resolvable private address in controller */
|
||||
if (controller_get_interface()->supports_ble_privacy()) {
|
||||
@@ -1174,6 +1178,7 @@ void BTM_BleConfigConnParams(uint16_t int_min, uint16_t int_max, uint16_t latenc
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleMaxMultiAdvInstanceCount
|
||||
@@ -1188,6 +1193,7 @@ extern UINT8 BTM_BleMaxMultiAdvInstanceCount(void)
|
||||
return btm_cb.cmn_ble_vsc_cb.adv_inst_max < BTM_BLE_MULTI_ADV_MAX ?
|
||||
btm_cb.cmn_ble_vsc_cb.adv_inst_max : BTM_BLE_MULTI_ADV_MAX;
|
||||
}
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
|
||||
#if BLE_PRIVACY_SPT == TRUE
|
||||
/*******************************************************************************
|
||||
@@ -1599,6 +1605,7 @@ void BTM_BleReadAdvParams (UINT16 *adv_int_min, UINT16 *adv_int_max,
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetScanParams
|
||||
@@ -1657,6 +1664,7 @@ void BTM_BleSetScanParams(tGATT_IF client_if, UINT32 scan_interval, UINT32 scan_
|
||||
}
|
||||
|
||||
}
|
||||
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
tBTM_STATUS BTM_BleSetScanFilterParams(tGATT_IF client_if, UINT32 scan_interval, UINT32 scan_window,
|
||||
@@ -2146,6 +2154,26 @@ BOOLEAN BTM_GetCurrentConnParams(BD_ADDR bda, uint16_t *interval, uint16_t *late
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_map_adv_tx_power
|
||||
**
|
||||
** Description return the actual power in dBm based on the mapping in config file
|
||||
**
|
||||
** Parameters advertise parameters used for this instance.
|
||||
**
|
||||
** Returns tx power in dBm
|
||||
**
|
||||
*******************************************************************************/
|
||||
static const int btm_ble_tx_power[BTM_BLE_ADV_TX_POWER_MAX + 1] = BTM_BLE_ADV_TX_POWER;
|
||||
char btm_ble_map_adv_tx_power(int tx_power_index)
|
||||
{
|
||||
if (0 <= tx_power_index && tx_power_index <= BTM_BLE_ADV_TX_POWER_MAX) {
|
||||
return (char)btm_ble_tx_power[tx_power_index];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_build_adv_data
|
||||
@@ -4270,9 +4298,11 @@ void btm_ble_timeout(TIMER_LIST_ENT *p_tle)
|
||||
btm_gen_resolvable_private_addr((void *)btm_gen_resolve_paddr_low);
|
||||
#endif
|
||||
} else {
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
if (BTM_BleMaxMultiAdvInstanceCount() > 0) {
|
||||
btm_ble_multi_adv_configure_rpa((tBTM_BLE_MULTI_ADV_INST *)p_tle->param);
|
||||
}
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -4554,7 +4584,9 @@ void btm_ble_init (void)
|
||||
osi_event_bind(p_cb->adv_rpt_ready, btu_get_current_thread(), 0);
|
||||
|
||||
#if BLE_VND_INCLUDED == FALSE
|
||||
#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
btm_ble_adv_filter_init();
|
||||
#endif // #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "device/controller.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
#include "stack/bt_types.h"
|
||||
#include "stack/hcimsgs.h"
|
||||
#include "stack/btu.h"
|
||||
@@ -218,25 +220,7 @@ tBTM_STATUS btm_ble_enable_multi_adv (BOOLEAN enable, UINT8 inst_id, UINT8 cb_ev
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_map_adv_tx_power
|
||||
**
|
||||
** Description return the actual power in dBm based on the mapping in config file
|
||||
**
|
||||
** Parameters advertise parameters used for this instance.
|
||||
**
|
||||
** Returns tx power in dBm
|
||||
**
|
||||
*******************************************************************************/
|
||||
static const int btm_ble_tx_power[BTM_BLE_ADV_TX_POWER_MAX + 1] = BTM_BLE_ADV_TX_POWER;
|
||||
char btm_ble_map_adv_tx_power(int tx_power_index)
|
||||
{
|
||||
if (0 <= tx_power_index && tx_power_index <= BTM_BLE_ADV_TX_POWER_MAX) {
|
||||
return (char)btm_ble_tx_power[tx_power_index];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_multi_adv_set_params
|
||||
@@ -882,4 +866,5 @@ void *btm_ble_multi_adv_get_ref(UINT8 inst_id)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
#endif
|
||||
|
||||
@@ -170,7 +170,9 @@ static void reset_complete(void)
|
||||
btm_cb.ble_ctr_cb.bg_conn_type = BTM_BLE_CONN_NONE;
|
||||
btm_cb.ble_ctr_cb.p_select_cback = NULL;
|
||||
gatt_reset_bgdev_list();
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
btm_ble_multi_adv_init();
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
#endif
|
||||
|
||||
btm_pm_reset();
|
||||
@@ -1071,6 +1073,7 @@ tBTM_STATUS BTM_WriteVoiceSettings(UINT16 settings)
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_EnableTestMode
|
||||
@@ -1127,6 +1130,7 @@ tBTM_STATUS BTM_EnableTestMode(void)
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -504,12 +504,14 @@ void btm_ble_add_default_entry_to_resolving_list(void);
|
||||
void btm_ble_set_privacy_mode_complete(UINT8 *p, UINT16 evt_len);
|
||||
#endif
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
void btm_ble_multi_adv_configure_rpa (tBTM_BLE_MULTI_ADV_INST *p_inst);
|
||||
void btm_ble_multi_adv_init(void);
|
||||
void *btm_ble_multi_adv_get_ref(UINT8 inst_id);
|
||||
void btm_ble_multi_adv_cleanup(void);
|
||||
void btm_ble_multi_adv_reenable(UINT8 inst_id);
|
||||
void btm_ble_multi_adv_enb_privacy(BOOLEAN enable);
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
char btm_ble_map_adv_tx_power(int tx_power_index);
|
||||
void btm_ble_batchscan_init(void);
|
||||
void btm_ble_batchscan_cleanup(void);
|
||||
|
||||
@@ -208,8 +208,10 @@ tBTM_ROLE_SWITCH_CMPL switch_role_ref_data;
|
||||
tBTM_CMPL_CB *p_switch_role_cb; /* Callback function to be called when */
|
||||
/* requested switch role is completed */
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
TIMER_LIST_ENT tx_power_timer;
|
||||
tBTM_CMPL_CB *p_tx_power_cmpl_cb;/* Callback function to be called */
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
#if CLASSIC_BT_INCLUDED == TRUE
|
||||
TIMER_LIST_ENT afh_channels_timer;
|
||||
|
||||
@@ -992,7 +992,9 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
break;
|
||||
|
||||
case HCI_READ_TRANSMIT_POWER_LEVEL:
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
btm_read_tx_power_complete(p, FALSE);
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
break;
|
||||
|
||||
case HCI_CREATE_CONNECTION_CANCEL:
|
||||
@@ -1073,7 +1075,9 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
break;
|
||||
|
||||
case HCI_BLE_READ_ADV_CHNL_TX_POWER:
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
btm_read_tx_power_complete(p, TRUE);
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
break;
|
||||
|
||||
case HCI_BLE_WRITE_ADV_ENABLE:
|
||||
|
||||
@@ -3022,7 +3022,7 @@ tBTM_STATUS BTM_SwitchRole (BD_ADDR remote_bd_addr,
|
||||
//extern
|
||||
tBTM_STATUS BTM_ReadRSSI (BD_ADDR remote_bda, tBT_TRANSPORT transport, tBTM_CMPL_CB *p_cb);
|
||||
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_ReadTxPower
|
||||
@@ -3043,6 +3043,7 @@ tBTM_STATUS BTM_ReadTxPower (BD_ADDR remote_bda,
|
||||
tBT_TRANSPORT transport, tBTM_CMPL_CB *p_cb);
|
||||
|
||||
tBTM_STATUS BTM_BleReadAdvTxPower(tBTM_CMPL_CB *p_cb);
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
void BTM_BleGetWhiteListSize(uint16_t *length);
|
||||
|
||||
|
||||
@@ -394,7 +394,9 @@ typedef UINT8 tBTM_BLE_ADV_TX_POWER;
|
||||
|
||||
/* adv tx power in dBm */
|
||||
typedef struct {
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
UINT8 adv_inst_max; /* max adv instance supported in controller */
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
UINT8 rpa_offloading;
|
||||
UINT16 tot_scan_results_strg;
|
||||
UINT8 max_irk_list_sz;
|
||||
@@ -498,6 +500,7 @@ typedef struct {
|
||||
tBTM_BLE_ADV_TX_POWER tx_power;
|
||||
} tBTM_BLE_ADV_PARAMS;
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
typedef struct {
|
||||
UINT8 *p_sub_code; /* dynamic array to store sub code */
|
||||
UINT8 *p_inst_id; /* dynamic array to store instance id */
|
||||
@@ -529,6 +532,7 @@ typedef struct {
|
||||
tBTM_BLE_MULTI_ADV_INST *p_adv_inst; /* dynamic array to store adv instance */
|
||||
tBTM_BLE_MULTI_ADV_OPQ op_q;
|
||||
} tBTM_BLE_MULTI_ADV_CB;
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
|
||||
typedef UINT8 tGATT_IF;
|
||||
|
||||
@@ -943,6 +947,7 @@ typedef UINT8 tBTM_BLE_CONN_TYPE;
|
||||
#define ADV_INFO_PRESENT 0x00
|
||||
#define NO_ADV_INFO_PRESENT 0x01
|
||||
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
typedef btgatt_track_adv_info_t tBTM_BLE_TRACK_ADV_DATA;
|
||||
|
||||
typedef void (tBTM_BLE_TRACK_ADV_CBACK)(tBTM_BLE_TRACK_ADV_DATA *p_track_adv_data);
|
||||
@@ -960,6 +965,7 @@ enum {
|
||||
};
|
||||
|
||||
typedef UINT8 tBTM_BLE_TRACK_ADV_ACTION;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
#define BTM_BLE_MULTI_ADV_INVALID 0
|
||||
|
||||
@@ -1544,6 +1550,7 @@ void BTM_BleReadAdvParams (UINT16 *adv_int_min, UINT16 *adv_int_max,
|
||||
//extern
|
||||
void BTM_BleObtainVendorCapabilities(tBTM_BLE_VSC_CB *p_cmn_vsc_cb);
|
||||
|
||||
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetScanParams
|
||||
@@ -1564,7 +1571,7 @@ void BTM_BleSetScanParams(tGATT_IF client_if, UINT32 scan_interval,
|
||||
UINT32 scan_window, tBLE_SCAN_MODE scan_type,
|
||||
tBLE_SCAN_PARAM_SETUP_CBACK scan_setup_status_cback);
|
||||
|
||||
|
||||
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1663,6 +1670,7 @@ tBTM_STATUS BTM_BleEnableBatchScan(tBTM_BLE_BATCH_SCAN_MODE scan_mode,
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleDisableBatchScan(tBTM_BLE_REF_VALUE ref_value);
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadScanReports
|
||||
@@ -1678,7 +1686,9 @@ tBTM_STATUS BTM_BleDisableBatchScan(tBTM_BLE_REF_VALUE ref_value);
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleReadScanReports(tBLE_SCAN_MODE scan_mode,
|
||||
tBTM_BLE_REF_VALUE ref_value);
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleTrackAdvertiser
|
||||
@@ -1694,6 +1704,7 @@ tBTM_STATUS BTM_BleReadScanReports(tBLE_SCAN_MODE scan_mode,
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleTrackAdvertiser(tBTM_BLE_TRACK_ADV_CBACK *p_track_cback,
|
||||
tBTM_BLE_REF_VALUE ref_value);
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2264,6 +2275,7 @@ BOOLEAN BTM_BleLocalPrivacyEnabled(void);
|
||||
//extern
|
||||
void BTM_BleEnableMixedPrivacyMode(BOOLEAN mixed_on);
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleMaxMultiAdvInstanceCount
|
||||
@@ -2275,6 +2287,7 @@ void BTM_BleEnableMixedPrivacyMode(BOOLEAN mixed_on);
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
UINT8 BTM_BleMaxMultiAdvInstanceCount(void);
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2455,6 +2468,7 @@ BOOLEAN BTM_BleSecurityProcedureIsRunning (BD_ADDR bd_addr);
|
||||
//extern
|
||||
UINT8 BTM_BleGetSupportedKeySize (BD_ADDR bd_addr);
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
/*******************************************************************************/
|
||||
/* Multi ADV API */
|
||||
/*******************************************************************************
|
||||
@@ -2527,6 +2541,8 @@ tBTM_STATUS BTM_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp,
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleDisableAdvInstance (UINT8 inst_id);
|
||||
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleAdvFilterParamSetup
|
||||
|
||||
Reference in New Issue
Block a user