feat(ble/bluedroid): disable bluedroid host unused functions

This commit is contained in:
zhiweijian
2025-01-22 10:17:12 +08:00
parent 1fa244336d
commit 76a75eb625
19 changed files with 405 additions and 63 deletions

View File

@ -616,8 +616,10 @@ void bta_dm_disable (tBTA_DM_MSG *p_data)
#endif
#if BLE_INCLUDED == TRUE
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
// btm_ble_multi_adv_init is called when the host is enabled, so btm_ble_multi_adv_cleanup is called when the host is disabled.
btm_ble_multi_adv_cleanup();
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
#endif
}
@ -953,7 +955,7 @@ void bta_dm_clear_white_list(tBTA_DM_MSG *p_data)
BTM_BleClearWhitelist(p_data->white_list.update_wl_cb);
#endif
}
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
void bta_dm_ble_read_adv_tx_power(tBTA_DM_MSG *p_data)
{
#if (BLE_INCLUDED == TRUE)
@ -964,6 +966,7 @@ void bta_dm_ble_read_adv_tx_power(tBTA_DM_MSG *p_data)
}
#endif ///BLE_INCLUDED == TRUE
}
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
void bta_dm_read_rssi(tBTA_DM_MSG *p_data)
{
@ -974,6 +977,7 @@ void bta_dm_read_rssi(tBTA_DM_MSG *p_data)
}
}
#if (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_dm_set_visibility
@ -1063,6 +1067,7 @@ void bta_dm_set_visibility(tBTA_DM_MSG *p_data)
}
}
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
@ -1194,6 +1199,7 @@ void bta_dm_add_device (tBTA_DM_MSG *p_data)
}
}
#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_close_acl
@ -1239,7 +1245,9 @@ void bta_dm_close_acl(tBTA_DM_MSG *p_data)
/* otherwise, no action needed */
}
#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
#if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_remove_all_acl
@ -1268,7 +1276,7 @@ void bta_dm_remove_all_acl(tBTA_DM_MSG *p_data)
}
}
}
#endif // #if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
/*******************************************************************************
**
@ -4572,6 +4580,7 @@ void bta_dm_eir_update_uuid(tBT_UUID uuid, BOOLEAN adding)
}
#endif
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_enable_test_mode
@ -4603,7 +4612,9 @@ void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data)
UNUSED(p_data);
BTM_DeviceReset(NULL);
}
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_execute_callback
@ -4623,6 +4634,7 @@ void bta_dm_execute_callback(tBTA_DM_MSG *p_data)
p_data->exec_cback.p_exec_cback(p_data->exec_cback.p_param);
}
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
/*******************************************************************************
**
@ -5147,6 +5159,7 @@ void bta_dm_ble_set_conn_params (tBTA_DM_MSG *p_data)
p_data->ble_set_conn_params.slave_latency, p_data->ble_set_conn_params.supervision_tout);
}
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_set_conn_scan_params
@ -5164,6 +5177,7 @@ void bta_dm_ble_set_scan_params(tBTA_DM_MSG *p_data)
p_data->ble_set_scan_params.scan_mode,
p_data->ble_set_scan_params.scan_param_setup_cback);
}
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
#if (BLE_42_SCAN_EN == TRUE)
/*******************************************************************************
@ -5199,6 +5213,7 @@ void bta_dm_ble_set_scan_fil_params(tBTA_DM_MSG *p_data)
}
#endif // #if (BLE_42_SCAN_EN == TRUE)
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_set_conn_scan_params
@ -5213,6 +5228,8 @@ void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data)
BTM_BleSetConnScanParams(p_data->ble_set_conn_scan_params.scan_int,
p_data->ble_set_conn_scan_params.scan_window);
}
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_update_conn_params
@ -5279,6 +5296,7 @@ void bta_dm_ble_clear_rand_address(tBTA_DM_MSG *p_data)
BTM_BleClearRandAddress();
}
#if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_stop_advertising
@ -5297,7 +5315,7 @@ void bta_dm_ble_stop_advertising(tBTA_DM_MSG *p_data)
btm_ble_stop_adv();
#endif // #if (BLE_42_ADV_EN == TRUE)
}
#endif // #if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
#if BLE_PRIVACY_SPT == TRUE
@ -5329,6 +5347,7 @@ void bta_dm_ble_config_local_icon (tBTA_DM_MSG *p_data)
BTM_BleConfigLocalIcon (p_data->ble_local_icon.icon);
}
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_observe
@ -5368,6 +5387,7 @@ void bta_dm_ble_observe (tBTA_DM_MSG *p_data)
}
}
}
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
/*******************************************************************************
**
@ -5646,6 +5666,7 @@ void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data)
}
#endif // #if (BLE_42_ADV_EN == TRUE)
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_multi_adv_enb
@ -5753,6 +5774,7 @@ void btm_dm_ble_multi_adv_disable(tBTA_DM_MSG *p_data)
p_data->ble_multi_adv_disable.inst_id, p_ref, BTA_FAILURE);
}
}
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
#if (BLE_42_DTM_TEST_EN == TRUE)
void bta_dm_ble_gap_dtm_tx_start(tBTA_DM_MSG *p_data)
@ -6042,6 +6064,7 @@ void bta_dm_ble_gap_set_periodic_adv_sync_trans_params(tBTA_DM_MSG *p_data)
p_data->ble_set_past_params.params.cte_type);
}
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_setup_storage
@ -6073,7 +6096,9 @@ void bta_dm_ble_setup_storage (tBTA_DM_MSG *p_data)
btm_status);
}
}
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_enable_batch_scan
@ -6131,7 +6156,9 @@ void bta_dm_ble_disable_batch_scan (tBTA_DM_MSG *p_data)
btm_status);
}
}
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_read_scan_reports
@ -6158,7 +6185,9 @@ void bta_dm_ble_read_scan_reports(tBTA_DM_MSG *p_data)
btm_status);
}
}
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_track_advertiser
@ -6191,6 +6220,7 @@ void bta_dm_ble_track_advertiser(tBTA_DM_MSG *p_data)
p_data->ble_track_advert.p_track_adv_cback(&track_adv_data);
}
}
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
/*******************************************************************************
**
@ -6367,6 +6397,7 @@ void bta_dm_scan_filter_param_setup (tBTA_DM_MSG *p_data)
}
#endif
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
/*******************************************************************************
**
** Function bta_ble_enable_scan_cmpl
@ -6414,6 +6445,7 @@ void bta_dm_ble_get_energy_info(tBTA_DM_MSG *p_data)
bta_ble_energy_info_cmpl(0, 0, 0, 0, btm_status);
}
}
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE)
#ifndef BTA_DM_GATT_CLOSE_DELAY_TOUT

View File

@ -110,7 +110,7 @@ tBTA_STATUS BTA_DisableBluetooth(void)
return BTA_SUCCESS;
}
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
/*******************************************************************************
**
** Function BTA_EnableTestMode
@ -156,6 +156,7 @@ void BTA_DisableTestMode(void)
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
/*******************************************************************************
**
@ -462,6 +463,7 @@ void BTA_DmClearWhiteList(tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb)
}
}
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
void BTA_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb)
{
tBTA_DM_API_READ_ADV_TX_POWER *p_msg;
@ -471,6 +473,8 @@ void BTA_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb)
bta_sys_sendmsg(p_msg);
}
}
#endif // BLE_HOST_READ_TX_POWER_EN
#endif ///BLE_INCLUDED == TRUE
void BTA_DmReadRSSI(BD_ADDR remote_addr, tBTA_TRANSPORT transport, tBTA_CMPL_CB *cmpl_cb)
@ -485,6 +489,7 @@ void BTA_DmReadRSSI(BD_ADDR remote_addr, tBTA_TRANSPORT transport, tBTA_CMPL_CB
}
}
#if (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTA_DmSetVisibility
@ -514,6 +519,7 @@ void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, UINT8 p
}
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
@ -1124,6 +1130,8 @@ tBTA_STATUS BTA_DmRemoveLocalDiRecord(UINT32 handle)
return status;
}
#endif ///SDP_INCLUDED == TRUE
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
/*******************************************************************************
**
** Function bta_dmexecutecallback
@ -1146,6 +1154,7 @@ void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK *p_callback, void *p_param)
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
/*******************************************************************************
**
@ -1356,6 +1365,7 @@ void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr,
#endif
}
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmSetBleConnScanParams
@ -1380,7 +1390,9 @@ void BTA_DmSetBleConnScanParams(UINT32 scan_interval, UINT32 scan_window)
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
/*******************************************************************************
**
** Function BTA_DmSetBleScanParams
@ -1414,6 +1426,7 @@ void BTA_DmSetBleScanParams(tGATT_IF client_if, UINT32 scan_interval,
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
#if (BLE_42_SCAN_EN == TRUE)
/*******************************************************************************
@ -1648,7 +1661,7 @@ void BTA_DmUpdateDuplicateExceptionalList(UINT8 subcode, UINT32 type, BD_ADDR de
bta_sys_sendmsg(p_msg);
}
}
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleSetStorageParams
@ -1689,7 +1702,9 @@ extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max,
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleEnableBatchScan
@ -1748,7 +1763,9 @@ extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value)
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleReadScanReports
@ -1774,7 +1791,9 @@ extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleTrackAdvertiser
@ -1800,6 +1819,7 @@ extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#endif
@ -2136,6 +2156,7 @@ void BTA_DmBleConfigLocalIcon(uint16_t icon)
}
}
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
/*******************************************************************************
**
** Function BTA_BleEnableAdvInstance
@ -2269,6 +2290,7 @@ void BTA_BleDisableAdvInstance (UINT8 inst_id) //this function just used fo
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
/*******************************************************************************
**
@ -2451,6 +2473,7 @@ void BTA_DmBleScanFilterSetup(UINT8 action, tBTA_DM_BLE_PF_FILT_INDEX filt_index
#endif
}
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleGetEnergyInfo
@ -2476,6 +2499,7 @@ void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback)
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
/*******************************************************************************
**
@ -2705,6 +2729,7 @@ void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport, tBTA_DM_ENCR
}
#endif ///SMP_INCLUDED == TRUE
#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmCloseACL
@ -2736,8 +2761,10 @@ void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transpor
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
#if BLE_INCLUDED == TRUE
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleObserve
@ -2778,6 +2805,8 @@ extern void BTA_DmBleObserve(BOOLEAN start, UINT32 duration,
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
#if (BLE_42_SCAN_EN == TRUE)
/*******************************************************************************
**
@ -2821,6 +2850,7 @@ extern void BTA_DmBleScan(BOOLEAN start, UINT32 duration,
}
#endif // #if (BLE_42_SCAN_EN == TRUE)
#if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleStopAdvertising
@ -2845,7 +2875,7 @@ extern void BTA_DmBleStopAdvertising(void)
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
/*******************************************************************************
**

View File

@ -71,15 +71,17 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
bta_dm_set_page_timeout, /* BTA_DM_API_PAGE_TO_SET_EVT */
bta_dm_get_page_timeout, /* BTA_DM_API_PAGE_TO_GET_EVT */
bta_dm_set_acl_pkt_types, /* BTA_DM_API_SET_ACL_PKT_TYPES_EVT */
#endif
bta_dm_set_afh_channels, /* BTA_DM_API_SET_AFH_CHANNELS_EVT */
#if (SDP_INCLUDED == TRUE)
bta_dm_read_rmt_name, /* BTA_DM_API_GET_REMOTE_NAME_EVT*/
#endif
bta_dm_set_visibility, /* BTA_DM_API_SET_VISIBILITY_EVT */
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
bta_dm_acl_change, /* BTA_DM_ACL_CHANGE_EVT */
bta_dm_add_device, /* BTA_DM_API_ADD_DEVICE_EVT */
#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
bta_dm_close_acl, /* BTA_DM_API_REMOVE_ACL_EVT */
#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
#if (SMP_INCLUDED == TRUE)
/* security API events */
bta_dm_bond, /* BTA_DM_API_BOND_EVT */
@ -125,12 +127,18 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
#endif ///SMP_INCLUDED == TRUE
bta_dm_ble_set_bg_conn_type,
bta_dm_ble_set_conn_params, /* BTA_DM_API_BLE_CONN_PARAM_EVT */
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
bta_dm_ble_set_conn_scan_params, /* BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT */
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
bta_dm_ble_set_scan_params, /* BTA_DM_API_BLE_SCAN_PARAM_EVT */
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
#if (BLE_42_SCAN_EN == TRUE)
bta_dm_ble_set_scan_fil_params, /* BTA_DM_API_BLE_SCAN_FIL_PARAM_EVT */
#endif // #if (BLE_42_SCAN_EN == TRUE)
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
bta_dm_ble_observe, /* BTA_DM_API_BLE_OBSERVE_EVT */
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
#if (BLE_42_SCAN_EN == TRUE)
bta_dm_ble_scan, /* BTA_DM_API_BLE_SCAN_EVT */
#endif // #if (BLE_42_SCAN_EN == TRUE)
@ -144,7 +152,9 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
Yulong at 2016/10/19 to support
stop the ble advertising setting
by the APP */
#if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
bta_dm_ble_stop_advertising, /* BTA_DM_API_BLE_STOP_ADV_EVT */
#endif // #if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
#if BLE_PRIVACY_SPT == TRUE
bta_dm_ble_config_local_privacy, /* BTA_DM_API_LOCAL_PRIVACY_EVT */
#endif
@ -167,29 +177,47 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
bta_dm_scan_filter_param_setup, /* BTA_DM_API_SCAN_FILTER_SETUP_EVT */
bta_dm_enable_scan_filter, /* BTA_DM_API_SCAN_FILTER_ENABLE_EVT */
#endif
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
bta_dm_ble_multi_adv_enb, /* BTA_DM_API_BLE_MULTI_ADV_ENB_EVT */
bta_dm_ble_multi_adv_upd_param, /* BTA_DM_API_BLE_MULTI_ADV_PARAM_UPD_EVT */
bta_dm_ble_multi_adv_data, /* BTA_DM_API_BLE_MULTI_ADV_DATA_EVT */
btm_dm_ble_multi_adv_disable, /* BTA_DM_API_BLE_MULTI_ADV_DISABLE_EVT */
#endif // BLE_HOST_BLE_MULTI_ADV_EN
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
bta_dm_ble_setup_storage, /* BTA_DM_API_BLE_SETUP_STORAGE_EVT */
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
bta_dm_ble_enable_batch_scan, /* BTA_DM_API_BLE_ENABLE_BATCH_SCAN_EVT */
bta_dm_ble_disable_batch_scan, /* BTA_DM_API_BLE_DISABLE_BATCH_SCAN_EVT */
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
bta_dm_ble_read_scan_reports, /* BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT */
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
bta_dm_ble_track_advertiser, /* BTA_DM_API_BLE_TRACK_ADVERTISER_EVT */
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
bta_dm_ble_get_energy_info, /* BTA_DM_API_BLE_ENERGY_INFO_EVT */
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
bta_dm_ble_disconnect, /* BTA_DM_API_BLE_DISCONNECT_EVT */
#endif
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
bta_dm_enable_test_mode, /* BTA_DM_API_ENABLE_TEST_MODE_EVT */
bta_dm_disable_test_mode, /* BTA_DM_API_DISABLE_TEST_MODE_EVT */
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
bta_dm_execute_callback, /* BTA_DM_API_EXECUTE_CBACK_EVT */
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
#if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
bta_dm_remove_all_acl, /* BTA_DM_API_REMOVE_ALL_ACL_EVT */
#endif // #if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
bta_dm_remove_device, /* BTA_DM_API_REMOVE_DEVICE_EVT */
bta_dm_ble_set_channels, /* BTA_DM_API_BLE_SET_CHANNELS_EVT */
bta_dm_update_white_list, /* BTA_DM_API_UPDATE_WHITE_LIST_EVT */
bta_dm_clear_white_list, /* BTA_DM_API_CLEAR_WHITE_LIST_EVT */
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
bta_dm_ble_read_adv_tx_power, /* BTA_DM_API_BLE_READ_ADV_TX_POWER_EVT */
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
bta_dm_read_rssi, /* BTA_DM_API_READ_RSSI_EVT */
#if BLE_INCLUDED == TRUE
bta_dm_ble_update_duplicate_exceptional_list,/* BTA_DM_API_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_EVT */

View File

@ -63,16 +63,18 @@ enum {
BTA_DM_API_PAGE_TO_SET_EVT,
BTA_DM_API_PAGE_TO_GET_EVT,
BTA_DM_API_SET_ACL_PKT_TYPES_EVT,
#endif
BTA_DM_API_SET_AFH_CHANNELS_EVT,
#if (SDP_INCLUDED == TRUE)
BTA_DM_API_GET_REMOTE_NAME_EVT,
#endif
BTA_DM_API_SET_VISIBILITY_EVT,
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
BTA_DM_ACL_CHANGE_EVT,
BTA_DM_API_ADD_DEVICE_EVT,
#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
BTA_DM_API_REMOVE_ACL_EVT,
#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
#if (SMP_INCLUDED == TRUE)
/* security API events */
BTA_DM_API_BOND_EVT,
@ -118,14 +120,20 @@ enum {
#endif ///SMP_INCLUDED == TRUE
BTA_DM_API_BLE_SET_BG_CONN_TYPE,
BTA_DM_API_BLE_CONN_PARAM_EVT,
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT,
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
BTA_DM_API_BLE_SCAN_PARAM_EVT,
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
/*******This event added by Yulong at 2016/10/25 to
support the scan filter setting for the APP******/
#if (BLE_42_SCAN_EN == TRUE)
BTA_DM_API_BLE_SCAN_FIL_PARAM_EVT,
#endif // #if (BLE_42_SCAN_EN == TRUE)
#if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
BTA_DM_API_BLE_OBSERVE_EVT,
#endif // #if (BLE_HOST_BLE_OBSERVE_EN == TRUE)
#if (BLE_42_SCAN_EN == TRUE)
BTA_DM_API_BLE_SCAN_EVT,
#endif // #if (BLE_42_SCAN_EN == TRUE)
@ -136,7 +144,9 @@ enum {
BTA_DM_API_CLEAR_RAND_ADDR_EVT,
/*******This event added by Yulong at 2016/10/19 to
support stop the ble advertising setting by the APP******/
#if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
BTA_DM_API_BLE_STOP_ADV_EVT,
#endif // #if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
#if BLE_PRIVACY_SPT == TRUE
BTA_DM_API_LOCAL_PRIVACY_EVT,
#endif
@ -160,29 +170,48 @@ enum {
BTA_DM_API_SCAN_FILTER_SETUP_EVT,
BTA_DM_API_SCAN_FILTER_ENABLE_EVT,
#endif
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
BTA_DM_API_BLE_MULTI_ADV_ENB_EVT,
BTA_DM_API_BLE_MULTI_ADV_PARAM_UPD_EVT,
BTA_DM_API_BLE_MULTI_ADV_DATA_EVT,
BTA_DM_API_BLE_MULTI_ADV_DISABLE_EVT,
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
BTA_DM_API_BLE_SETUP_STORAGE_EVT,
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
BTA_DM_API_BLE_ENABLE_BATCH_SCAN_EVT,
BTA_DM_API_BLE_DISABLE_BATCH_SCAN_EVT,
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT,
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
BTA_DM_API_BLE_TRACK_ADVERTISER_EVT,
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
BTA_DM_API_BLE_ENERGY_INFO_EVT,
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
BTA_DM_API_BLE_DISCONNECT_EVT,
#endif
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
BTA_DM_API_ENABLE_TEST_MODE_EVT,
BTA_DM_API_DISABLE_TEST_MODE_EVT,
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
BTA_DM_API_EXECUTE_CBACK_EVT,
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
#if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
BTA_DM_API_REMOVE_ALL_ACL_EVT,
#endif // #if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
BTA_DM_API_REMOVE_DEVICE_EVT,
BTA_DM_API_BLE_SET_CHANNELS_EVT,
BTA_DM_API_UPDATE_WHITE_LIST_EVT,
BTA_DM_API_CLEAR_WHITE_LIST_EVT,
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
BTA_DM_API_BLE_READ_ADV_TX_POWER_EVT,
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
BTA_DM_API_READ_RSSI_EVT,
#if BLE_INCLUDED == TRUE
BTA_DM_API_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_EVT,
@ -376,10 +405,13 @@ typedef struct {
tBTA_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK *exceptional_list_cb;
}tBTA_DM_API_UPDATE_DUPLICATE_EXCEPTIONAL_LIST;
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
typedef struct {
BT_HDR hdr;
tBTA_CMPL_CB *read_tx_power_cb;
}tBTA_DM_API_READ_ADV_TX_POWER;
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
#endif ///BLE_INCLUDED == TRUE
typedef struct {
@ -635,12 +667,14 @@ typedef struct {
UINT8 transport;
} tBTA_DM_API_REMOVE_DEVICE;
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
/* data type for BTA_DM_API_EXECUTE_CBACK_EVT */
typedef struct {
BT_HDR hdr;
void *p_param;
tBTA_DM_EXEC_CBACK *p_exec_cback;
} tBTA_DM_API_EXECUTE_CBACK;
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
/* data type for tBTA_DM_API_SET_ENCRYPTION */
typedef struct {
@ -746,13 +780,14 @@ typedef struct {
tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback;
} tBTA_DM_API_BLE_SCAN_FILTER_PARAMS;
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
/* set scan parameter for BLE connections */
typedef struct {
BT_HDR hdr;
UINT16 scan_int;
UINT16 scan_window;
} tBTA_DM_API_BLE_CONN_SCAN_PARAMS;
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
/* Data type for start/stop observe */
typedef struct {
@ -830,6 +865,7 @@ typedef struct {
} tBTA_DM_API_BLE_FEATURE;
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
/* multi adv data structure */
typedef struct {
BT_HDR hdr;
@ -856,6 +892,7 @@ typedef struct {
BT_HDR hdr;
UINT8 inst_id;
} tBTA_DM_API_BLE_MULTI_ADV_DISABLE;
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
typedef struct {
BT_HDR hdr;
@ -873,6 +910,7 @@ typedef struct {
tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback;
} tBTA_DM_API_SET_ADV_CONFIG_RAW;
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
typedef struct {
BT_HDR hdr;
UINT8 batch_scan_full_max;
@ -883,7 +921,9 @@ typedef struct {
tBTA_BLE_SCAN_REP_CBACK *p_read_rep_cback;
tBTA_DM_BLE_REF_VALUE ref_value;
} tBTA_DM_API_SET_STORAGE_CONFIG;
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
typedef struct {
BT_HDR hdr;
tBTA_BLE_BATCH_SCAN_MODE scan_mode;
@ -898,23 +938,30 @@ typedef struct {
BT_HDR hdr;
tBTA_DM_BLE_REF_VALUE ref_value;
} tBTA_DM_API_DISABLE_SCAN;
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
typedef struct {
BT_HDR hdr;
tBTA_BLE_BATCH_SCAN_MODE scan_type;
tBTA_DM_BLE_REF_VALUE ref_value;
} tBTA_DM_API_READ_SCAN_REPORTS;
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
typedef struct {
BT_HDR hdr;
tBTA_DM_BLE_REF_VALUE ref_value;
tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback;
} tBTA_DM_API_TRACK_ADVERTISER;
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
typedef struct {
BT_HDR hdr;
tBTA_BLE_ENERGY_INFO_CBACK *p_energy_info_cback;
} tBTA_DM_API_ENERGY_INFO;
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
typedef struct {
BT_HDR hdr;
@ -963,6 +1010,7 @@ typedef struct {
#endif /* BLE_INCLUDED */
#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
typedef struct {
BT_HDR hdr;
@ -971,13 +1019,17 @@ typedef struct {
tBTA_TRANSPORT transport;
} tBTA_DM_API_REMOVE_ACL;
#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
#if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
/* data type for BTA_DM_API_REMOVE_ALL_ACL_EVT */
typedef struct {
BT_HDR hdr;
tBTA_DM_LINK_TYPE link_type;
} tBTA_DM_API_REMOVE_ALL_ACL;
#endif // #if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
typedef struct {
BT_HDR hdr;
BD_ADDR bd_addr;
@ -1228,7 +1280,9 @@ typedef union {
#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_SET_CHANNELS ble_set_channels;
tBTA_DM_API_UPDATE_WHITE_LIST white_list;
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
tBTA_DM_API_READ_ADV_TX_POWER read_tx_power;
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
#endif ///BLE_INCLUDED == TRUE
tBTA_DM_API_READ_RSSI rssi;
@ -1279,9 +1333,9 @@ typedef union {
#endif /* #if (BTA_DM_QOS_INCLUDED == TRUE) */
tBTA_DM_API_DI_DISC di_disc;
#if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
tBTA_DM_API_EXECUTE_CBACK exec_cback;
#endif // #if (BLE_HOST_EXECUTE_CBACK_EN == TRUE)
tBTA_DM_API_SET_ENCRYPTION set_encryption;
#if BLE_INCLUDED == TRUE
@ -1292,8 +1346,12 @@ typedef union {
tBTA_DM_API_BLE_SEC_GRANT ble_sec_grant;
tBTA_DM_API_BLE_SET_BG_CONN_TYPE ble_set_bd_conn_type;
tBTA_DM_API_BLE_CONN_PARAMS ble_set_conn_params;
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
tBTA_DM_API_BLE_CONN_SCAN_PARAMS ble_set_conn_scan_params;
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
tBTA_DM_API_BLE_SCAN_PARAMS ble_set_scan_params;
#endif // #if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
tBTA_DM_API_BLE_SCAN_FILTER_PARAMS ble_set_scan_fil_params;
tBTA_DM_API_BLE_OBSERVE ble_observe;
tBTA_DM_API_BLE_SCAN ble_scan;
@ -1314,17 +1372,31 @@ typedef union {
tBTA_DM_APT_CLEAR_ADDR clear_addr;
tBTA_DM_API_SET_RPA_TIMEOUT set_rpa_timeout;
tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST add_dev_to_resolving_list;
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
tBTA_DM_API_BLE_MULTI_ADV_ENB ble_multi_adv_enb;
tBTA_DM_API_BLE_MULTI_ADV_PARAM ble_multi_adv_param;
tBTA_DM_API_BLE_MULTI_ADV_DATA ble_multi_adv_data;
tBTA_DM_API_BLE_MULTI_ADV_DISABLE ble_multi_adv_disable;
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
tBTA_DM_API_SET_STORAGE_CONFIG ble_set_storage;
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
tBTA_DM_API_ENABLE_SCAN ble_enable_scan;
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
tBTA_DM_API_READ_SCAN_REPORTS ble_read_reports;
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
tBTA_DM_API_DISABLE_SCAN ble_disable_scan;
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
tBTA_DM_API_TRACK_ADVERTISER ble_track_advert;
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
tBTA_DM_API_ENERGY_INFO ble_energy_info;
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
tBTA_DM_API_BLE_DISCONNECT ble_disconnect;
tBTA_DM_API_UPDATE_DUPLICATE_EXCEPTIONAL_LIST ble_duplicate_exceptional_list;
#if (BLE_50_FEATURE_SUPPORT == TRUE)
@ -1377,9 +1449,12 @@ typedef union {
tBTA_DM_API_SET_PRIVACY_MODE ble_set_privacy_mode;
tBTA_DM_API_BLE_SET_CSA_SUPPORT ble_set_csa_support;
#endif
#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
tBTA_DM_API_REMOVE_ACL remove_acl;
#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
#if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
tBTA_DM_API_REMOVE_ALL_ACL remove_all_acl;
#endif // #if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
} tBTA_DM_MSG;
@ -1494,8 +1569,12 @@ typedef struct {
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_BLE_MULTI_ADV_EN == TRUE)
tBTA_BLE_MULTI_ADV_CBACK *p_multi_adv_cback;
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
tBTA_BLE_ENERGY_INFO_CBACK *p_energy_info_cback;
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
#endif
UINT16 state;
BOOLEAN disabling;
@ -1757,7 +1836,9 @@ extern void bta_dm_update_white_list(tBTA_DM_MSG *p_data);
extern void bta_dm_clear_white_list(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_read_adv_tx_power(tBTA_DM_MSG *p_data);
extern void bta_dm_read_rssi(tBTA_DM_MSG *p_data);
#if (CLASSIC_BT_INCLUDED == TRUE)
extern void bta_dm_set_visibility (tBTA_DM_MSG *p_data);
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
extern void bta_dm_set_scan_config(tBTA_DM_MSG *p_data);
extern void bta_dm_vendor_spec_command(tBTA_DM_MSG *p_data);
@ -1783,7 +1864,9 @@ extern void bta_dm_ble_set_bg_conn_type (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_conn_params (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_scan_params(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_scan_fil_params(tBTA_DM_MSG *p_data);
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
extern void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data);
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE) && (GATTC_INCLUDED == TRUE)
extern void bta_dm_close_gatt_conn(tBTA_DM_MSG *p_data);
#endif /* ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE) && SDP_INCLUDED == TRUE) && (GATTC_INCLUDED == TRUE) */
@ -1793,7 +1876,9 @@ extern void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_disconnect (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_rand_address(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_clear_rand_address(tBTA_DM_MSG *p_data);
#if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
extern void bta_dm_ble_stop_advertising(tBTA_DM_MSG *p_data);
#endif // #if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
extern void bta_dm_ble_config_local_privacy (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_config_local_icon (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_adv_params_all(tBTA_DM_MSG *p_data);
@ -1841,12 +1926,20 @@ extern void bta_dm_ble_gap_set_ext_scan_params(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_ext_scan(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_gap_set_prefer_ext_conn_params(tBTA_DM_MSG *p_data);
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
extern void bta_dm_ble_setup_storage(tBTA_DM_MSG *p_data);
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
extern void bta_dm_ble_enable_batch_scan(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_disable_batch_scan(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_read_scan_reports(tBTA_DM_MSG *p_data);
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
extern void bta_dm_ble_track_advertiser(tBTA_DM_MSG *p_data);
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
extern void bta_dm_ble_get_energy_info(tBTA_DM_MSG *p_data);
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
#endif
extern void bta_dm_set_encryption(tBTA_DM_MSG *p_data);

View File

@ -535,7 +535,9 @@ enum {
};
typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
// #endif
/* BLE customer specific feature function type definitions */
@ -1043,6 +1045,7 @@ typedef union {
/* Security callback */
typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
#define BTA_BLE_MULTI_ADV_ILLEGAL 0
/* multi adv callback event */
@ -1056,6 +1059,8 @@ typedef UINT8 tBTA_BLE_MULTI_ADV_EVT;
/* multi adv callback */
typedef void (tBTA_BLE_MULTI_ADV_CBACK)(tBTA_BLE_MULTI_ADV_EVT event,
UINT8 inst_id, void *p_ref, tBTA_STATUS status);
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
typedef UINT32 tBTA_DM_BLE_REF_VALUE;
#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
@ -1248,8 +1253,9 @@ typedef UINT8 tBTA_DM_BLE_ADV_STATE;
typedef UINT8 tBTA_DM_BLE_ADV_INFO_PRESENT;
typedef UINT8 tBTA_DM_BLE_RSSI_VALUE;
typedef UINT16 tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA;
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
typedef void (tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
@ -1267,18 +1273,22 @@ typedef void (tBTA_START_STOP_ADV_CMPL_CBACK) (tBTA_STATUS status);
typedef void (tBTA_CLEAR_ADV_CMPL_CBACK) (tBTA_STATUS status);
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
typedef void (tBTA_BLE_TRACK_ADV_CMPL_CBACK)(int action, tBTA_STATUS status,
tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
tBTA_DM_BLE_REF_VALUE ref_value);
typedef void (tBTA_BLE_TRACK_ADV_CBACK)(tBTA_DM_BLE_TRACK_ADV_DATA *p_adv_data);
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
typedef void (tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
tBTA_DM_BLE_RX_TIME_MS rx_time,
tBTA_DM_BLE_IDLE_TIME_MS idle_time,
tBTA_DM_BLE_ENERGY_USED energy_used,
tBTA_DM_CONTRL_STATE ctrl_state,
tBTA_STATUS status);
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
#else
typedef UINT8 tBTA_DM_BLE_SEC_ACT;
@ -2616,7 +2626,9 @@ extern void BTA_DmBleScan(BOOLEAN start, UINT32 duration,
tBTA_DM_SEARCH_CBACK *p_results_cb,
tBTA_START_STOP_SCAN_CMPL_CBACK *p_start_stop_scan_cb);
#if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
extern void BTA_DmBleStopAdvertising(void);
#endif // #if (BLE_HOST_STOP_ADV_UNUSED == TRUE)
extern void BTA_DmSetRandAddress(BD_ADDR rand_addr, tBTA_SET_RAND_ADDR_CBACK *p_set_rand_addr_cback);
extern void BTA_DmClearRandAddress(void);
@ -2778,7 +2790,7 @@ extern void BTA_DmUpdateDuplicateExceptionalList(UINT8 subcode, UINT32 type,
*******************************************************************************/
extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p_start_stop_adv_cb);
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
/*******************************************************************************
**
** Function BTA_BleEnableAdvInstance
@ -2837,6 +2849,7 @@ extern void BTA_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp,
**
*******************************************************************************/
extern void BTA_BleDisableAdvInstance(UINT8 inst_id);
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
/*******************************************************************************
**
@ -3028,7 +3041,7 @@ extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
tBTA_DM_BLE_REF_VALUE ref_value);
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleTrackAdvertiser
@ -3043,7 +3056,9 @@ extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
*******************************************************************************/
extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback);
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleGetEnergyInfo
@ -3056,6 +3071,7 @@ extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
**
*******************************************************************************/
extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback);
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
/*******************************************************************************
**

View File

@ -1301,7 +1301,68 @@
#endif
#ifndef BLE_ANDROID_CONTROLLER_SCAN_FILTER
#define BLE_ANDROID_CONTROLLER_SCAN_FILTER TRUE
#define BLE_ANDROID_CONTROLLER_SCAN_FILTER FALSE
#endif
#ifndef BLE_HOST_BLE_MULTI_ADV_EN
#define BLE_HOST_BLE_MULTI_ADV_EN FALSE
#endif
#ifndef BLE_HOST_TRACK_ADVERTISER_EN
#define BLE_HOST_TRACK_ADVERTISER_EN FALSE
#endif
#ifndef BLE_HOST_ENERGY_INFO_EN
#define BLE_HOST_ENERGY_INFO_EN FALSE
#endif
#ifndef BLE_HOST_ENABLE_TEST_MODE_EN
#define BLE_HOST_ENABLE_TEST_MODE_EN FALSE
#endif
#ifndef BLE_HOST_EXECUTE_CBACK_EN
#define BLE_HOST_EXECUTE_CBACK_EN FALSE
#endif
#ifndef BLE_HOST_REMOVE_ALL_ACL_EN
#define BLE_HOST_REMOVE_ALL_ACL_EN FALSE
#endif
#ifndef BLE_HOST_REMOVE_AN_ACL_EN
#define BLE_HOST_REMOVE_AN_ACL_EN FALSE
#endif
#ifndef BLE_HOST_READ_TX_POWER_EN
#define BLE_HOST_READ_TX_POWER_EN FALSE
#endif
#ifndef BLE_HOST_STOP_ADV_UNUSED
#define BLE_HOST_STOP_ADV_UNUSED FALSE
#endif
#ifndef BLE_HOST_BLE_OBSERVE_EN
#define BLE_HOST_BLE_OBSERVE_EN FALSE
#endif
#ifndef BLE_HOST_BLE_SCAN_PARAM_UNUSED
#define BLE_HOST_BLE_SCAN_PARAM_UNUSED FALSE
#endif
#ifndef BLE_HOST_CONN_SCAN_PARAM_EN
#define BLE_HOST_CONN_SCAN_PARAM_EN FALSE
#endif
#ifndef BLE_HOST_SETUP_STORAGE_EN
#define BLE_HOST_SETUP_STORAGE_EN FALSE
#endif
#ifndef BLE_HOST_READ_SCAN_REPORTS_EN
#define BLE_HOST_READ_SCAN_REPORTS_EN FALSE
#endif
#ifndef BLE_HOST_BATCH_SCAN_EN
#define BLE_HOST_BATCH_SCAN_EN FALSE
#endif
#ifndef LOCAL_BLE_CONTROLLER_ID

View File

@ -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)
/*******************************************************************************
**

View File

@ -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)
/********************************************************
**

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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();
@ -1035,6 +1037,7 @@ tBTM_STATUS BTM_WriteVoiceSettings(UINT16 settings)
return (BTM_NO_RESOURCES);
}
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
/*******************************************************************************
**
** Function BTM_EnableTestMode
@ -1091,6 +1094,7 @@ tBTM_STATUS BTM_EnableTestMode(void)
return (BTM_NO_RESOURCES);
}
}
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
/*******************************************************************************
**

View File

@ -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);

View File

@ -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;

View File

@ -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:
@ -1063,7 +1065,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:

View File

@ -3000,7 +3000,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
@ -3021,6 +3021,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);

View File

@ -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