feat(bt/bluedroid): optimize bluedroid menuconfig
This commit is contained in:
@@ -766,6 +766,7 @@ BOOLEAN BTM_ReadConnectedTransportAddress(BD_ADDR remote_bda, tBT_TRANSPORT tran
|
||||
}
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_42_DTM_TEST_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReceiverTest
|
||||
@@ -805,7 +806,8 @@ void BTM_BleTransmitterTest(UINT8 tx_freq, UINT8 test_data_len,
|
||||
BTM_TRACE_ERROR("%s: Unable to Trigger LE transmitter test", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_DTM_TEST_EN == TRUE)
|
||||
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleTestEnd
|
||||
@@ -837,9 +839,9 @@ void btm_ble_test_command_complete(UINT8 *p)
|
||||
(*p_cb)(p);
|
||||
}
|
||||
}
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleEnhancedReceiverTest
|
||||
@@ -882,7 +884,7 @@ void BTM_BleEnhancedTransmitterTest(UINT8 tx_freq, UINT8 test_data_len,
|
||||
BTM_TRACE_ERROR("%s: Unable to Trigger LE enhanced transmitter test", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
#endif // BLE_50_FEATURE_SUPPORT
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -286,6 +286,7 @@ tBTM_STATUS BTM_BleSetPreferPhy(BD_ADDR bd_addr, UINT8 all_phys, UINT8 tx_phy_ma
|
||||
return BTM_SUCCESS;
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
tBTM_STATUS BTM_BleSetExtendedAdvRandaddr(UINT8 instance, BD_ADDR rand_addr)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
@@ -678,7 +679,9 @@ tBTM_STATUS BTM_BleExtAdvSetClear(void)
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
tBTM_STATUS BTM_BlePeriodicAdvSetParams(UINT8 instance, tBTM_BLE_Periodic_Adv_Params *params)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
@@ -806,7 +809,9 @@ end:
|
||||
return status;
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
tBTM_STATUS BTM_BlePeriodicAdvCreateSync(tBTM_BLE_Periodic_Sync_Params *params)
|
||||
{
|
||||
//tHCI_STATUS err = HCI_SUCCESS;
|
||||
@@ -864,6 +869,7 @@ end:
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
void btm_set_phy_callback(UINT8 status)
|
||||
{
|
||||
@@ -874,6 +880,7 @@ void btm_set_phy_callback(UINT8 status)
|
||||
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
void btm_create_sync_callback(UINT8 status)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
@@ -881,6 +888,7 @@ void btm_create_sync_callback(UINT8 status)
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
void btm_read_phy_callback(uint8_t hci_status, uint16_t conn_handle, uint8_t tx_phy, uint8_t rx_phy)
|
||||
{
|
||||
@@ -901,6 +909,7 @@ void btm_read_phy_callback(uint8_t hci_status, uint16_t conn_handle, uint8_t tx_
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_PHY_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
tBTM_STATUS BTM_BlePeriodicAdvSyncCancel(void)
|
||||
{
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
@@ -1001,7 +1010,9 @@ tBTM_STATUS BTM_BlePeriodicAdvClearDev(void)
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
tBTM_STATUS BTM_BleSetExtendedScanParams(tBTM_BLE_EXT_SCAN_PARAMS *params)
|
||||
{
|
||||
UINT8 phy_mask = 0;
|
||||
@@ -1082,6 +1093,7 @@ end:
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
void BTM_BleSetPreferExtenedConnParams (BD_ADDR bd_addr, tBTM_EXT_CONN_PARAMS *params)
|
||||
{
|
||||
@@ -1218,11 +1230,14 @@ void btm_ble_update_phy_evt(tBTM_BLE_UPDATE_PHY *params)
|
||||
return;
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
void btm_ble_scan_timeout_evt(void)
|
||||
{
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_SCAN_TIMEOUT_EVT, NULL);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
void btm_ble_adv_set_terminated_evt(tBTM_BLE_ADV_TERMINAT *params)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
@@ -1248,7 +1263,9 @@ void btm_ble_adv_set_terminated_evt(tBTM_BLE_ADV_TERMINAT *params)
|
||||
|
||||
return;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
void btm_ble_ext_adv_report_evt(tBTM_BLE_EXT_ADV_REPORT *params)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
@@ -1266,6 +1283,7 @@ void btm_ble_ext_adv_report_evt(tBTM_BLE_EXT_ADV_REPORT *params)
|
||||
return;
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
void btm_ble_scan_req_received_evt(tBTM_BLE_SCAN_REQ_RECEIVED *params)
|
||||
{
|
||||
@@ -1301,6 +1319,7 @@ void btm_ble_channel_select_algorithm_evt(tBTM_BLE_CHANNEL_SEL_ALG *params)
|
||||
return;
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
void btm_ble_periodic_adv_report_evt(tBTM_PERIOD_ADV_REPORT *params)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
@@ -1354,6 +1373,7 @@ void btm_ble_periodic_adv_sync_establish_evt(tBTM_BLE_PERIOD_ADV_SYNC_ESTAB *par
|
||||
return;
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
uint8_t btm_ble_ext_adv_active_count(void)
|
||||
{
|
||||
|
||||
@@ -689,10 +689,11 @@ static void btm_suspend_wl_activity(tBTM_BLE_WL_STATE wl_state)
|
||||
if (wl_state & BTM_BLE_WL_SCAN) {
|
||||
btm_ble_start_select_conn(FALSE, NULL);
|
||||
}
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (wl_state & BTM_BLE_WL_ADV) {
|
||||
btm_ble_stop_adv();
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -707,7 +708,9 @@ void btm_resume_wl_activity(tBTM_BLE_WL_STATE wl_state)
|
||||
{
|
||||
btm_ble_resume_bg_conn();
|
||||
if (wl_state & BTM_BLE_WL_ADV) {
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
btm_ble_start_adv();
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -724,7 +727,7 @@ void btm_resume_wl_activity(tBTM_BLE_WL_STATE wl_state)
|
||||
static void btm_wl_update_to_controller(void)
|
||||
{
|
||||
/* whitelist will be added in the btm_ble_resume_bg_conn(), we do not
|
||||
support background connection now, so we nedd to use btm_execute_wl_dev_operation
|
||||
support background connection now, so we need to use btm_execute_wl_dev_operation
|
||||
to add whitelist directly ,if we support background connection in the future,
|
||||
please delete btm_execute_wl_dev_operation(). */
|
||||
btm_execute_wl_dev_operation();
|
||||
|
||||
@@ -246,56 +246,77 @@ const UINT8 btm_le_state_combo_tbl[BTM_BLE_STATE_MAX][BTM_BLE_STATE_MAX][2] = {
|
||||
/* check LE combo state supported */
|
||||
#define BTM_LE_STATES_SUPPORTED(x, y, z) ((x)[(z)] & (y))
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
static osi_mutex_t adv_enable_lock;
|
||||
static osi_mutex_t adv_data_lock;
|
||||
static osi_mutex_t adv_param_lock;
|
||||
static osi_mutex_t scan_enable_lock;
|
||||
static osi_mutex_t scan_param_lock;
|
||||
osi_sem_t adv_enable_sem;
|
||||
osi_sem_t adv_data_sem;
|
||||
osi_sem_t adv_param_sem;
|
||||
osi_sem_t scan_enable_sem;
|
||||
osi_sem_t scan_param_sem;
|
||||
uint8_t adv_enable_status = 0;
|
||||
uint8_t adv_data_status = 0;
|
||||
uint8_t adv_param_status = 0;
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
static osi_mutex_t scan_enable_lock;
|
||||
static osi_mutex_t scan_param_lock;
|
||||
osi_sem_t scan_enable_sem;
|
||||
osi_sem_t scan_param_sem;
|
||||
uint8_t scan_enable_status = 0;
|
||||
uint8_t scan_param_status = 0;
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
void btm_ble_lock_init(void)
|
||||
{
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
osi_mutex_new(&adv_enable_lock);
|
||||
osi_mutex_new(&adv_data_lock);
|
||||
osi_mutex_new(&adv_param_lock);
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
osi_mutex_new(&scan_enable_lock);
|
||||
osi_mutex_new(&scan_param_lock);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
void btm_ble_lock_free(void)
|
||||
{
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
osi_mutex_free(&adv_enable_lock);
|
||||
osi_mutex_free(&adv_data_lock);
|
||||
osi_mutex_free(&adv_param_lock);
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
osi_mutex_free(&scan_enable_lock);
|
||||
osi_mutex_free(&scan_param_lock);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
void btm_ble_sem_init(void)
|
||||
{
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
osi_sem_new(&adv_enable_sem, 1, 0);
|
||||
osi_sem_new(&adv_data_sem, 1, 0);
|
||||
osi_sem_new(&adv_param_sem, 1, 0);
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
osi_sem_new(&scan_enable_sem, 1, 0);
|
||||
osi_sem_new(&scan_param_sem, 1, 0);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
void btm_ble_sem_free(void)
|
||||
{
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
osi_sem_free(&adv_enable_sem);
|
||||
osi_sem_free(&adv_data_sem);
|
||||
osi_sem_free(&adv_param_sem);
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
osi_sem_free(&scan_enable_sem);
|
||||
osi_sem_free(&scan_param_sem);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -380,8 +401,10 @@ void BTM_BleUpdateAdvFilterPolicy(tBTM_BLE_AFP adv_policy)
|
||||
if (p_cb->afp != adv_policy) {
|
||||
p_cb->afp = adv_policy;
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/* if adv active, stop and restart */
|
||||
btm_ble_stop_adv ();
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
if (p_cb->connectable_mode & BTM_BLE_CONNECTABLE) {
|
||||
p_cb->evt_type = btm_set_conn_mode_adv_init_addr(p_cb, p_addr_ptr, &init_addr_type,
|
||||
@@ -406,7 +429,9 @@ void BTM_BleUpdateAdvFilterPolicy(tBTM_BLE_AFP adv_policy)
|
||||
p_cb->afp);
|
||||
|
||||
if (adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
btm_ble_start_adv ();
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -512,8 +537,9 @@ tBTM_STATUS BTM_BleObserve(BOOLEAN start, UINT32 duration,
|
||||
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type,
|
||||
BTM_BLE_DEFAULT_SFP);
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
status = btm_ble_start_scan();
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
if (status == BTM_CMD_STARTED) {
|
||||
@@ -535,6 +561,7 @@ tBTM_STATUS BTM_BleObserve(BOOLEAN start, UINT32 duration,
|
||||
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleScan
|
||||
@@ -612,7 +639,9 @@ tBTM_STATUS BTM_BleScan(BOOLEAN start, UINT32 duration,
|
||||
return status;
|
||||
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleBroadcast
|
||||
@@ -671,7 +700,7 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if BLE_VND_INCLUDED == TRUE
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1441,76 +1470,7 @@ static UINT8 btm_set_conn_mode_adv_init_addr(tBTM_BLE_INQ_CB *p_cb,
|
||||
return evt_type;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetAdvParams
|
||||
**
|
||||
** Description This function is called to set advertising parameters.
|
||||
**
|
||||
** Parameters adv_int_min: minimum advertising interval
|
||||
** adv_int_max: maximum advertising interval
|
||||
** p_dir_bda: connectable direct initiator's LE device address
|
||||
** chnl_map: advertising channel map.
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS BTM_BleSetAdvParams(UINT16 adv_int_min, UINT16 adv_int_max,
|
||||
tBLE_BD_ADDR *p_dir_bda,
|
||||
tBTM_BLE_ADV_CHNL_MAP chnl_map)
|
||||
{
|
||||
tBTM_LE_RANDOM_CB *p_addr_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
|
||||
tBTM_BLE_INQ_CB *p_cb = &btm_cb.ble_ctr_cb.inq_var;
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
BD_ADDR p_addr_ptr = {0};
|
||||
tBLE_ADDR_TYPE init_addr_type = BLE_ADDR_PUBLIC;
|
||||
tBLE_ADDR_TYPE own_addr_type = p_addr_cb->own_addr_type;
|
||||
UINT8 adv_mode = p_cb->adv_mode;
|
||||
|
||||
BTM_TRACE_EVENT ("BTM_BleSetAdvParams");
|
||||
|
||||
if (!controller_get_interface()->supports_ble()) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
if (!BTM_BLE_ISVALID_PARAM(adv_int_min, BTM_BLE_ADV_INT_MIN, BTM_BLE_ADV_INT_MAX) ||
|
||||
!BTM_BLE_ISVALID_PARAM(adv_int_max, BTM_BLE_ADV_INT_MIN, BTM_BLE_ADV_INT_MAX)) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
p_cb->adv_interval_min = adv_int_min;
|
||||
p_cb->adv_interval_max = adv_int_max;
|
||||
p_cb->adv_chnl_map = chnl_map;
|
||||
|
||||
if (p_dir_bda) {
|
||||
memcpy(&p_cb->direct_bda, p_dir_bda, sizeof(tBLE_BD_ADDR));
|
||||
}
|
||||
|
||||
BTM_TRACE_EVENT ("update params for an active adv\n");
|
||||
|
||||
btm_ble_stop_adv();
|
||||
|
||||
p_cb->evt_type = btm_set_conn_mode_adv_init_addr(p_cb, p_addr_ptr, &init_addr_type,
|
||||
&own_addr_type);
|
||||
|
||||
/* update adv params */
|
||||
btsnd_hcic_ble_write_adv_params (p_cb->adv_interval_min,
|
||||
p_cb->adv_interval_max,
|
||||
p_cb->evt_type,
|
||||
own_addr_type,
|
||||
init_addr_type,
|
||||
p_addr_ptr,
|
||||
p_cb->adv_chnl_map,
|
||||
p_cb->afp);
|
||||
|
||||
if (adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
btm_ble_start_adv();
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetAdvParamsAll
|
||||
@@ -1605,6 +1565,7 @@ tBTM_STATUS BTM_BleStartAdv(void)
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadAdvParams
|
||||
@@ -1697,6 +1658,7 @@ void BTM_BleSetScanParams(tGATT_IF client_if, UINT32 scan_interval, UINT32 scan_
|
||||
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
tBTM_STATUS BTM_BleSetScanFilterParams(tGATT_IF client_if, UINT32 scan_interval, UINT32 scan_window,
|
||||
tBLE_SCAN_MODE scan_mode, UINT8 addr_type_own, UINT8 scan_duplicate_filter, tBTM_BLE_SFP scan_filter_policy,
|
||||
tBLE_SCAN_PARAM_SETUP_CBACK scan_setup_status_cback)
|
||||
@@ -1752,8 +1714,9 @@ tBTM_STATUS BTM_BleSetScanFilterParams(tGATT_IF client_if, UINT32 scan_interval,
|
||||
osi_mutex_unlock(&scan_param_lock);
|
||||
return ret;
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteScanRsp
|
||||
@@ -1828,6 +1791,7 @@ tBTM_STATUS BTM_BleWriteScanRspRaw(UINT8 *p_raw_scan_rsp, UINT32 raw_scan_rsp_le
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1894,6 +1858,7 @@ tBTM_STATUS BTM_UpdateBleDuplicateExceptionalList(uint8_t subcode, uint32_t type
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteAdvData
|
||||
@@ -1944,38 +1909,6 @@ tBTM_STATUS BTM_BleWriteAdvData(tBTM_BLE_AD_MASK data_mask, tBTM_BLE_ADV_DATA *p
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteLongAdvData
|
||||
**
|
||||
** Description This function is called to write long advertising data.
|
||||
**
|
||||
** Parameters: adv_data: long advertising data
|
||||
** adv_data_len: the length of long advertising data
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS BTM_BleWriteLongAdvData(uint8_t *adv_data, uint8_t adv_data_len)
|
||||
{
|
||||
tBTM_STATUS status = BTM_NO_RESOURCES;
|
||||
if (!controller_get_interface()->supports_ble()) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
if(!adv_data || adv_data_len <= 0 || adv_data_len > BTM_BLE_LONG_ADV_MAX_LEN) {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
uint8_t long_adv[BTM_BLE_LONG_ADV_MAX_LEN + 1] = {0};
|
||||
long_adv[0] = adv_data_len;
|
||||
memcpy(&long_adv[1], adv_data, adv_data_len);
|
||||
status = BTM_VendorSpecificCommand(HCI_VENDOR_BLE_LONG_ADV_DATA, BTM_BLE_LONG_ADV_MAX_LEN + 1, long_adv, NULL);
|
||||
if(status == BTM_CMD_STARTED) {
|
||||
status = BTM_SUCCESS;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteAdvDataRaw
|
||||
@@ -2001,7 +1934,7 @@ tBTM_STATUS BTM_BleWriteAdvDataRaw(UINT8 *p_raw_adv, UINT32 raw_adv_len)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2171,16 +2104,20 @@ UINT16 BTM_BleReadConnectability(void)
|
||||
|
||||
void BTM_Recovery_Pre_State(void)
|
||||
{
|
||||
#if ((BLE_42_ADV_EN == TRUE) || (BLE_42_SCAN_EN == TRUE))
|
||||
tBTM_BLE_INQ_CB *ble_inq_cb = &btm_cb.ble_ctr_cb.inq_var;
|
||||
|
||||
#endif // #if ((BLE_42_ADV_EN == TRUE) || (BLE_42_SCAN_EN == TRUE))
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (ble_inq_cb->state & BTM_BLE_ADVERTISING) {
|
||||
btm_ble_stop_adv();
|
||||
btm_ble_start_adv();
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
if (ble_inq_cb->state & BTM_BLE_SCANNING) {
|
||||
btm_ble_start_scan();
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2621,7 +2558,9 @@ tBTM_STATUS btm_ble_set_discoverability(UINT16 combined_mode)
|
||||
|
||||
if (evt_type != p_cb->evt_type || p_cb->adv_addr_type != own_addr_type
|
||||
|| !p_cb->fast_adv_on) {
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
btm_ble_stop_adv();
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
/* update adv params */
|
||||
if (!btsnd_hcic_ble_write_adv_params (adv_int_min,
|
||||
@@ -2641,11 +2580,13 @@ tBTM_STATUS btm_ble_set_discoverability(UINT16 combined_mode)
|
||||
}
|
||||
|
||||
if (status == BTM_SUCCESS && p_cb->adv_mode != new_mode) {
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (new_mode == BTM_BLE_ADV_ENABLE) {
|
||||
status = btm_ble_start_adv();
|
||||
} else {
|
||||
status = btm_ble_stop_adv();
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
}
|
||||
|
||||
if (p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
@@ -2716,7 +2657,9 @@ tBTM_STATUS btm_ble_set_connectability(UINT16 combined_mode)
|
||||
btm_ble_set_adv_flag (combined_mode, btm_cb.btm_inq_vars.discoverable_mode);
|
||||
if (p_cb->evt_type != evt_type || p_cb->adv_addr_type != p_addr_cb->own_addr_type
|
||||
|| !p_cb->fast_adv_on) {
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
btm_ble_stop_adv();
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
if (!btsnd_hcic_ble_write_adv_params (adv_int_min,
|
||||
adv_int_max,
|
||||
@@ -2736,11 +2679,13 @@ tBTM_STATUS btm_ble_set_connectability(UINT16 combined_mode)
|
||||
|
||||
/* update advertising mode */
|
||||
if (status == BTM_SUCCESS && new_mode != p_cb->adv_mode) {
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (new_mode == BTM_BLE_ADV_ENABLE) {
|
||||
status = btm_ble_start_adv();
|
||||
} else {
|
||||
status = btm_ble_stop_adv();
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
}
|
||||
|
||||
if (p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
@@ -2801,7 +2746,9 @@ tBTM_STATUS btm_ble_start_inquiry (UINT8 mode, UINT8 duration)
|
||||
/* enable IRK list */
|
||||
//btm_ble_enable_resolving_list_for_platform(BTM_BLE_RL_SCAN);
|
||||
#endif
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
status = btm_ble_start_scan();
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
} else if ((p_ble_cb->inq_var.scan_interval != BTM_BLE_LOW_LATENCY_SCAN_INT) ||
|
||||
(p_ble_cb->inq_var.scan_window != BTM_BLE_LOW_LATENCY_SCAN_WIN)) {
|
||||
BTM_TRACE_DEBUG("%s, restart LE scan with low latency scan params", __FUNCTION__);
|
||||
@@ -3853,6 +3800,7 @@ void btm_ble_process_direct_adv_pkt(UINT8 *p)
|
||||
// TODO
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_start_scan
|
||||
@@ -3890,6 +3838,7 @@ tBTM_STATUS btm_ble_start_scan(void)
|
||||
osi_mutex_unlock(&scan_enable_lock);
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -3939,8 +3888,10 @@ void btm_ble_stop_inquiry(void)
|
||||
} else if ((p_ble_cb->inq_var.scan_interval != BTM_BLE_LOW_LATENCY_SCAN_INT) ||
|
||||
(p_ble_cb->inq_var.scan_window != BTM_BLE_LOW_LATENCY_SCAN_WIN)) {
|
||||
BTM_TRACE_DEBUG("%s: setting default params for ongoing observe", __FUNCTION__);
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
btm_ble_stop_scan();
|
||||
btm_ble_start_scan();
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
/* If we have a callback registered for inquiry complete, call it */
|
||||
@@ -3991,6 +3942,7 @@ static void btm_ble_stop_observe(void)
|
||||
*******************************************************************************/
|
||||
static void btm_ble_stop_discover(void)
|
||||
{
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
tBTM_BLE_CB *p_ble_cb = & btm_cb.ble_ctr_cb;
|
||||
tBTM_CMPL_CB *p_scan_cb = p_ble_cb->p_scan_cmpl_cb;
|
||||
btu_stop_timer (&p_ble_cb->scan_timer_ent);
|
||||
@@ -4018,6 +3970,7 @@ static void btm_ble_stop_discover(void)
|
||||
(p_scan_cb)((tBTM_INQUIRY_CMPL *) &btm_cb.btm_inq_vars.inq_cmpl_info);
|
||||
}
|
||||
osi_mutex_unlock(&scan_enable_lock);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -4030,6 +3983,7 @@ static void btm_ble_stop_discover(void)
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef BOOLEAN (BTM_TOPOLOGY_FUNC_PTR)(tBTM_BLE_STATE_MASK);
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
static BOOLEAN btm_ble_adv_states_operation(BTM_TOPOLOGY_FUNC_PTR *p_handler, UINT8 adv_evt)
|
||||
{
|
||||
BOOLEAN rt = FALSE;
|
||||
@@ -4062,7 +4016,6 @@ static BOOLEAN btm_ble_adv_states_operation(BTM_TOPOLOGY_FUNC_PTR *p_handler, UI
|
||||
return rt;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_start_adv
|
||||
@@ -4174,14 +4127,19 @@ tBTM_STATUS btm_ble_stop_adv(void)
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
|
||||
{
|
||||
tBTM_STATUS rt = BTM_SUCCESS;
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
osi_mutex_lock(&adv_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
osi_mutex_lock(&scan_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_DISABLE)) {
|
||||
osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
@@ -4190,7 +4148,9 @@ tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) {
|
||||
if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_SCAN_DUPLICATE_DISABLE)) {
|
||||
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
@@ -4199,11 +4159,13 @@ tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
if (rt == BTM_SUCCESS) {
|
||||
btsnd_hcic_ble_set_random_addr(random_bda);
|
||||
}
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_ENABLE)) {
|
||||
osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
@@ -4212,7 +4174,9 @@ tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) {
|
||||
if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_ENABLE, btm_cb.ble_ctr_cb.inq_var.scan_duplicate_filter)) {
|
||||
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||
@@ -4221,9 +4185,14 @@ tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
|
||||
rt = BTM_BAD_VALUE_RET;
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
osi_mutex_unlock(&adv_enable_lock);
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
osi_mutex_unlock(&scan_enable_lock);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
return rt;
|
||||
}
|
||||
@@ -4240,6 +4209,7 @@ tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
|
||||
*******************************************************************************/
|
||||
static void btm_ble_start_slow_adv (void)
|
||||
{
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
tBTM_BLE_INQ_CB *p_cb = &btm_cb.ble_ctr_cb.inq_var;
|
||||
|
||||
if (p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
@@ -4258,9 +4228,9 @@ static void btm_ble_start_slow_adv (void)
|
||||
p_cb->evt_type, own_addr_type,
|
||||
init_addr_type, p_addr_ptr,
|
||||
p_cb->adv_chnl_map, p_cb->afp);
|
||||
|
||||
btm_ble_start_adv();
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -683,10 +683,12 @@ BOOLEAN btm_ble_suspend_resolving_list_activity(void)
|
||||
|
||||
p_ble_cb->suspended_rl_state = BTM_BLE_RL_IDLE;
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (p_ble_cb->inq_var.adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||
btm_ble_stop_adv();
|
||||
p_ble_cb->suspended_rl_state |= BTM_BLE_RL_ADV;
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
if (BTM_BLE_IS_SCAN_ACTIVE(p_ble_cb->scan_activity)) {
|
||||
btm_ble_stop_scan();
|
||||
@@ -714,15 +716,16 @@ BOOLEAN btm_ble_suspend_resolving_list_activity(void)
|
||||
void btm_ble_resume_resolving_list_activity(void)
|
||||
{
|
||||
tBTM_BLE_CB *p_ble_cb = &btm_cb.ble_ctr_cb;
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if (p_ble_cb->suspended_rl_state & BTM_BLE_RL_ADV) {
|
||||
btm_ble_start_adv();
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
if (p_ble_cb->suspended_rl_state & BTM_BLE_RL_SCAN) {
|
||||
btm_ble_start_scan();
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
if (p_ble_cb->suspended_rl_state & BTM_BLE_RL_INIT) {
|
||||
btm_ble_resume_bg_conn();
|
||||
}
|
||||
|
||||
@@ -752,9 +752,6 @@ void btm_vsc_complete (UINT8 *p, UINT16 opcode, UINT16 evt_len,
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
tBTM_BLE_CB *ble_cb = &btm_cb.ble_ctr_cb;
|
||||
switch(opcode) {
|
||||
case HCI_VENDOR_BLE_LONG_ADV_DATA:
|
||||
BTM_TRACE_EVENT("Set long adv data complete\n");
|
||||
break;
|
||||
case HCI_VENDOR_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST: {
|
||||
uint8_t subcode, status; uint32_t length;
|
||||
STREAM_TO_UINT8(status, p);
|
||||
|
||||
@@ -136,13 +136,21 @@ static void btu_ble_proc_enhanced_conn_cmpl (UINT8 *p, UINT16 evt_len);
|
||||
//#endif
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
static void btu_ble_phy_update_complete_evt(UINT8 *p);
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len);
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p);
|
||||
static void btu_ble_periodic_adv_report_evt(UINT8 *p, UINT8 evt_len);
|
||||
static void btu_ble_periodic_adv_sync_lost_evt(UINT8 *p);
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
static void btu_ble_scan_timeout_evt(UINT8 *p);
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
static void btu_ble_adv_set_terminate_evt(UINT8 *p);
|
||||
static void btu_ble_scan_req_received_evt(UINT8 *p);
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
static void btu_ble_channel_select_alg_evt(UINT8 *p);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
@@ -389,10 +397,13 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
case HCI_BLE_PHY_UPDATE_COMPLETE_EVT:
|
||||
btu_ble_phy_update_complete_evt(p);
|
||||
break;
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
case HCI_BLE_EXT_ADV_REPORT_EVT:
|
||||
//HCI_TRACE_ERROR("%s, HCI_BLE_EXT_ADV_REPORT_EVT.", __func__);
|
||||
btu_ble_ext_adv_report_evt(p, hci_evt_len);
|
||||
break;
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
case HCI_BLE_PERIOD_ADV_SYNC_ESTAB_EVT:
|
||||
btu_ble_periodic_adv_sync_establish_evt(p);
|
||||
break;
|
||||
@@ -402,15 +413,20 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
case HCI_BLE_PERIOD_ADV_SYNC_LOST_EVT:
|
||||
btu_ble_periodic_adv_sync_lost_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
case HCI_BLE_SCAN_TIMEOUT_EVT:
|
||||
btu_ble_scan_timeout_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
case HCI_BLE_ADV_SET_TERMINATED_EVT:
|
||||
btu_ble_adv_set_terminate_evt(p);
|
||||
break;
|
||||
case HCI_BLE_SCAN_REQ_RECEIVED_EVT:
|
||||
btu_ble_scan_req_received_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
case HCI_BLE_CHANNEL_SELECT_ALG:
|
||||
btu_ble_channel_select_alg_evt(p);
|
||||
break;
|
||||
@@ -1070,9 +1086,11 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
|
||||
case HCI_BLE_TRANSMITTER_TEST:
|
||||
case HCI_BLE_RECEIVER_TEST:
|
||||
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
case HCI_BLE_TEST_END:
|
||||
btm_ble_test_command_complete(p);
|
||||
break;
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
case HCI_BLE_CREATE_CONN_CANCEL:
|
||||
btm_ble_create_conn_cancel_complete(p);
|
||||
break;
|
||||
@@ -1107,6 +1125,7 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
break;
|
||||
#endif // #if (defined BLE_PRIVACY_SPT && BLE_PRIVACY_SPT == TRUE)
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
case HCI_BLE_SET_EXT_ADV_PARAM:
|
||||
case HCI_BLE_SET_EXT_ADV_DATA:
|
||||
case HCI_BLE_SET_EXT_SCAN_RSP_DATA:
|
||||
@@ -1115,6 +1134,7 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
HCI_TRACE_EVENT("%s opcode 0x%x status 0x%x", __func__, opcode, status);
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
case HCI_BLE_READ_PHY: {
|
||||
uint16_t conn_handle;
|
||||
uint8_t tx_phy;
|
||||
@@ -1126,11 +1146,14 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
btm_read_phy_callback(status, conn_handle, tx_phy, rx_phy);
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
case HCI_BLE_ENH_RX_TEST:
|
||||
case HCI_BLE_ENH_TX_TEST:
|
||||
btm_ble_test_command_complete(p);
|
||||
break;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
case HCI_BLE_SET_PERIOD_ADV_RECV_ENABLE:
|
||||
case HCI_BLE_SET_DEFAULT_PAST_PARAMS:
|
||||
@@ -1194,6 +1217,7 @@ static void btu_hcif_command_complete_evt(BT_HDR *response, void *context)
|
||||
uint8_t *stream = response->data + response->offset + 3;
|
||||
STREAM_TO_UINT16(opcode, stream);
|
||||
switch (opcode) {
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
case HCI_BLE_WRITE_ADV_DATA:
|
||||
adv_data_status = *stream;
|
||||
osi_sem_give(&adv_data_sem);
|
||||
@@ -1211,6 +1235,8 @@ static void btu_hcif_command_complete_evt(BT_HDR *response, void *context)
|
||||
adv_param_status = *stream;
|
||||
osi_sem_give(&adv_param_sem);
|
||||
break;
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
case HCI_BLE_WRITE_SCAN_PARAMS:
|
||||
scan_param_status = *stream;
|
||||
osi_sem_give(&scan_param_sem);
|
||||
@@ -1219,6 +1245,7 @@ static void btu_hcif_command_complete_evt(BT_HDR *response, void *context)
|
||||
scan_enable_status = *stream;
|
||||
osi_sem_give(&scan_enable_sem);
|
||||
break;
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1287,6 +1314,7 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
||||
btm_pm_proc_cmd_status(status);
|
||||
break;
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
case HCI_BLE_PERIOD_ADV_CREATE_SYNC:
|
||||
{
|
||||
uint8_t btm_status = BTM_SUCCESS;
|
||||
@@ -1297,6 +1325,7 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
||||
btm_create_sync_callback(btm_status);
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
case HCI_BLE_SET_PHY:
|
||||
{
|
||||
uint8_t btm_status = BTM_SUCCESS;
|
||||
@@ -2138,6 +2167,7 @@ static void btu_ble_phy_update_complete_evt(UINT8 *p)
|
||||
}
|
||||
|
||||
#if BLE_PRIVACY_SPT == TRUE
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_resolve_random_addr_adv_ext
|
||||
@@ -2158,8 +2188,10 @@ static void btm_ble_resolve_random_addr_adv_ext(void *p_rec, void *p)
|
||||
BDADDR_TO_STREAM(pp,bda);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#endif
|
||||
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len)
|
||||
{
|
||||
tBTM_BLE_EXT_ADV_REPORT ext_adv_report = {0};
|
||||
@@ -2240,7 +2272,9 @@ static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len)
|
||||
}
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_ESTAB sync_estab = {0};
|
||||
@@ -2313,14 +2347,18 @@ static void btu_ble_periodic_adv_sync_lost_evt(UINT8 *p)
|
||||
|
||||
btm_ble_periodic_adv_sync_lost_evt(&sync_lost);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
static void btu_ble_scan_timeout_evt(UINT8 *p)
|
||||
{
|
||||
UNUSED(p);
|
||||
|
||||
btm_ble_scan_timeout_evt();
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
static void btu_ble_adv_set_terminate_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_ADV_TERMINAT adv_term = {0};
|
||||
@@ -2353,6 +2391,7 @@ static void btu_ble_scan_req_received_evt(UINT8 *p)
|
||||
|
||||
btm_ble_scan_req_received_evt(&req_received);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
static void btu_ble_channel_select_alg_evt(UINT8 *p)
|
||||
{
|
||||
|
||||
@@ -686,6 +686,7 @@ BOOLEAN btsnd_hcic_ble_ltk_req_neg_reply (UINT16 handle)
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
#if (BLE_42_DTM_TEST_EN == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_receiver_test(UINT8 rx_freq)
|
||||
{
|
||||
BT_HDR *p;
|
||||
@@ -733,7 +734,9 @@ BOOLEAN btsnd_hcic_ble_transmitter_test(UINT8 tx_freq, UINT8 test_data_len, UINT
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return (TRUE);
|
||||
}
|
||||
#endif // // #if (BLE_42_DTM_TEST_EN == TRUE)
|
||||
|
||||
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
BOOLEAN btsnd_hcic_ble_test_end(void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
@@ -754,6 +757,7 @@ BOOLEAN btsnd_hcic_ble_test_end(void)
|
||||
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return (TRUE);
|
||||
}
|
||||
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_read_host_supported (void)
|
||||
{
|
||||
@@ -1174,6 +1178,7 @@ BOOLEAN btsnd_hcic_ble_set_phy(UINT16 conn_handle,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy,
|
||||
UINT8 modulation_idx)
|
||||
{
|
||||
@@ -1218,7 +1223,9 @@ UINT8 btsnd_hcic_ble_enhand_tx_test(UINT8 tx_channel, UINT8 len,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr)
|
||||
{
|
||||
BT_HDR *p;
|
||||
@@ -1432,7 +1439,9 @@ UINT8 btsnd_hcic_ble_clear_adv_set(void)
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_params(UINT8 adv_handle,
|
||||
UINT16 interval_min,
|
||||
UINT16 interval_max,
|
||||
@@ -1507,7 +1516,9 @@ UINT8 btsnd_hcic_ble_periodic_adv_enable(UINT8 enable, UINT8 adv_handle)
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_ext_scan_params(UINT8 own_addr_type, UINT8 filter_policy,
|
||||
UINT8 phy_mask, UINT8 phy_count,
|
||||
tHCI_EXT_SCAN_PARAMS *params)
|
||||
@@ -1555,6 +1566,7 @@ UINT8 btsnd_hcic_ble_ext_scan_enable(UINT8 enable, UINT8 filter_dups,
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn)
|
||||
{
|
||||
@@ -1627,6 +1639,7 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn)
|
||||
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
|
||||
UINT8 adv_addr_type, BD_ADDR adv_addr,
|
||||
UINT16 sync_timeout, UINT8 unused)
|
||||
@@ -1750,6 +1763,7 @@ UINT8 btsnd_hcic_ble_read_periodic_adv_list_size(void)
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
UINT8 btsnd_hcic_ble_read_trans_power(void)
|
||||
{
|
||||
|
||||
@@ -367,7 +367,6 @@ typedef UINT32 tBTM_BLE_AD_MASK;
|
||||
#define BTM_BLE_AD_TYPE_MANU HCI_EIR_MANUFACTURER_SPECIFIC_TYPE /* 0xff */
|
||||
typedef UINT8 tBTM_BLE_AD_TYPE;
|
||||
|
||||
#define BTM_BLE_LONG_ADV_MAX_LEN 249
|
||||
|
||||
/* Security settings used with L2CAP LE COC */
|
||||
#define BTM_SEC_LE_LINK_ENCRYPTED 0x01
|
||||
@@ -1013,6 +1012,7 @@ typedef void (tBTM_SET_CSA_SUPPORT_CMPL_CBACK) (tBTM_STATUS status);
|
||||
#define BTM_BLE_5_GAP_READ_PHY_COMPLETE_EVT 1
|
||||
#define BTM_BLE_5_GAP_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT 2
|
||||
#define BTM_BLE_5_GAP_SET_PREFERED_PHY_COMPLETE_EVT 3
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT 4
|
||||
#define BTM_BLE_5_GAP_EXT_ADV_SET_PARAMS_COMPLETE_EVT 5
|
||||
#define BTM_BLE_5_GAP_EXT_ADV_DATA_SET_COMPLETE_EVT 6
|
||||
@@ -1021,6 +1021,8 @@ typedef void (tBTM_SET_CSA_SUPPORT_CMPL_CBACK) (tBTM_STATUS status);
|
||||
#define BTM_BLE_5_GAP_EXT_ADV_STOP_COMPLETE_EVT 9
|
||||
#define BTM_BLE_5_GAP_EXT_ADV_SET_REMOVE_COMPLETE_EVT 10
|
||||
#define BTM_BLE_5_GAP_EXT_ADV_SET_CLEAR_COMPLETE_EVT 11
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT 12
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_DATA_SET_COMPLETE_EVT 13
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_START_COMPLETE_EVT 14
|
||||
@@ -1031,19 +1033,28 @@ typedef void (tBTM_SET_CSA_SUPPORT_CMPL_CBACK) (tBTM_STATUS status);
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT 19
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT 20
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT 21
|
||||
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_SET_EXT_SCAN_PARAMS_COMPLETE_EVT 22
|
||||
#define BTM_BLE_5_GAP_EXT_SCAN_START_COMPLETE_EVT 23
|
||||
#define BTM_BLE_5_GAP_EXT_SCAN_STOP_COMPLETE_EVT 24
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT 25
|
||||
#define BTM_BLE_5_GAP_PHY_UPDATE_COMPLETE_EVT 26
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_EXT_ADV_REPORT_EVT 27
|
||||
#define BTM_BLE_5_GAP_SCAN_TIMEOUT_EVT 28
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_ADV_TERMINATED_EVT 29
|
||||
#define BTM_BLE_5_GAP_SCAN_REQ_RECEIVED_EVT 30
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_CHANNEL_SELETE_ALGORITHM_EVT 31
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_REPORT_EVT 32
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_LOST_EVT 33
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_ESTAB_EVT 34
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
#define BTM_BLE_GAP_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT 35
|
||||
#define BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT 36
|
||||
@@ -1313,12 +1324,15 @@ typedef union {
|
||||
tBTM_BLE_READ_PHY_CMPL read_phy;
|
||||
tBTM_BLE_SET_PREF_DEF_PHY_CMPL set_perf_def_phy;
|
||||
tBTM_BLE_SET_PERF_PHY_CMPL set_perf_phy;
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
tBTM_BLE_EXT_ADV_SET_RAND_ADDR_CMPL set_ext_rand_addr;
|
||||
tBTM_BLE_EXT_ADV_SET_PARAMS_CMPL set_params;
|
||||
tBTM_BLE_EXT_ADV_DATA_SET_CMPL adv_data_set;
|
||||
tBTM_BLE_EXT_ADV_SCAN_RSP_DATA_SET_CMPL scan_rsp_data_set;
|
||||
tBTM_BLE_EXT_ADV_START_CMPL adv_start;
|
||||
tBTM_BLE_EXT_ADV_STOP_CMPL adv_stop;
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
tBTM_BLE_PERIOD_ADV_SET_PARAMS_CMPL per_adv_set_params;
|
||||
tBTM_BLE_PERIOD_ADV_DATA_SET_CMPL per_adv_data_set;
|
||||
tBTM_BLE_PERIOD_ADV_START_CMPL per_adv_start;
|
||||
@@ -1329,18 +1343,27 @@ typedef union {
|
||||
tBTM_BLE_PERIOD_ADV_ADD_DEV_CMPL per_adv_add_dev;
|
||||
tBTM_BLE_PERIOD_ADV_REMOVE_DEV_CMPL per_adv_remove_dev;
|
||||
tBTM_BLE_PEROID_ADV_CLEAR_DEV_CMPL per_adv_clear_dev;
|
||||
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
tBTM_BLE_SET_EXT_SCAN_PARAMS_CMPL ext_scan;
|
||||
tBTM_BLE_EXT_SCAN_START_CMPL scan_start;
|
||||
tBTM_BLE_EXT_SCAN_STOP_CMPL scan_stop;
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
tBTM_BLE_PREF_EXT_CONN_SET_PARAMS_CMPL ext_conn_set_params;
|
||||
tBTM_BLE_PHY_UPDATE_CMPL phy_update;
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
tBTM_BLE_EXT_ADV_REPORT ext_adv_report;
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
tBTM_BLE_ADV_TERMINAT adv_term;
|
||||
tBTM_BLE_SCAN_REQ_RECEIVED scan_req;
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
tBTM_BLE_CHANNEL_SEL_ALG channel_sel;
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
tBTM_PERIOD_ADV_REPORT period_adv_report;
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_LOST sync_lost;
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_ESTAB sync_estab;
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
tBTM_BLE_PERIOD_ADV_RECV_ENABLE_CMPL per_adv_recv_enable;
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_TRANS_CMPL per_adv_sync_trans;
|
||||
@@ -1424,23 +1447,6 @@ BOOLEAN BTM_SecAddBleDevice (BD_ADDR bd_addr, BD_NAME bd_name,
|
||||
BOOLEAN BTM_SecAddBleKey (BD_ADDR bd_addr, tBTM_LE_KEY_VALUE *p_le_key,
|
||||
tBTM_LE_KEY_TYPE key_type);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetAdvParams
|
||||
**
|
||||
** Description This function is called to set advertising parameters.
|
||||
**
|
||||
** Parameters: None.
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
tBTM_STATUS BTM_BleSetAdvParams(UINT16 adv_int_min, UINT16 adv_int_max,
|
||||
tBLE_BD_ADDR *p_dir_bda, tBTM_BLE_ADV_CHNL_MAP chnl_map);
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetAdvParamsAll
|
||||
@@ -1485,20 +1491,6 @@ tBTM_STATUS BTM_BleStartAdv(void);
|
||||
tBTM_STATUS BTM_BleWriteAdvData(tBTM_BLE_AD_MASK data_mask,
|
||||
tBTM_BLE_ADV_DATA *p_data);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteLongAdvData
|
||||
**
|
||||
** Description This function is called to write long advertising data.
|
||||
**
|
||||
** Parameters: adv_data: long advertising data
|
||||
** adv_data_len: the length of long advertising data
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS BTM_BleWriteLongAdvData(uint8_t *adv_data, uint8_t adv_data_len);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteAdvDataRaw
|
||||
@@ -2789,12 +2781,13 @@ tBTM_STATUS BTM_BleSetExtendedScanParams(tBTM_BLE_EXT_SCAN_PARAMS *params);
|
||||
tBTM_STATUS BTM_BleExtendedScan(BOOLEAN enable, UINT16 duration, UINT16 period);
|
||||
|
||||
void BTM_BleSetPreferExtenedConnParams(BD_ADDR bd_addr, tBTM_EXT_CONN_PARAMS *params);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
void BTM_BleEnhancedReceiverTest(UINT8 rx_freq, UINT8 phy, UINT8 modulation_index, tBTM_CMPL_CB *p_cmd_cmpl_cback);
|
||||
|
||||
void BTM_BleEnhancedTransmitterTest(UINT8 tx_freq, UINT8 test_data_len, UINT8 packet_payload, UINT8 phy, tBTM_CMPL_CB *p_cmd_cmpl_cback);
|
||||
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
void BTM_BlePeriodicAdvRecvEnable(UINT16 sync_handle, UINT8 enable);
|
||||
|
||||
@@ -357,8 +357,12 @@
|
||||
#define HCI_BLE_READ_PHY (0x0030 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_DEFAULT_PHY (0x0031 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_PHY (0x0032 | HCI_GRP_BLE_CMDS)
|
||||
#endif
|
||||
#if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
#define HCI_BLE_ENH_RX_TEST (0x0033 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_ENH_TX_TEST (0x0034 | HCI_GRP_BLE_CMDS)
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#define HCI_BLE_SET_ADV_RAND_ADDR (0x0035 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_EXT_ADV_PARAM (0x0036 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_EXT_ADV_DATA (0x0037 | HCI_GRP_BLE_CMDS)
|
||||
@@ -461,8 +465,6 @@
|
||||
#define HCI_BLE_ENERGY_INFO_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_ENERGY_INFO)
|
||||
/* Extended BLE Scan parameters OCF */
|
||||
#define HCI_BLE_EXTENDED_SCAN_PARAMS_OCF HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_EXTENDED_SCAN_PARAMS)
|
||||
/* Long BLE Adv data OCF */
|
||||
#define HCI_VENDOR_BLE_LONG_ADV_DATA HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_LONG_ADV)
|
||||
/* BLE update duplicate scan exceptional list */
|
||||
#define HCI_VENDOR_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_DUPLICATE_EXCEPTIONAL_LIST)
|
||||
#define HCI_VENDOR_BLE_SET_ADV_FLOW_CONTROL HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_SET_ADV_FLOW_CONTROL)
|
||||
|
||||
@@ -764,8 +764,12 @@ void btsnd_hcic_vendor_spec_cmd (BT_HDR *buffer, UINT16 opcode,
|
||||
#define HCIC_PARAM_SIZE_BLE_READ_PHY 2
|
||||
#define HCIC_PARAM_SIZE_BLE_SET_DEF_PHY 3
|
||||
#define HCIC_PARAM_SIZE_BLE_SET_PHY 7
|
||||
#endif
|
||||
#if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
#define HCIC_PARAM_SIZE_ENH_RX_TEST 3
|
||||
#define HCIC_PARAM_SIZE_ENH_TX_TEST 4
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#define HCIC_PARAM_SIZE_EXT_RAND_ADDR 7
|
||||
#define HCIC_PARAM_SIZE_EXT_ADV_SET_PARAMS 25
|
||||
#define HCIC_PARAM_SIZE_EXT_ADV_WRITE_DATA 251
|
||||
@@ -963,14 +967,17 @@ UINT8 btsnd_hcic_ble_set_prefered_default_phy(UINT8 all_phys,
|
||||
BOOLEAN btsnd_hcic_ble_set_phy(UINT16 conn_handle,
|
||||
UINT8 all_phys, UINT8 tx_phys,
|
||||
UINT8 rx_phys, UINT16 phy_options);
|
||||
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_enhand_rx_test(UINT8 rx_channel, UINT8 phy,
|
||||
UINT8 modulation_idx);
|
||||
|
||||
UINT8 btsnd_hcic_ble_enhand_tx_test(UINT8 tx_channel, UINT8 len,
|
||||
UINT8 packect,
|
||||
UINT8 phy);
|
||||
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr);
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
|
||||
|
||||
@@ -483,19 +483,23 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
#endif // (GATTC_CONNECT_RETRY_EN == TRUE)
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
if(btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
|
||||
p_lcb->retry_create_con ++;
|
||||
L2CAP_TRACE_DEBUG("slave restart extend adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
|
||||
BTM_BleStartExtAdvRestart(handle);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
if(!btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
|
||||
p_lcb->retry_create_con ++;
|
||||
L2CAP_TRACE_DEBUG("slave resatrt adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
|
||||
btm_ble_start_adv();
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user