mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
Merge branch 'feat/optimize_ble_config_reduce_bin_v5.3' into 'release/v5.3'
Feat/optimize bluedroid host config and reduce bin size (v5.3) See merge request espressif/esp-idf!37260
This commit is contained in:
@@ -2060,6 +2060,7 @@ tBTM_STATUS BTM_ReadLinkQuality (BD_ADDR remote_bda, tBTM_CMPL_CB *p_cb)
|
||||
return (BTM_UNKNOWN_ADDR);
|
||||
}
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_ReadTxPower
|
||||
@@ -2116,6 +2117,7 @@ tBTM_STATUS BTM_ReadTxPower (BD_ADDR remote_bda, tBT_TRANSPORT transport, tBTM_C
|
||||
/* If here, no BD Addr found */
|
||||
return (BTM_UNKNOWN_ADDR);
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
tBTM_STATUS BTM_SetAclPktTypes(BD_ADDR remote_bda, UINT16 pkt_types, tBTM_CMPL_CB *p_cb)
|
||||
{
|
||||
@@ -2182,6 +2184,7 @@ void btm_acl_pkt_types_changed(UINT8 status, UINT16 handle, UINT16 pkt_types)
|
||||
}
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
tBTM_STATUS BTM_BleReadAdvTxPower(tBTM_CMPL_CB *p_cb)
|
||||
{
|
||||
BOOLEAN ret;
|
||||
@@ -2208,6 +2211,7 @@ tBTM_STATUS BTM_BleReadAdvTxPower(tBTM_CMPL_CB *p_cb)
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
void BTM_BleGetWhiteListSize(uint16_t *length)
|
||||
{
|
||||
@@ -2220,6 +2224,7 @@ void BTM_BleGetWhiteListSize(uint16_t *length)
|
||||
}
|
||||
#endif ///BLE_INCLUDED == TRUE
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_read_tx_power_complete
|
||||
@@ -2273,6 +2278,7 @@ void btm_read_tx_power_complete (UINT8 *p, BOOLEAN is_ble)
|
||||
(*p_cb)(&results);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -553,6 +553,7 @@ void BTM_BleSecureConnectionCreateOobData(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
/******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetConnScanParams
|
||||
@@ -582,15 +583,17 @@ void BTM_BleSetConnScanParams (UINT32 scan_interval, UINT32 scan_window)
|
||||
p_ble_cb->scan_win = scan_window;
|
||||
new_param = TRUE;
|
||||
}
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (new_param && p_ble_cb->conn_state == BLE_BG_CONN) {
|
||||
btm_ble_suspend_bg_conn();
|
||||
}
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
} else {
|
||||
BTM_TRACE_ERROR("Illegal Connection Scan Parameters");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // #if (BLE_HOST_CONN_SCAN_PARAM_EN == TRUE)
|
||||
|
||||
/********************************************************
|
||||
**
|
||||
@@ -766,6 +769,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 +809,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 +842,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 +887,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)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -21,6 +21,7 @@ extern BOOLEAN BTM_GetLocalResolvablePrivateAddr(BD_ADDR bda);
|
||||
extern void BTM_UpdateAddrInfor(uint8_t addr_type, BD_ADDR bda);
|
||||
extern void BTM_BleSetStaticAddr(BD_ADDR rand_addr);
|
||||
extern uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *cb);
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
static tBTM_STATUS btm_ble_ext_adv_params_validate(tBTM_BLE_GAP_EXT_ADV_PARAMS *params);
|
||||
static tBTM_STATUS btm_ble_ext_adv_set_data_validate(UINT8 instance, UINT16 len, UINT8 *data);
|
||||
|
||||
@@ -35,6 +36,8 @@ typedef struct {
|
||||
} tBTM_EXT_ADV_RECORD;
|
||||
|
||||
tBTM_EXT_ADV_RECORD adv_record[MAX_BLE_ADV_INSTANCE] = {0};
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
extern void btm_ble_inter_set(bool extble_inter);
|
||||
|
||||
#if !UC_BT_STACK_NO_LOG
|
||||
@@ -193,11 +196,12 @@ void btm_ble_extendadvcb_init(void)
|
||||
{
|
||||
memset(&extend_adv_cb, 0, sizeof(tBTM_BLE_EXTENDED_CB));
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
void btm_ble_advrecod_init(void)
|
||||
{
|
||||
memset(&adv_record[0], 0, sizeof(tBTM_EXT_ADV_RECORD)*MAX_BLE_ADV_INSTANCE);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
void BTM_BleGapRegisterCallback(tBTM_BLE_5_HCI_CBACK cb)
|
||||
{
|
||||
@@ -286,6 +290,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 +683,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 +813,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 +873,7 @@ end:
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
void btm_set_phy_callback(UINT8 status)
|
||||
{
|
||||
@@ -874,6 +884,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 +892,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 +913,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 +1014,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 +1097,7 @@ end:
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
void BTM_BleSetPreferExtenedConnParams (BD_ADDR bd_addr, tBTM_EXT_CONN_PARAMS *params)
|
||||
{
|
||||
@@ -1115,6 +1131,7 @@ void btm_ble_extended_cleanup(void)
|
||||
|
||||
}
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
static tBTM_STATUS btm_ble_ext_adv_params_validate(tBTM_BLE_GAP_EXT_ADV_PARAMS *params)
|
||||
{
|
||||
if (!params) {
|
||||
@@ -1191,6 +1208,7 @@ static tBTM_STATUS btm_ble_ext_adv_set_data_validate(UINT8 instance, UINT16 len,
|
||||
|
||||
return BTM_SUCCESS;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
void btm_ble_update_phy_evt(tBTM_BLE_UPDATE_PHY *params)
|
||||
{
|
||||
@@ -1218,11 +1236,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 +1269,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,7 +1289,9 @@ void btm_ble_ext_adv_report_evt(tBTM_BLE_EXT_ADV_REPORT *params)
|
||||
return;
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
void btm_ble_scan_req_received_evt(tBTM_BLE_SCAN_REQ_RECEIVED *params)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
@@ -1283,7 +1308,7 @@ void btm_ble_scan_req_received_evt(tBTM_BLE_SCAN_REQ_RECEIVED *params)
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
void btm_ble_channel_select_algorithm_evt(tBTM_BLE_CHANNEL_SEL_ALG *params)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
@@ -1301,6 +1326,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,7 +1380,9 @@ void btm_ble_periodic_adv_sync_establish_evt(tBTM_BLE_PERIOD_ADV_SYNC_ESTAB *par
|
||||
return;
|
||||
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
uint8_t btm_ble_ext_adv_active_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
@@ -1367,6 +1395,7 @@ uint8_t btm_ble_ext_adv_active_count(void)
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "common/bt_target.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#include "stack/bt_types.h"
|
||||
#include "stack/hcimsgs.h"
|
||||
#include "stack/btu.h"
|
||||
@@ -445,11 +446,11 @@ BOOLEAN btm_ble_dealloc_addr_filter_counter(tBLE_BD_ADDR *p_bd_addr, UINT8 filte
|
||||
**
|
||||
** Function btm_ble_update_pf_local_name
|
||||
**
|
||||
** Description this function update(add,delete or clear) the adv lcoal name filtering condition.
|
||||
** Description this function update(add,delete or clear) the adv local name filtering condition.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_pf_local_name(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -506,8 +507,8 @@ tBTM_STATUS btm_ble_update_pf_local_name(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description this function update(add/remove) service data change filter.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_srvc_data_change(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -534,8 +535,8 @@ tBTM_STATUS btm_ble_update_srvc_data_change(tBTM_BLE_SCAN_COND_OP action,
|
||||
** data filtering condition.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_pf_manu_data(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -708,8 +709,8 @@ UINT8 btm_ble_cs_update_pf_counter(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description this function update(add,delete or clear) the address filter of adv.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_addr_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -757,8 +758,8 @@ tBTM_STATUS btm_ble_update_addr_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description this function update(add,delete or clear) service UUID filter.
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_update_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -872,7 +873,7 @@ tBTM_STATUS btm_ble_update_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
memset(&btm_ble_adv_filt_cb.cur_filter_target, 0, sizeof(tBLE_BD_ADDR));
|
||||
}
|
||||
} else {
|
||||
BTM_TRACE_ERROR("UUID filter udpating failed");
|
||||
BTM_TRACE_ERROR("UUID filter updating failed");
|
||||
}
|
||||
|
||||
return st;
|
||||
@@ -886,8 +887,8 @@ tBTM_STATUS btm_ble_update_uuid_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
** Description clear all adv payload filter by de-select all the adv pf feature bits
|
||||
**
|
||||
**
|
||||
** Returns BTM_SUCCESS if sucessful,
|
||||
** BTM_ILLEGAL_VALUE if paramter is not valid.
|
||||
** Returns BTM_SUCCESS if successful,
|
||||
** BTM_ILLEGAL_VALUE if parameter is not valid.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTM_STATUS btm_ble_clear_scan_pf_filter(tBTM_BLE_SCAN_COND_OP action,
|
||||
@@ -1303,4 +1304,5 @@ void btm_ble_adv_filter_cleanup(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#endif
|
||||
|
||||
@@ -29,15 +29,22 @@
|
||||
#include "stack/hcimsgs.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
#if BTM_DYNAMIC_MEMORY == FALSE
|
||||
tBTM_BLE_BATCH_SCAN_CB ble_batchscan_cb;
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
tBTM_BLE_ADV_TRACK_CB ble_advtrack_cb;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#else
|
||||
tBTM_BLE_BATCH_SCAN_CB *ble_batchscan_cb_ptr;
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
tBTM_BLE_ADV_TRACK_CB *ble_advtrack_cb_ptr;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#define ble_batchscan_cb (*ble_batchscan_cb_ptr)
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#define ble_advtrack_cb (*ble_advtrack_cb_ptr)
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
#endif
|
||||
|
||||
/* length of each batch scan command */
|
||||
@@ -66,10 +73,11 @@ void btm_ble_batchscan_cleanup(void);
|
||||
*******************************************************************************/
|
||||
void btm_ble_batchscan_filter_track_adv_vse_cback(UINT8 len, UINT8 *p)
|
||||
{
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
tBTM_BLE_TRACK_ADV_DATA adv_data;
|
||||
|
||||
UINT8 sub_event = 0;
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
UINT8 sub_event = 0;
|
||||
STREAM_TO_UINT8(sub_event, p);
|
||||
|
||||
BTM_TRACE_EVENT("btm_ble_batchscan_filter_track_adv_vse_cback called with event:%x", sub_event);
|
||||
@@ -78,7 +86,7 @@ void btm_ble_batchscan_filter_track_adv_vse_cback(UINT8 len, UINT8 *p)
|
||||
ble_batchscan_cb.p_thres_cback(ble_batchscan_cb.ref_value);
|
||||
return;
|
||||
}
|
||||
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
if (HCI_VSE_SUBCODE_BLE_TRACKING_SUB_EVT == sub_event && NULL != ble_advtrack_cb.p_track_cback) {
|
||||
if (len < 10) {
|
||||
return;
|
||||
@@ -125,6 +133,7 @@ void btm_ble_batchscan_filter_track_adv_vse_cback(UINT8 len, UINT8 *p)
|
||||
ble_advtrack_cb.p_track_cback(&adv_data);
|
||||
return;
|
||||
}
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -598,6 +607,7 @@ tBTM_STATUS btm_ble_enable_disable_batchscan(BOOLEAN should_enable)
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetStorageConfig
|
||||
@@ -676,7 +686,7 @@ tBTM_STATUS BTM_BleSetStorageConfig(UINT8 batch_scan_full_max, UINT8 batch_scan_
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif // #if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -796,6 +806,7 @@ tBTM_STATUS BTM_BleDisableBatchScan(tBTM_BLE_REF_VALUE ref_value)
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadScanReports
|
||||
@@ -854,8 +865,9 @@ tBTM_STATUS BTM_BleReadScanReports(tBTM_BLE_BATCH_SCAN_MODE scan_mode,
|
||||
}
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_HOST_READ_SCAN_REPORTS_EN == TRUE)
|
||||
|
||||
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleTrackAdvertiser
|
||||
@@ -888,6 +900,7 @@ tBTM_STATUS BTM_BleTrackAdvertiser(tBTM_BLE_TRACK_ADV_CBACK *p_track_cback,
|
||||
ble_advtrack_cb.ref_value = ref_value;
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -904,7 +917,9 @@ void btm_ble_batchscan_init(void)
|
||||
{
|
||||
#if BTM_DYNAMIC_MEMORY == TRUE
|
||||
ble_batchscan_cb_ptr = (tBTM_BLE_BATCH_SCAN_CB *)osi_malloc(sizeof(tBTM_BLE_BATCH_SCAN_CB));
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
ble_advtrack_cb_ptr = (tBTM_BLE_ADV_TRACK_CB *)osi_malloc(sizeof(tBTM_BLE_ADV_TRACK_CB));
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
if (ble_batchscan_cb_ptr == NULL || ble_advtrack_cb_ptr == NULL) {
|
||||
BTM_TRACE_ERROR("%s malloc failed", __func__);
|
||||
return;
|
||||
@@ -912,7 +927,9 @@ void btm_ble_batchscan_init(void)
|
||||
#endif
|
||||
BTM_TRACE_EVENT (" btm_ble_batchscan_init");
|
||||
memset(&ble_batchscan_cb, 0, sizeof(tBTM_BLE_BATCH_SCAN_CB));
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
memset(&ble_advtrack_cb, 0, sizeof(tBTM_BLE_ADV_TRACK_CB));
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
BTM_RegisterForVSEvents(btm_ble_batchscan_filter_track_adv_vse_cback, TRUE);
|
||||
}
|
||||
|
||||
@@ -940,14 +957,21 @@ void btm_ble_batchscan_cleanup(void)
|
||||
}
|
||||
|
||||
memset(&ble_batchscan_cb, 0, sizeof(tBTM_BLE_BATCH_SCAN_CB));
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
memset(&ble_advtrack_cb, 0, sizeof(tBTM_BLE_ADV_TRACK_CB));
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
#if BTM_DYNAMIC_MEMORY == TRUE
|
||||
osi_free(ble_batchscan_cb_ptr);
|
||||
osi_free(ble_advtrack_cb_ptr);
|
||||
ble_batchscan_cb_ptr = NULL;
|
||||
#if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
osi_free(ble_advtrack_cb_ptr);
|
||||
ble_advtrack_cb_ptr = NULL;
|
||||
#endif // #if (BLE_HOST_TRACK_ADVERTISER_EN == TRUE)
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // #if (BLE_HOST_BATCH_SCAN_EN == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -648,6 +648,7 @@ void btm_ble_initiate_select_conn(BD_ADDR bda)
|
||||
BTM_TRACE_ERROR("btm_ble_initiate_select_conn failed");
|
||||
}
|
||||
}
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_suspend_bg_conn
|
||||
@@ -672,6 +673,8 @@ BOOLEAN btm_ble_suspend_bg_conn(void)
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_suspend_wl_activity
|
||||
@@ -689,10 +692,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)
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -705,9 +709,13 @@ static void btm_suspend_wl_activity(tBTM_BLE_WL_STATE wl_state)
|
||||
*******************************************************************************/
|
||||
void btm_resume_wl_activity(tBTM_BLE_WL_STATE wl_state)
|
||||
{
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
btm_ble_resume_bg_conn();
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
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,12 +732,13 @@ 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();
|
||||
|
||||
}
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_resume_bg_conn
|
||||
@@ -759,6 +768,8 @@ BOOLEAN btm_ble_resume_bg_conn(void)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_get_conn_st
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "common/bt_target.h"
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
#if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
#include "stack/bt_types.h"
|
||||
#include "stack/hcimsgs.h"
|
||||
#include "stack/btu.h"
|
||||
@@ -104,5 +105,6 @@ tBTM_STATUS BTM_BleGetEnergyInfo(tBTM_BLE_ENERGY_INFO_CBACK *p_ener_cback)
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENERGY_INFO_EN == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -76,15 +76,19 @@ 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,
|
||||
tBLE_ADDR_TYPE *p_own_addr_type);
|
||||
static void btm_ble_stop_observe(void);
|
||||
static void btm_ble_stop_discover(void);
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
static void btm_adv_pkt_handler(void *arg);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *cb);
|
||||
|
||||
#define BTM_BLE_INQ_RESULT 0x01
|
||||
@@ -246,56 +250,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 +405,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 +433,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 +541,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 +565,7 @@ tBTM_STATUS BTM_BleObserve(BOOLEAN start, UINT32 duration,
|
||||
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleScan
|
||||
@@ -612,7 +643,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 +704,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
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -723,11 +756,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();
|
||||
}
|
||||
@@ -905,9 +938,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()) {
|
||||
@@ -1145,6 +1180,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
|
||||
@@ -1159,6 +1195,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
|
||||
/*******************************************************************************
|
||||
@@ -1297,7 +1334,9 @@ void BTM_BleClearBgConnDev(void)
|
||||
{
|
||||
btm_ble_start_auto_conn(FALSE);
|
||||
btm_ble_clear_white_list(NULL);
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
gatt_reset_bgdev_list();
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -1320,7 +1359,7 @@ BOOLEAN BTM_BleUpdateBgConnDev(BOOLEAN add_remove, BD_ADDR remote_bda)
|
||||
BTM_TRACE_EVENT("%s() add=%d", __func__, add_remove);
|
||||
return btm_update_dev_to_white_list(add_remove, remote_bda, 0, NULL);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetConnectableMode
|
||||
@@ -1348,7 +1387,7 @@ tBTM_STATUS BTM_BleSetConnectableMode(tBTM_BLE_CONN_MODE connectable_mode)
|
||||
p_cb->directed_conn = connectable_mode;
|
||||
return btm_ble_set_connectability( p_cb->connectable_mode);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_set_conn_mode_adv_init_addr
|
||||
@@ -1441,76 +1480,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 +1575,7 @@ tBTM_STATUS BTM_BleStartAdv(void)
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleReadAdvParams
|
||||
@@ -1638,6 +1609,7 @@ void BTM_BleReadAdvParams (UINT16 *adv_int_min, UINT16 *adv_int_max,
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_HOST_BLE_SCAN_PARAM_UNUSED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleSetScanParams
|
||||
@@ -1696,7 +1668,9 @@ 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,
|
||||
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 +1726,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 +1803,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 +1870,7 @@ tBTM_STATUS BTM_UpdateBleDuplicateExceptionalList(uint8_t subcode, uint32_t type
|
||||
return status;
|
||||
}
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleWriteAdvData
|
||||
@@ -1944,38 +1921,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 +1946,7 @@ tBTM_STATUS BTM_BleWriteAdvDataRaw(UINT8 *p_raw_adv, UINT32 raw_adv_len)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2088,6 +2033,7 @@ BOOLEAN BTM_BleGetCurrentAddress(BD_ADDR addr, uint8_t *addr_type)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if ((BLE_42_SCAN_EN == TRUE) || (BLE_50_EXTEND_SCAN_EN == TRUE))
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_CheckAdvData
|
||||
@@ -2133,7 +2079,7 @@ UINT8 *BTM_CheckAdvData( UINT8 *p_adv, UINT16 adv_data_len, UINT8 type, UINT8 *p
|
||||
*p_length = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // #if ((BLE_42_SCAN_EN == TRUE) || (BLE_50_EXTEND_SCAN_EN == TRUE))
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM__BLEReadDiscoverability
|
||||
@@ -2171,16 +2117,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;
|
||||
}
|
||||
|
||||
@@ -2209,6 +2159,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
|
||||
@@ -2570,6 +2540,7 @@ void btm_ble_set_adv_flag(UINT16 connect_mode, UINT16 disc_mode)
|
||||
btm_ble_update_adv_flag(flag);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_set_discoverability
|
||||
@@ -2621,7 +2592,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 +2614,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) {
|
||||
@@ -2668,7 +2643,7 @@ tBTM_STATUS btm_ble_set_discoverability(UINT16 combined_mode)
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_set_connectability
|
||||
@@ -2716,7 +2691,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 +2713,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 +2780,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__);
|
||||
@@ -3510,6 +3491,7 @@ void btm_send_sel_conn_callback(BD_ADDR remote_bda, UINT8 evt_type, UINT8 *p_dat
|
||||
}
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
static void btm_adv_pkt_handler(void *arg)
|
||||
{
|
||||
UINT8 hci_evt_code, hci_evt_len;
|
||||
@@ -3552,6 +3534,7 @@ static void btm_adv_pkt_handler(void *arg)
|
||||
UNUSED(hci_evt_code);
|
||||
UNUSED(hci_evt_len);
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -3838,6 +3821,7 @@ static void btm_ble_process_adv_pkt_cont(BD_ADDR bda, UINT8 addr_type, UINT8 evt
|
||||
|
||||
void btm_ble_process_adv_discard_evt(UINT8 *p)
|
||||
{
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
#if (BLE_ADV_REPORT_FLOW_CONTROL == TRUE)
|
||||
uint32_t num_dis = 0;
|
||||
STREAM_TO_UINT32 (num_dis, p);
|
||||
@@ -3846,6 +3830,7 @@ void btm_ble_process_adv_discard_evt(UINT8 *p)
|
||||
(p_obs_discard_cb)(num_dis);
|
||||
}
|
||||
#endif
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
}
|
||||
|
||||
void btm_ble_process_direct_adv_pkt(UINT8 *p)
|
||||
@@ -3853,6 +3838,7 @@ void btm_ble_process_direct_adv_pkt(UINT8 *p)
|
||||
// TODO
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_start_scan
|
||||
@@ -3890,6 +3876,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 +3926,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 +3980,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);
|
||||
@@ -4017,6 +4007,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)
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -4029,6 +4020,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;
|
||||
@@ -4061,7 +4053,6 @@ static BOOLEAN btm_ble_adv_states_operation(BTM_TOPOLOGY_FUNC_PTR *p_handler, UI
|
||||
return rt;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_ble_start_adv
|
||||
@@ -4173,14 +4164,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);
|
||||
@@ -4189,7 +4185,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);
|
||||
@@ -4198,11 +4196,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);
|
||||
@@ -4211,7 +4211,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);
|
||||
@@ -4220,9 +4222,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;
|
||||
}
|
||||
@@ -4239,6 +4246,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) {
|
||||
@@ -4257,9 +4265,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)
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -4299,9 +4307,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;
|
||||
@@ -4523,7 +4533,9 @@ BOOLEAN btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 st
|
||||
now in order */
|
||||
if (btm_ble_get_conn_st() == BLE_CONN_IDLE && status != HCI_ERR_HOST_REJECT_RESOURCES &&
|
||||
!btm_send_pending_direct_conn()) {
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
bg_con = btm_ble_resume_bg_conn();
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
}
|
||||
|
||||
return bg_con;
|
||||
@@ -4574,16 +4586,18 @@ void btm_ble_init (void)
|
||||
p_cb->scan_int = p_cb->scan_win = BTM_BLE_SCAN_PARAM_UNDEF;
|
||||
|
||||
p_cb->inq_var.evt_type = BTM_BLE_NON_CONNECT_EVT;
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
p_cb->adv_rpt_queue = pkt_queue_create();
|
||||
assert(p_cb->adv_rpt_queue != NULL);
|
||||
|
||||
p_cb->adv_rpt_ready = osi_event_create(btm_adv_pkt_handler, NULL);
|
||||
assert(p_cb->adv_rpt_ready != NULL);
|
||||
osi_event_bind(p_cb->adv_rpt_ready, btu_get_current_thread(), 0);
|
||||
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#if BLE_VND_INCLUDED == FALSE
|
||||
#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
btm_ble_adv_filter_init();
|
||||
#endif // #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4603,13 +4617,13 @@ void btm_ble_free (void)
|
||||
BTM_TRACE_DEBUG("%s", __func__);
|
||||
|
||||
fixed_queue_free(p_cb->conn_pending_q, osi_free_func);
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
pkt_queue_destroy(p_cb->adv_rpt_queue, NULL);
|
||||
p_cb->adv_rpt_queue = NULL;
|
||||
|
||||
osi_event_delete(p_cb->adv_rpt_ready);
|
||||
p_cb->adv_rpt_ready = NULL;
|
||||
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#if BTM_DYNAMIC_MEMORY == TRUE
|
||||
osi_free(cmn_ble_gap_vsc_cb_ptr);
|
||||
cmn_ble_gap_vsc_cb_ptr = NULL;
|
||||
@@ -4778,6 +4792,7 @@ BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
bool btm_ble_adv_pkt_ready(void)
|
||||
{
|
||||
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
||||
@@ -4796,4 +4811,6 @@ bool btm_ble_adv_pkt_post(pkt_linked_item_t *pkt)
|
||||
pkt_queue_enqueue(p_cb->adv_rpt_queue, pkt);
|
||||
return true;
|
||||
}
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -683,20 +683,22 @@ 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();
|
||||
p_ble_cb->suspended_rl_state |= BTM_BLE_RL_SCAN;
|
||||
}
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (btm_ble_suspend_bg_conn()) {
|
||||
p_ble_cb->suspended_rl_state |= BTM_BLE_RL_INIT;
|
||||
}
|
||||
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -714,19 +716,21 @@ 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 (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (p_ble_cb->suspended_rl_state & BTM_BLE_RL_INIT) {
|
||||
btm_ble_resume_bg_conn();
|
||||
}
|
||||
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
p_ble_cb->suspended_rl_state = BTM_BLE_RL_IDLE;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,9 @@ void btm_dev_init (void)
|
||||
/* Initialize nonzero defaults */
|
||||
#if (BTM_MAX_LOC_BD_NAME_LEN > 0)
|
||||
memset(btm_cb.cfg.ble_bd_name, 0, sizeof(tBTM_LOC_BD_NAME));
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
memset(btm_cb.cfg.bredr_bd_name, 0, sizeof(tBTM_LOC_BD_NAME));
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#endif
|
||||
|
||||
btm_cb.devcb.reset_timer.param = (TIMER_PARAM_TYPE)TT_DEV_RESET;
|
||||
@@ -169,8 +171,12 @@ static void reset_complete(void)
|
||||
btm_cb.ble_ctr_cb.conn_state = BLE_CONN_IDLE;
|
||||
btm_cb.ble_ctr_cb.bg_conn_type = BTM_BLE_CONN_NONE;
|
||||
btm_cb.ble_ctr_cb.p_select_cback = NULL;
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
gatt_reset_bgdev_list();
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
#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();
|
||||
@@ -471,7 +477,7 @@ tBTM_STATUS BTM_SetLocalDeviceName (char *p_name, tBT_DEVICE_TYPE name_type)
|
||||
btm_cb.cfg.ble_bd_name[BTM_MAX_LOC_BD_NAME_LEN] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
if (name_type & BT_DEVICE_TYPE_BREDR) {
|
||||
p = (UINT8 *)btm_cb.cfg.bredr_bd_name;
|
||||
if (p != (UINT8 *)p_name) {
|
||||
@@ -479,6 +485,7 @@ tBTM_STATUS BTM_SetLocalDeviceName (char *p_name, tBT_DEVICE_TYPE name_type)
|
||||
btm_cb.cfg.bredr_bd_name[BTM_MAX_LOC_BD_NAME_LEN] = '\0';
|
||||
}
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#else
|
||||
p = (UINT8 *)p_name;
|
||||
#endif
|
||||
@@ -519,21 +526,22 @@ tBTM_STATUS BTM_ReadLocalDeviceName (char **p_name, tBT_DEVICE_TYPE name_type)
|
||||
*/
|
||||
|
||||
#if BTM_MAX_LOC_BD_NAME_LEN > 0
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
if ((name_type == BT_DEVICE_TYPE_DUMO) &&
|
||||
(BCM_STRNCMP_S(btm_cb.cfg.bredr_bd_name, btm_cb.cfg.ble_bd_name, BTM_MAX_LOC_BD_NAME_LEN) != 0)) {
|
||||
*p_name = NULL;
|
||||
BTM_TRACE_ERROR("Error, BLE and BREDR have different names, return NULL\n");
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
if (name_type & BT_DEVICE_TYPE_BLE) {
|
||||
*p_name = btm_cb.cfg.ble_bd_name;
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
if (name_type & BT_DEVICE_TYPE_BREDR) {
|
||||
*p_name = btm_cb.cfg.bredr_bd_name;
|
||||
}
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
return (BTM_SUCCESS);
|
||||
#else
|
||||
*p_name = NULL;
|
||||
@@ -752,9 +760,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);
|
||||
@@ -1074,6 +1079,7 @@ tBTM_STATUS BTM_WriteVoiceSettings(UINT16 settings)
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
#if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_EnableTestMode
|
||||
@@ -1130,6 +1136,7 @@ tBTM_STATUS BTM_EnableTestMode(void)
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
}
|
||||
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -39,7 +39,9 @@ tBTM_CB *btm_cb_ptr;
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
extern void btm_ble_extendadvcb_init(void);
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
extern void btm_ble_advrecod_init(void);
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -89,7 +91,9 @@ void btm_init (void)
|
||||
btm_sec_dev_init();
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
btm_ble_extendadvcb_init();
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
btm_ble_advrecod_init();
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -1720,7 +1720,7 @@ void BTM_RemoteOobDataReply(tBTM_STATUS res, BD_ADDR bd_addr, BT_OCTET16 c, BT_O
|
||||
btsnd_hcic_rem_oob_reply (bd_addr, c, r);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BuildOobData
|
||||
@@ -1745,8 +1745,10 @@ UINT16 BTM_BuildOobData(UINT8 *p_data, UINT16 max_len, BT_OCTET16 c,
|
||||
UINT8 *p = p_data;
|
||||
UINT16 len = 0;
|
||||
#if BTM_MAX_LOC_BD_NAME_LEN > 0
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
UINT16 name_size;
|
||||
UINT8 name_type = BTM_EIR_SHORTENED_LOCAL_NAME_TYPE;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#endif
|
||||
|
||||
if (p_data && max_len >= BTM_OOB_MANDATORY_SIZE) {
|
||||
@@ -1789,6 +1791,7 @@ UINT16 BTM_BuildOobData(UINT8 *p_data, UINT16 max_len, BT_OCTET16 c,
|
||||
max_len -= delta;
|
||||
}
|
||||
#if BTM_MAX_LOC_BD_NAME_LEN > 0
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
name_size = name_len;
|
||||
if (name_size > strlen(btm_cb.cfg.bredr_bd_name)) {
|
||||
name_type = BTM_EIR_COMPLETE_LOCAL_NAME_TYPE;
|
||||
@@ -1802,6 +1805,7 @@ UINT16 BTM_BuildOobData(UINT8 *p_data, UINT16 max_len, BT_OCTET16 c,
|
||||
len += delta;
|
||||
max_len -= delta;
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#endif
|
||||
/* update len */
|
||||
p = p_data;
|
||||
@@ -1871,6 +1875,7 @@ UINT8 *BTM_ReadOobData(UINT8 *p_data, UINT8 eir_tag, UINT8 *p_len)
|
||||
|
||||
return p_ret;
|
||||
}
|
||||
#endif
|
||||
#endif ///BTM_OOB_INCLUDED == TRUE && SMP_INCLUDED == TRUE
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
@@ -342,10 +342,10 @@ typedef struct {
|
||||
tBTM_INQ_RESULTS_CB *p_scan_results_cb;
|
||||
tBTM_CMPL_CB *p_scan_cmpl_cb;
|
||||
TIMER_LIST_ENT scan_timer_ent;
|
||||
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
struct pkt_queue *adv_rpt_queue;
|
||||
struct osi_event *adv_rpt_ready;
|
||||
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
/* background connection procedure cb value */
|
||||
tBTM_BLE_CONN_TYPE bg_conn_type;
|
||||
UINT32 scan_int;
|
||||
@@ -388,12 +388,14 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
void btm_ble_timeout(TIMER_LIST_ENT *p_tle);
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
void btm_ble_process_adv_pkt (UINT8 *p);
|
||||
void btm_ble_process_adv_discard_evt(UINT8 *p);
|
||||
void btm_ble_process_direct_adv_pkt (UINT8 *p);
|
||||
bool btm_ble_adv_pkt_ready(void);
|
||||
bool btm_ble_adv_pkt_post(pkt_linked_item_t *pkt);
|
||||
void btm_ble_proc_scan_rsp_rpt (UINT8 *p);
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
tBTM_STATUS btm_ble_read_remote_name(BD_ADDR remote_bda, tBTM_INQ_INFO *p_cur, tBTM_CMPL_CB *p_cb);
|
||||
BOOLEAN btm_ble_cancel_remote_name(BD_ADDR remote_bda);
|
||||
|
||||
@@ -409,7 +411,11 @@ void btm_ble_init (void);
|
||||
void btm_ble_free (void);
|
||||
void btm_ble_connected (UINT8 *bda, UINT16 handle, UINT8 enc_mode, UINT8 role, tBLE_ADDR_TYPE addr_type, BOOLEAN addr_matched);
|
||||
void btm_ble_read_remote_features_complete(UINT8 *p);
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
void btm_ble_write_adv_enable_complete(UINT8 *p);
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
|
||||
void btm_ble_conn_complete(UINT8 *p, UINT16 evt_len, BOOLEAN enhanced);
|
||||
void btm_read_ble_local_supported_states_complete(UINT8 *p, UINT16 evt_len);
|
||||
tBTM_BLE_CONN_ST btm_ble_get_conn_st(void);
|
||||
@@ -459,9 +465,12 @@ void btm_ble_remove_from_white_list_complete(UINT8 *p, UINT16 evt_len);
|
||||
void btm_ble_clear_white_list_complete(UINT8 *p, UINT16 evt_len);
|
||||
void btm_ble_white_list_init(UINT8 white_list_size);
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
/* background connection function */
|
||||
BOOLEAN btm_ble_suspend_bg_conn(void);
|
||||
BOOLEAN btm_ble_resume_bg_conn(void);
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
void btm_ble_initiate_select_conn(BD_ADDR bda);
|
||||
BOOLEAN btm_ble_start_auto_conn(BOOLEAN start);
|
||||
BOOLEAN btm_ble_start_select_conn(BOOLEAN start, tBTM_BLE_SEL_CBACK *p_select_cback);
|
||||
@@ -504,12 +513,14 @@ void btm_ble_add_default_entry_to_resolving_list(void);
|
||||
void btm_ble_set_privacy_mode_complete(UINT8 *p, UINT16 evt_len);
|
||||
#endif
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
void btm_ble_multi_adv_configure_rpa (tBTM_BLE_MULTI_ADV_INST *p_inst);
|
||||
void btm_ble_multi_adv_init(void);
|
||||
void *btm_ble_multi_adv_get_ref(UINT8 inst_id);
|
||||
void btm_ble_multi_adv_cleanup(void);
|
||||
void btm_ble_multi_adv_reenable(UINT8 inst_id);
|
||||
void btm_ble_multi_adv_enb_privacy(BOOLEAN enable);
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
char btm_ble_map_adv_tx_power(int tx_power_index);
|
||||
void btm_ble_batchscan_init(void);
|
||||
void btm_ble_batchscan_cleanup(void);
|
||||
|
||||
@@ -208,8 +208,10 @@ tBTM_ROLE_SWITCH_CMPL switch_role_ref_data;
|
||||
tBTM_CMPL_CB *p_switch_role_cb; /* Callback function to be called when */
|
||||
/* requested switch role is completed */
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
TIMER_LIST_ENT tx_power_timer;
|
||||
tBTM_CMPL_CB *p_tx_power_cmpl_cb;/* Callback function to be called */
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
#if CLASSIC_BT_INCLUDED == TRUE
|
||||
TIMER_LIST_ENT afh_channels_timer;
|
||||
@@ -724,14 +726,18 @@ struct tBTM_SEC_DEV_REC{
|
||||
*/
|
||||
typedef struct {
|
||||
#if BTM_MAX_LOC_BD_NAME_LEN > 0
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
tBTM_LOC_BD_NAME bredr_bd_name; /* local BREDR device name */
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
tBTM_LOC_BD_NAME ble_bd_name; /* local BLE device name */
|
||||
#endif
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
BOOLEAN pin_type; /* TRUE if PIN type is fixed */
|
||||
UINT8 pin_code_len; /* Bonding information */
|
||||
PIN_CODE pin_code; /* PIN CODE if pin type is fixed */
|
||||
BOOLEAN connectable; /* If TRUE page scan should be enabled */
|
||||
UINT8 def_inq_scan_mode; /* ??? limited/general/none */
|
||||
// BOOLEAN connectable; /* If TRUE page scan should be enabled */
|
||||
// UINT8 def_inq_scan_mode; /* ??? limited/general/none */
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
} tBTM_CFG;
|
||||
|
||||
enum {
|
||||
@@ -952,7 +958,7 @@ typedef struct {
|
||||
#endif // SMP_INCLUDED == TRUE || BT_CLASSIC_ENABLED == TRUE
|
||||
list_t *p_sec_dev_rec_list;
|
||||
tBTM_SEC_SERV_REC *p_out_serv;
|
||||
tBTM_MKEY_CALLBACK *mkey_cback;
|
||||
// tBTM_MKEY_CALLBACK *mkey_cback;
|
||||
|
||||
BD_ADDR connecting_bda;
|
||||
DEV_CLASS connecting_dc;
|
||||
|
||||
@@ -55,6 +55,7 @@ extern void btm_ble_test_command_complete(UINT8 *p);
|
||||
/********************************************************************************/
|
||||
/* L O C A L F U N C T I O N P R O T O T Y P E S */
|
||||
/********************************************************************************/
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_inquiry_comp_evt (UINT8 *p);
|
||||
static void btu_hcif_inquiry_result_evt (UINT8 *p);
|
||||
static void btu_hcif_inquiry_rssi_result_evt (UINT8 *p);
|
||||
@@ -62,30 +63,46 @@ static void btu_hcif_extended_inquiry_result_evt (UINT8 *p);
|
||||
|
||||
static void btu_hcif_connection_comp_evt (UINT8 *p);
|
||||
static void btu_hcif_connection_request_evt (UINT8 *p);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_disconnection_comp_evt (UINT8 *p);
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
static void btu_hcif_authentication_comp_evt (UINT8 *p);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_rmt_name_request_comp_evt (UINT8 *p, UINT16 evt_len);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
static void btu_hcif_encryption_change_evt (UINT8 *p);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_read_rmt_features_comp_evt (UINT8 *p);
|
||||
static void btu_hcif_read_rmt_ext_features_comp_evt (UINT8 *p);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_read_rmt_version_comp_evt (UINT8 *p);
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_qos_setup_comp_evt (UINT8 *p);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_command_complete_evt (BT_HDR *response, void *context);
|
||||
static void btu_hcif_command_status_evt (uint8_t status, BT_HDR *command, void *context);
|
||||
static void btu_hcif_hardware_error_evt (UINT8 *p);
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_flush_occured_evt (void);
|
||||
static void btu_hcif_role_change_evt (UINT8 *p);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_num_compl_data_pkts_evt (UINT8 *p);
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_mode_change_evt (UINT8 *p);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_pin_code_request_evt (UINT8 *p);
|
||||
static void btu_hcif_link_key_request_evt (UINT8 *p);
|
||||
static void btu_hcif_link_key_notification_evt (UINT8 *p);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_loopback_command_evt (void);
|
||||
static void btu_hcif_data_buf_overflow_evt (void);
|
||||
static void btu_hcif_max_slots_changed_evt (void);
|
||||
@@ -98,6 +115,8 @@ static void btu_hcif_esco_connection_comp_evt(UINT8 *p);
|
||||
static void btu_hcif_esco_connection_chg_evt(UINT8 *p);
|
||||
|
||||
static void btu_hcif_host_support_evt (UINT8 *p);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/* Simple Pairing Events */
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_io_cap_request_evt (UINT8 *p);
|
||||
@@ -111,12 +130,14 @@ static void btu_hcif_keypress_notif_evt (UINT8 *p);
|
||||
#if BTM_OOB_INCLUDED == TRUE && SMP_INCLUDED == TRUE
|
||||
static void btu_hcif_rem_oob_request_evt (UINT8 *p);
|
||||
#endif
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_link_supv_to_changed_evt (UINT8 *p);
|
||||
#if L2CAP_NON_FLUSHABLE_PB_INCLUDED == TRUE
|
||||
static void btu_hcif_enhanced_flush_complete_evt (void);
|
||||
#endif
|
||||
|
||||
static void btu_hcif_ssr_evt (UINT8 *p, UINT16 evt_len);
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
#if BLE_INCLUDED == TRUE
|
||||
static void btu_ble_ll_conn_complete_evt (UINT8 *p, UINT16 evt_len);
|
||||
@@ -136,30 +157,41 @@ 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)
|
||||
static void btu_ble_periodic_adv_sync_trans_recv(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
extern osi_sem_t adv_enable_sem;
|
||||
extern osi_sem_t adv_data_sem;
|
||||
extern osi_sem_t adv_param_sem;
|
||||
extern osi_sem_t scan_enable_sem;
|
||||
extern osi_sem_t scan_param_sem;
|
||||
extern uint8_t adv_enable_status;
|
||||
extern uint8_t adv_data_status;
|
||||
extern uint8_t adv_param_status;
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
extern osi_sem_t scan_enable_sem;
|
||||
extern osi_sem_t scan_param_sem;
|
||||
extern uint8_t scan_enable_status;
|
||||
extern uint8_t scan_param_status;
|
||||
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -183,6 +215,7 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
STREAM_TO_UINT8 (hci_evt_len, p);
|
||||
|
||||
switch (hci_evt_code) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_INQUIRY_COMP_EVT:
|
||||
btu_hcif_inquiry_comp_evt (p);
|
||||
break;
|
||||
@@ -201,6 +234,7 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
case HCI_CONNECTION_REQUEST_EVT:
|
||||
btu_hcif_connection_request_evt (p);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_DISCONNECTION_COMP_EVT:
|
||||
btu_hcif_disconnection_comp_evt (p);
|
||||
break;
|
||||
@@ -209,9 +243,11 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
btu_hcif_authentication_comp_evt (p);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
break;
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_RMT_NAME_REQUEST_COMP_EVT:
|
||||
btu_hcif_rmt_name_request_comp_evt (p, hci_evt_len);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_ENCRYPTION_CHANGE_EVT:
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
btu_hcif_encryption_change_evt (p);
|
||||
@@ -224,18 +260,22 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
break;
|
||||
#endif
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_READ_RMT_FEATURES_COMP_EVT:
|
||||
btu_hcif_read_rmt_features_comp_evt (p);
|
||||
break;
|
||||
case HCI_READ_RMT_EXT_FEATURES_COMP_EVT:
|
||||
btu_hcif_read_rmt_ext_features_comp_evt (p);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_READ_RMT_VERSION_COMP_EVT:
|
||||
btu_hcif_read_rmt_version_comp_evt (p);
|
||||
break;
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_QOS_SETUP_COMP_EVT:
|
||||
btu_hcif_qos_setup_comp_evt (p);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_COMMAND_COMPLETE_EVT:
|
||||
//HCI_TRACE_ERROR("%s should not have received a command complete event. "
|
||||
// "Someone didn't go through the hci transmit_command function.", __func__);
|
||||
@@ -247,19 +287,24 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
case HCI_HARDWARE_ERROR_EVT:
|
||||
btu_hcif_hardware_error_evt (p);
|
||||
break;
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_FLUSH_OCCURED_EVT:
|
||||
btu_hcif_flush_occured_evt ();
|
||||
break;
|
||||
case HCI_ROLE_CHANGE_EVT:
|
||||
btu_hcif_role_change_evt (p);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_NUM_COMPL_DATA_PKTS_EVT:
|
||||
btu_hcif_num_compl_data_pkts_evt (p);
|
||||
break;
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_MODE_CHANGE_EVT:
|
||||
btu_hcif_mode_change_evt (p);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_PIN_CODE_REQUEST_EVT:
|
||||
btu_hcif_pin_code_request_evt (p);
|
||||
break;
|
||||
@@ -269,7 +314,9 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
case HCI_LINK_KEY_NOTIFICATION_EVT:
|
||||
btu_hcif_link_key_notification_evt (p);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_LOOPBACK_COMMAND_EVT:
|
||||
btu_hcif_loopback_command_evt ();
|
||||
break;
|
||||
@@ -306,7 +353,6 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
case HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT:
|
||||
btu_hcif_host_support_evt (p);
|
||||
break;
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_IO_CAPABILITY_REQUEST_EVT:
|
||||
btu_hcif_io_cap_request_evt (p);
|
||||
break;
|
||||
@@ -335,7 +381,6 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
case HCI_KEYPRESS_NOTIFY_EVT:
|
||||
btu_hcif_keypress_notif_evt (p);
|
||||
break;
|
||||
#endif /* (CLASSIC_BT_INCLUDED == TRUE) */
|
||||
case HCI_LINK_SUPER_TOUT_CHANGED_EVT:
|
||||
btu_hcif_link_supv_to_changed_evt (p);
|
||||
break;
|
||||
@@ -344,6 +389,7 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
btu_hcif_enhanced_flush_complete_evt ();
|
||||
break;
|
||||
#endif
|
||||
#endif /* (CLASSIC_BT_INCLUDED == TRUE) */
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
case HCI_BLE_EVENT:
|
||||
@@ -389,10 +435,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 +451,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;
|
||||
@@ -561,7 +615,7 @@ void btu_hcif_send_host_rdy_for_data(void)
|
||||
btsnd_hcic_host_num_xmitted_pkts (num_ents, handles, num_pkts);
|
||||
}
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_inquiry_comp_evt
|
||||
@@ -689,7 +743,7 @@ static void btu_hcif_connection_request_evt (UINT8 *p)
|
||||
}
|
||||
#endif /* BTM_SCO_INCLUDED */
|
||||
}
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -738,6 +792,7 @@ static void btu_hcif_authentication_comp_evt (UINT8 *p)
|
||||
}
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_rmt_name_request_comp_evt
|
||||
@@ -762,7 +817,7 @@ static void btu_hcif_rmt_name_request_comp_evt (UINT8 *p, UINT16 evt_len)
|
||||
btm_sec_rmt_name_request_complete (bd_addr, p, status);
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
}
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -788,7 +843,7 @@ static void btu_hcif_encryption_change_evt (UINT8 *p)
|
||||
btm_sec_encrypt_change (handle, status, encr_enable);
|
||||
}
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_read_rmt_features_comp_evt
|
||||
@@ -827,6 +882,7 @@ static void btu_hcif_read_rmt_ext_features_comp_evt (UINT8 *p)
|
||||
btm_read_remote_ext_features_failed(status, handle);
|
||||
}
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -842,7 +898,7 @@ static void btu_hcif_read_rmt_version_comp_evt (UINT8 *p)
|
||||
btm_read_remote_version_complete (p);
|
||||
}
|
||||
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_qos_setup_comp_evt
|
||||
@@ -936,6 +992,7 @@ static void btu_hcif_esco_connection_chg_evt (UINT8 *p)
|
||||
rx_pkt_len, tx_pkt_len);
|
||||
#endif
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -951,6 +1008,7 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
{
|
||||
uint8_t status;
|
||||
switch (opcode) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_INQUIRY_CANCEL:
|
||||
/* Tell inquiry processing that we are done */
|
||||
btm_process_cancel_complete(HCI_SUCCESS, BTM_BR_INQUIRY_MASK);
|
||||
@@ -963,37 +1021,37 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
btm_delete_stored_link_key_complete (p);
|
||||
break;
|
||||
|
||||
case HCI_READ_LOCAL_NAME:
|
||||
btm_read_local_name_complete (p, evt_len);
|
||||
break;
|
||||
|
||||
case HCI_GET_LINK_QUALITY:
|
||||
btm_read_link_quality_complete (p);
|
||||
break;
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_READ_LOCAL_NAME:
|
||||
btm_read_local_name_complete (p, evt_len);
|
||||
break;
|
||||
case HCI_READ_RSSI:
|
||||
btm_read_rssi_complete (p);
|
||||
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;
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_CREATE_CONNECTION_CANCEL:
|
||||
btm_create_conn_cancel_complete(p);
|
||||
break;
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_READ_LOCAL_OOB_DATA:
|
||||
#if BTM_OOB_INCLUDED == TRUE && SMP_INCLUDED == TRUE
|
||||
btm_read_local_oob_complete(p);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_READ_INQ_TX_POWER_LEVEL:
|
||||
btm_read_linq_tx_power_complete (p);
|
||||
break;
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_SET_AFH_CHANNELS:
|
||||
btm_set_afh_channels_complete(p);
|
||||
break;
|
||||
@@ -1057,22 +1115,26 @@ 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;
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
case HCI_BLE_WRITE_ADV_ENABLE:
|
||||
btm_ble_write_adv_enable_complete(p);
|
||||
break;
|
||||
|
||||
#endif // #if (BLE_42_ADV_EN == TRUE)
|
||||
case HCI_BLE_CREATE_LL_CONN:
|
||||
btm_ble_create_ll_conn_complete(*p);
|
||||
break;
|
||||
|
||||
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 +1169,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 +1178,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 +1190,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 +1261,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 +1279,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 +1289,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;
|
||||
}
|
||||
@@ -1267,6 +1338,7 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
||||
#endif
|
||||
|
||||
switch (opcode) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_EXIT_SNIFF_MODE:
|
||||
case HCI_EXIT_PARK_MODE:
|
||||
#if BTM_SCO_WAKE_PARKED_LINK == TRUE
|
||||
@@ -1286,7 +1358,9 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
||||
case HCI_PARK_MODE:
|
||||
btm_pm_proc_cmd_status(status);
|
||||
break;
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#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 +1371,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;
|
||||
@@ -1503,7 +1578,7 @@ static void btu_hcif_hardware_error_evt (UINT8 *p)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_flush_occured_evt
|
||||
@@ -1540,7 +1615,7 @@ static void btu_hcif_role_change_evt (UINT8 *p)
|
||||
l2c_link_role_changed (bda, role, status);
|
||||
btm_acl_role_changed(status, bda, role);
|
||||
}
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1561,7 +1636,7 @@ static void btu_hcif_num_compl_data_pkts_evt (UINT8 *p)
|
||||
btm_sco_process_num_completed_pkts (p);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_mode_change_evt
|
||||
@@ -1629,7 +1704,7 @@ static void btu_hcif_ssr_evt (UINT8 *p, UINT16 evt_len)
|
||||
|
||||
HCI_TRACE_WARNING("hcif ssr evt: st 0x%x, hdl 0x%x, tx_lat %d rx_lat %d", status, handle, max_tx_lat, max_rx_lat);
|
||||
}
|
||||
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_pin_code_request_evt
|
||||
@@ -1640,6 +1715,7 @@ static void btu_hcif_ssr_evt (UINT8 *p, UINT16 evt_len)
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
static void btu_hcif_pin_code_request_evt (UINT8 *p)
|
||||
{
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
@@ -1694,9 +1770,10 @@ static void btu_hcif_link_key_notification_evt (UINT8 *p)
|
||||
|
||||
btm_sec_link_key_notification (bda, key, key_type);
|
||||
}
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_loopback_command_evt
|
||||
@@ -1872,7 +1949,7 @@ static void btu_hcif_host_support_evt (UINT8 *p)
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
static void btu_hcif_io_cap_request_evt (UINT8 *p)
|
||||
{
|
||||
btm_io_capabilities_req(p);
|
||||
@@ -1981,6 +2058,7 @@ static void btu_hcif_rem_oob_request_evt (UINT8 *p)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btu_hcif_link_supv_to_changed_evt
|
||||
@@ -2019,6 +2097,7 @@ static void btu_hcif_enhanced_flush_complete_evt (void)
|
||||
/* This is empty until an upper layer cares about returning event */
|
||||
}
|
||||
#endif
|
||||
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/**********************************************
|
||||
** End of Simple Pairing Events
|
||||
***********************************************/
|
||||
@@ -2138,6 +2217,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 +2238,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 +2322,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 +2397,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 +2441,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)
|
||||
{
|
||||
|
||||
@@ -254,17 +254,6 @@ UINT16 BTU_BleAclPktSize(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SCAN_QUEUE_CONGEST_CHECK
|
||||
bool BTU_check_queue_is_congest(void)
|
||||
{
|
||||
if (osi_thread_queue_wait_size(btu_thread, 0) >= BT_QUEUE_CONGEST_SIZE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
int get_btu_work_queue_size(void)
|
||||
{
|
||||
return osi_thread_queue_wait_size(btu_thread, 0);
|
||||
|
||||
@@ -229,11 +229,13 @@ bool btu_task_post(uint32_t sig, void *param, uint32_t timeout)
|
||||
break;
|
||||
case SIG_BTU_HCI_ADV_RPT_MSG:
|
||||
#if BLE_INCLUDED == TRUE
|
||||
#if (BLE_42_SCAN_EN == TRUE)
|
||||
if (param != NULL) {
|
||||
btm_ble_adv_pkt_post(param);
|
||||
}
|
||||
btm_ble_adv_pkt_ready();
|
||||
status = true;
|
||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||
#else
|
||||
osi_free(param);
|
||||
status = false;
|
||||
|
||||
@@ -75,7 +75,7 @@ UINT8 GATT_SetTraceLevel (UINT8 new_level)
|
||||
**
|
||||
** Function GATTS_AddHandleRange
|
||||
**
|
||||
** Description This function add the allocated handles range for the specifed
|
||||
** Description This function add the allocated handles range for the specified
|
||||
** application UUID, service UUID and service instance
|
||||
**
|
||||
** Parameter p_hndl_range: pointer to allocated handles information
|
||||
@@ -105,7 +105,7 @@ BOOLEAN GATTS_AddHandleRange(tGATTS_HNDL_RANGE *p_hndl_range)
|
||||
** NV save callback function. There can be one and only one
|
||||
** NV save callback function.
|
||||
**
|
||||
** Parameter p_cb_info : callback informaiton
|
||||
** Parameter p_cb_info : callback information
|
||||
**
|
||||
** Returns TRUE if registered OK, else FALSE
|
||||
**
|
||||
@@ -151,7 +151,7 @@ static void gatt_update_for_database_change(void)
|
||||
** num_handles : number of handles needed by the service.
|
||||
** is_pri : is a primary service or not.
|
||||
**
|
||||
** Returns service handle if sucessful, otherwise 0.
|
||||
** Returns service handle if successful, otherwise 0.
|
||||
**
|
||||
*******************************************************************************/
|
||||
UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid,
|
||||
@@ -170,7 +170,7 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid,
|
||||
GATT_TRACE_API ("GATTS_CreateService\n" );
|
||||
|
||||
if (p_reg == NULL) {
|
||||
GATT_TRACE_ERROR ("Inavlid gatt_if=%d\n", gatt_if);
|
||||
GATT_TRACE_ERROR ("Invalid gatt_if=%d\n", gatt_if);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ tGATT_STATUS GATTS_StartService (tGATT_IF gatt_if, UINT16 service_handle,
|
||||
return GATT_SERVICE_STARTED;
|
||||
}
|
||||
|
||||
/*this is a new application servoce start */
|
||||
/*this is a new application service start */
|
||||
if ((i_sreg = gatt_sr_alloc_rcb(p_list)) == GATT_MAX_SR_PROFILES) {
|
||||
GATT_TRACE_ERROR ("GATTS_StartService: no free server registration block");
|
||||
return GATT_NO_RESOURCES;
|
||||
@@ -1388,8 +1388,9 @@ void GATT_Deregister (tGATT_IF gatt_if)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
gatt_deregister_bgdev_list(gatt_if);
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
/* update the listen mode */
|
||||
#if (defined(BLE_PERIPHERAL_MODE_SUPPORT) && (BLE_PERIPHERAL_MODE_SUPPORT == TRUE))
|
||||
GATT_Listen(gatt_if, FALSE, NULL);
|
||||
@@ -1468,9 +1469,12 @@ BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_
|
||||
if (is_direct) {
|
||||
status = gatt_act_connect (p_reg, bd_addr, bd_addr_type, transport, is_aux);
|
||||
} else {
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (transport == BT_TRANSPORT_LE) {
|
||||
status = gatt_update_auto_connect_dev(gatt_if, TRUE, bd_addr, TRUE);
|
||||
} else {
|
||||
} else
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
{
|
||||
GATT_TRACE_ERROR("Unsupported transport for background connection");
|
||||
}
|
||||
}
|
||||
@@ -1483,7 +1487,7 @@ BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_
|
||||
**
|
||||
** Function GATT_CancelConnect
|
||||
**
|
||||
** Description This function terminate the connection initaition to a remote
|
||||
** Description This function terminate the connection initiation to a remote
|
||||
** device on GATT channel.
|
||||
**
|
||||
** Parameters gatt_if: client interface. If 0 used as unconditionally disconnect,
|
||||
@@ -1527,6 +1531,7 @@ BOOLEAN GATT_CancelConnect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct
|
||||
status = gatt_cancel_open(gatt_if, bd_addr);
|
||||
}
|
||||
} else {
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (!gatt_if) {
|
||||
if (gatt_get_num_apps_for_bg_dev(bd_addr)) {
|
||||
while (gatt_find_app_for_bg_dev(bd_addr, &temp_gatt_if)) {
|
||||
@@ -1539,6 +1544,7 @@ BOOLEAN GATT_CancelConnect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct
|
||||
} else {
|
||||
status = gatt_remove_bg_dev_for_app(gatt_if, bd_addr);
|
||||
}
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -1628,7 +1634,7 @@ tGATT_STATUS GATT_SendServiceChangeIndication (BD_ADDR bd_addr)
|
||||
**
|
||||
** Function GATT_GetConnectionInfor
|
||||
**
|
||||
** Description This function use conn_id to find its associated BD address and applciation
|
||||
** Description This function use conn_id to find its associated BD address and application
|
||||
** interface
|
||||
**
|
||||
** Parameters conn_id: connection id (input)
|
||||
@@ -1665,7 +1671,7 @@ BOOLEAN GATT_GetConnectionInfor(UINT16 conn_id, tGATT_IF *p_gatt_if, BD_ADDR bd_
|
||||
** Function GATT_GetConnIdIfConnected
|
||||
**
|
||||
** Description This function find the conn_id if the logical link for BD address
|
||||
** and applciation interface is connected
|
||||
** and application interface is connected
|
||||
**
|
||||
** Parameters gatt_if: application interface (input)
|
||||
** bd_addr: peer device address. (input)
|
||||
@@ -1720,7 +1726,9 @@ BOOLEAN GATT_Listen (tGATT_IF gatt_if, BOOLEAN start, BD_ADDR_PTR bd_addr)
|
||||
}
|
||||
|
||||
if (bd_addr != NULL) {
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
gatt_update_auto_connect_dev(gatt_if, start, bd_addr, FALSE);
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
} else {
|
||||
p_reg->listening = start ? GATT_LISTEN_TO_ALL : GATT_LISTEN_TO_NONE;
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ static void gatt_le_connect_cback (UINT16 chan, BD_ADDR bd_addr, BOOLEAN connect
|
||||
#endif ///GATTS_INCLUDED == TRUE
|
||||
}
|
||||
} else {
|
||||
GATT_TRACE_ERROR("CCB max out, no rsources");
|
||||
GATT_TRACE_ERROR("CCB max out, no resources");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -929,18 +929,23 @@ static void gatt_send_conn_cback(tGATT_TCB *p_tcb)
|
||||
{
|
||||
UINT8 i;
|
||||
tGATT_REG *p_reg;
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
tGATT_BG_CONN_DEV *p_bg_dev = NULL;
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
UINT16 conn_id;
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
p_bg_dev = gatt_find_bg_dev(p_tcb->peer_bda);
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
/* notifying all applications for the connection up event */
|
||||
for (i = 0, p_reg = gatt_cb.cl_rcb ; i < GATT_MAX_APPS; i++, p_reg++) {
|
||||
if (p_reg->in_use) {
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (p_bg_dev && gatt_is_bg_dev_for_app(p_bg_dev, p_reg->gatt_if)) {
|
||||
gatt_update_app_use_link_flag(p_reg->gatt_if, p_tcb, TRUE, TRUE);
|
||||
}
|
||||
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (p_reg->app_cb.p_conn_cb) {
|
||||
conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_reg->gatt_if);
|
||||
(*p_reg->app_cb.p_conn_cb)(p_reg->gatt_if, p_tcb->peer_bda, conn_id,
|
||||
|
||||
@@ -108,7 +108,7 @@ void gatt_free_pending_ind(tGATT_TCB *p_tcb)
|
||||
**
|
||||
** Function gatt_free_pending_enc_queue
|
||||
**
|
||||
** Description Free all buffers in pending encyption queue
|
||||
** Description Free all buffers in pending encryption queue
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
@@ -222,7 +222,7 @@ void gatt_set_srv_chg(void)
|
||||
**
|
||||
** Description Find the app id in on the new service changed list
|
||||
**
|
||||
** Returns Pointer to the found new service changed item othwerwise NULL
|
||||
** Returns Pointer to the found new service changed item otherwise NULL
|
||||
**
|
||||
*******************************************************************************/
|
||||
tGATTS_PENDING_NEW_SRV_START *gatt_sr_is_new_srv_chg(tBT_UUID *p_app_uuid128, tBT_UUID *p_svc_uuid, UINT16 svc_inst)
|
||||
@@ -299,7 +299,7 @@ tGATTS_PENDING_NEW_SRV_START *gatt_add_pending_new_srv_start(tGATTS_HNDL_RANGE *
|
||||
**
|
||||
** Function gatt_add_srv_chg_clt
|
||||
**
|
||||
** Description Add a service chnage client to the service change client queue
|
||||
** Description Add a service change client to the service change client queue
|
||||
**
|
||||
** Returns Pointer to the service change client buffer; Null no buffer available
|
||||
**
|
||||
@@ -682,7 +682,7 @@ BOOLEAN gatt_remove_a_srv_from_list(tGATT_SRV_LIST_INFO *p_list, tGATT_SRV_LIST_
|
||||
**
|
||||
** Function gatt_add_an_item_to_list
|
||||
**
|
||||
** Description add an service handle range to the list in decending
|
||||
** Description add an service handle range to the list in descending
|
||||
** order of the start handle
|
||||
**
|
||||
** Returns BOOLEAN TRUE-if add is successful
|
||||
@@ -808,7 +808,7 @@ BOOLEAN gatt_find_the_connected_bda(UINT8 start_idx, BD_ADDR bda, UINT8 *p_found
|
||||
**
|
||||
** Function gatt_is_srv_chg_ind_pending
|
||||
**
|
||||
** Description Check whether a service chnaged is in the indication pending queue
|
||||
** Description Check whether a service changed is in the indication pending queue
|
||||
** or waiting for an Ack already
|
||||
**
|
||||
** Returns BOOLEAN
|
||||
@@ -846,9 +846,9 @@ BOOLEAN gatt_is_srv_chg_ind_pending (tGATT_TCB *p_tcb)
|
||||
**
|
||||
** Function gatt_is_bda_in_the_srv_chg_clt_list
|
||||
**
|
||||
** Description This function check the specified bda is in the srv chg clinet list or not
|
||||
** Description This function check the specified bda is in the srv chg client list or not
|
||||
**
|
||||
** Returns pointer to the found elemenet otherwise NULL
|
||||
** Returns pointer to the found element otherwise NULL
|
||||
**
|
||||
*******************************************************************************/
|
||||
tGATTS_SRV_CHG *gatt_is_bda_in_the_srv_chg_clt_list (BD_ADDR bda)
|
||||
@@ -1205,7 +1205,7 @@ UINT8 gatt_build_uuid_to_stream(UINT8 **p_dst, tBT_UUID uuid)
|
||||
if (uuid.len == LEN_UUID_16) {
|
||||
UINT16_TO_STREAM (p, uuid.uu.uuid16);
|
||||
len = LEN_UUID_16;
|
||||
} else if (uuid.len == LEN_UUID_32) { /* always convert 32 bits into 128 bits as alwats */
|
||||
} else if (uuid.len == LEN_UUID_32) { /* always convert 32 bits into 128 bits as always */
|
||||
gatt_convert_uuid32_to_uuid128(p, uuid.uu.uuid32);
|
||||
p += LEN_UUID_128;
|
||||
len = LEN_UUID_128;
|
||||
@@ -1465,7 +1465,7 @@ UINT8 gatt_sr_alloc_rcb(tGATT_HDL_LIST_ELEM *p_list )
|
||||
UINT8 ii = 0;
|
||||
tGATT_SR_REG *p_sreg = NULL;
|
||||
|
||||
/*this is a new application servoce start */
|
||||
/*this is a new application service start */
|
||||
for (ii = 0, p_sreg = gatt_cb.sr_reg; ii < GATT_MAX_SR_PROFILES; ii++, p_sreg++) {
|
||||
if (!p_sreg->in_use) {
|
||||
memset (p_sreg, 0, sizeof(tGATT_SR_REG));
|
||||
@@ -1616,7 +1616,7 @@ UINT32 gatt_add_sdp_record (tBT_UUID *p_uuid, UINT16 start_hdl, UINT16 end_hdl)
|
||||
break;
|
||||
|
||||
default:
|
||||
GATT_TRACE_ERROR("inavlid UUID len=%d", p_uuid->len);
|
||||
GATT_TRACE_ERROR("invalid UUID len=%d", p_uuid->len);
|
||||
SDP_DeleteRecord(sdp_handle);
|
||||
return 0;
|
||||
break;
|
||||
@@ -1633,7 +1633,7 @@ UINT32 gatt_add_sdp_record (tBT_UUID *p_uuid, UINT16 start_hdl, UINT16 end_hdl)
|
||||
|
||||
SDP_AddProtocolList(sdp_handle, 2, proto_elem_list);
|
||||
|
||||
/* Make the service browseable */
|
||||
/* Make the service browsable */
|
||||
SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &list);
|
||||
|
||||
return (sdp_handle);
|
||||
@@ -1868,7 +1868,7 @@ UINT8 gatt_num_apps_hold_link(tGATT_TCB *p_tcb)
|
||||
**
|
||||
** Function gatt_num_clcb_by_bd_addr
|
||||
**
|
||||
** Description The function searches all LCB with macthing bd address
|
||||
** Description The function searches all LCB with matching bd address
|
||||
**
|
||||
** Returns total number of clcb found.
|
||||
**
|
||||
@@ -1892,7 +1892,7 @@ UINT8 gatt_num_clcb_by_bd_addr(BD_ADDR bda)
|
||||
**
|
||||
** Function gatt_sr_update_cback_cnt
|
||||
**
|
||||
** Description The function searches all LCB with macthing bd address
|
||||
** Description The function searches all LCB with matching bd address
|
||||
**
|
||||
** Returns total number of clcb found.
|
||||
**
|
||||
@@ -1916,7 +1916,7 @@ void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB *p_tcb )
|
||||
**
|
||||
** Function gatt_sr_is_cback_cnt_zero
|
||||
**
|
||||
** Description The function searches all LCB with macthing bd address
|
||||
** Description The function searches all LCB with matching bd address
|
||||
**
|
||||
** Returns True if thetotal application callback count is zero
|
||||
**
|
||||
@@ -2015,7 +2015,7 @@ void gatt_sr_reset_prep_cnt(tGATT_TCB *p_tcb )
|
||||
**
|
||||
** Function gatt_sr_update_cback_cnt
|
||||
**
|
||||
** Description Update the teh application callback count
|
||||
** Description Update the the application callback count
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
@@ -2045,7 +2045,7 @@ void gatt_sr_update_cback_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc
|
||||
**
|
||||
** Function gatt_sr_update_prep_cnt
|
||||
**
|
||||
** Description Update the teh prepare write request count
|
||||
** Description Update the the prepare write request count
|
||||
**
|
||||
** Returns None
|
||||
**
|
||||
@@ -2461,7 +2461,7 @@ void gatt_dbg_display_uuid(tBT_UUID bt_uuid)
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function gatt_is_bg_dev_for_app
|
||||
@@ -2552,7 +2552,7 @@ BOOLEAN gatt_add_bg_dev_list(tGATT_REG *p_reg, BD_ADDR bd_addr, BOOLEAN is_init
|
||||
for (i = 0; i < GATT_MAX_APPS; i ++) {
|
||||
if (is_initator) {
|
||||
if (p_dev->gatt_if[i] == gatt_if) {
|
||||
GATT_TRACE_ERROR("device already in iniator white list");
|
||||
GATT_TRACE_ERROR("device already in initiator white list");
|
||||
return TRUE;
|
||||
} else if (p_dev->gatt_if[i] == 0) {
|
||||
p_dev->gatt_if[i] = gatt_if;
|
||||
@@ -2618,9 +2618,9 @@ BOOLEAN gatt_remove_bg_dev_for_app(tGATT_IF gatt_if, BD_ADDR bd_addr)
|
||||
**
|
||||
** Function gatt_get_num_apps_for_bg_dev
|
||||
**
|
||||
** Description Gte the number of applciations for the specified background device
|
||||
** Description Gte the number of applications for the specified background device
|
||||
**
|
||||
** Returns UINT8 total number fo applications
|
||||
** Returns UINT8 total number for applications
|
||||
**
|
||||
*******************************************************************************/
|
||||
UINT8 gatt_get_num_apps_for_bg_dev(BD_ADDR bd_addr)
|
||||
@@ -2842,7 +2842,7 @@ BOOLEAN gatt_update_auto_connect_dev (tGATT_IF gatt_if, BOOLEAN add, BD_ADDR bd_
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
||||
@@ -130,7 +130,7 @@ typedef union {
|
||||
tGATT_EXEC_FLAG exec_write; /* execute write */
|
||||
} tGATT_CL_MSG;
|
||||
|
||||
/* error response strucutre */
|
||||
/* error response structure */
|
||||
typedef struct {
|
||||
UINT16 handle;
|
||||
UINT8 cmd_code;
|
||||
@@ -480,12 +480,14 @@ typedef struct {
|
||||
UINT32 service_change;
|
||||
} tGATT_SVC_CHG;
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
typedef struct {
|
||||
tGATT_IF gatt_if[GATT_MAX_APPS];
|
||||
tGATT_IF listen_gif[GATT_MAX_APPS];
|
||||
BD_ADDR remote_bda;
|
||||
BOOLEAN in_use;
|
||||
} tGATT_BG_CONN_DEV;
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
#define GATT_SVC_CHANGED_CONNECTING 1 /* wait for connection */
|
||||
#define GATT_SVC_CHANGED_SERVICE 2 /* GATT service discovery */
|
||||
@@ -553,8 +555,9 @@ typedef struct {
|
||||
|
||||
|
||||
tGATT_HDL_CFG hdl_cfg;
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
tGATT_BG_CONN_DEV bgconn_dev[GATT_MAX_BG_CONN_DEV];
|
||||
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
BOOLEAN auto_disc; /* internal use: true for auto discovering after connected */
|
||||
UINT8 srv_chg_mode; /* internal use: service change mode */
|
||||
tGATTS_RSP rsp; /* use to read internal service attribute */
|
||||
@@ -667,6 +670,7 @@ extern BOOLEAN gatt_add_an_item_to_list(tGATT_HDL_LIST_INFO *p_list, tGATT_HDL_L
|
||||
extern BOOLEAN gatt_remove_an_item_from_list(tGATT_HDL_LIST_INFO *p_list, tGATT_HDL_LIST_ELEM *p_remove);
|
||||
extern tGATTS_SRV_CHG *gatt_add_srv_chg_clt(tGATTS_SRV_CHG *p_srv_chg);
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
/* for background connection */
|
||||
extern BOOLEAN gatt_update_auto_connect_dev (tGATT_IF gatt_if, BOOLEAN add, BD_ADDR bd_addr, BOOLEAN is_initiator);
|
||||
extern BOOLEAN gatt_is_bg_dev_for_app(tGATT_BG_CONN_DEV *p_dev, tGATT_IF gatt_if);
|
||||
@@ -676,6 +680,7 @@ extern BOOLEAN gatt_find_app_for_bg_dev(BD_ADDR bd_addr, tGATT_IF *p_gatt_if);
|
||||
extern tGATT_BG_CONN_DEV *gatt_find_bg_dev(BD_ADDR remote_bda);
|
||||
extern void gatt_deregister_bgdev_list(tGATT_IF gatt_if);
|
||||
extern void gatt_reset_bgdev_list(void);
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
|
||||
/* server function */
|
||||
extern UINT8 gatt_sr_find_i_rcb_by_handle(UINT16 handle);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -3022,7 +3022,7 @@ tBTM_STATUS BTM_SwitchRole (BD_ADDR remote_bd_addr,
|
||||
//extern
|
||||
tBTM_STATUS BTM_ReadRSSI (BD_ADDR remote_bda, tBT_TRANSPORT transport, tBTM_CMPL_CB *p_cb);
|
||||
|
||||
|
||||
#if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_ReadTxPower
|
||||
@@ -3043,6 +3043,7 @@ tBTM_STATUS BTM_ReadTxPower (BD_ADDR remote_bda,
|
||||
tBT_TRANSPORT transport, tBTM_CMPL_CB *p_cb);
|
||||
|
||||
tBTM_STATUS BTM_BleReadAdvTxPower(tBTM_CMPL_CB *p_cb);
|
||||
#endif // #if (BLE_HOST_READ_TX_POWER_EN == TRUE)
|
||||
|
||||
void BTM_BleGetWhiteListSize(uint16_t *length);
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -395,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;
|
||||
@@ -499,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 */
|
||||
@@ -530,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;
|
||||
|
||||
@@ -944,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);
|
||||
@@ -961,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
|
||||
|
||||
@@ -1013,6 +1018,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,29 +1027,42 @@ 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
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_STOP_COMPLETE_EVT 15
|
||||
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT 16
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT 17
|
||||
#define BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT 18
|
||||
#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_EXTEND_SYNC_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,34 +1332,48 @@ 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;
|
||||
tBTM_BLE_PERIOD_ADV_STOP_CMPL per_adv_stop;
|
||||
#endif // #if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_CREATE_CMPL per_adv_sync_create;
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_CANCEL_CMPL per_adv_sync_cancel;
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_TEMINAT_CMPL per_adv_sync_term;
|
||||
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_EXTEND_SYNC_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 +1457,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 +1501,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
|
||||
@@ -1552,6 +1554,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
|
||||
@@ -1572,7 +1575,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)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1671,6 +1674,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
|
||||
@@ -1686,7 +1690,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
|
||||
@@ -1702,6 +1708,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)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2272,6 +2279,7 @@ BOOLEAN BTM_BleLocalPrivacyEnabled(void);
|
||||
//extern
|
||||
void BTM_BleEnableMixedPrivacyMode(BOOLEAN mixed_on);
|
||||
|
||||
#if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_BleMaxMultiAdvInstanceCount
|
||||
@@ -2283,6 +2291,7 @@ void BTM_BleEnableMixedPrivacyMode(BOOLEAN mixed_on);
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
UINT8 BTM_BleMaxMultiAdvInstanceCount(void);
|
||||
#endif // #if (BLE_HOST_BLE_MULTI_ADV_EN == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -2463,6 +2472,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 */
|
||||
/*******************************************************************************
|
||||
@@ -2535,6 +2545,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
|
||||
@@ -2789,12 +2801,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,
|
||||
|
||||
@@ -1073,11 +1073,11 @@ BOOLEAN l2cble_create_conn (tL2C_LCB *p_lcb)
|
||||
L2CAP_TRACE_WARNING ("L2CAP - LE - cannot start new connection at conn st: %d", conn_st);
|
||||
|
||||
btm_ble_enqueue_direct_conn_req(p_lcb);
|
||||
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (conn_st == BLE_BG_CONN) {
|
||||
btm_ble_suspend_bg_conn();
|
||||
}
|
||||
|
||||
#endif // #if (tGATT_BG_CONN_DEV == TRUE)
|
||||
rt = TRUE;
|
||||
}
|
||||
return rt;
|
||||
|
||||
@@ -368,9 +368,11 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
|
||||
BTM_Recovery_Pre_State();
|
||||
}
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
if(btm_ble_inter_get() && reason == HCI_ERR_CONN_FAILED_ESTABLISHMENT) {
|
||||
BTM_BleStartExtAdvRestart(handle);
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#endif ///BLE_INCLUDED == TRUE
|
||||
status = FALSE;
|
||||
@@ -483,19 +485,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