mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Merge branch 'bugfix/fix_some_ble_bug_v4.4' into 'release/v4.4'
Fixed some BLE bugs (backport v4.4) See merge request espressif/esp-idf!23301
This commit is contained in:
@ -502,7 +502,7 @@ int bt_le_update_white_list(struct bt_mesh_white_list *wl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (BTM_BleUpdateAdvWhitelist(wl->add_remove, wl->remote_bda,
|
if (BTM_BleUpdateAdvWhitelist(wl->add_remove, wl->remote_bda,
|
||||||
wl->addr_type, (tBTM_ADD_WHITELIST_CBACK *)wl->update_wl_comp_cb) == false) {
|
wl->addr_type, (tBTM_UPDATE_WHITELIST_CBACK *)wl->update_wl_comp_cb) == false) {
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,6 +391,19 @@ esp_err_t esp_ble_gap_set_device_name(const char *name)
|
|||||||
return esp_bt_dev_set_device_name(name);
|
return esp_bt_dev_set_device_name(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_gap_get_device_name(void)
|
||||||
|
{
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_GAP_BLE;
|
||||||
|
msg.act = BTC_GAP_BLE_ACT_GET_DEV_NAME;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
esp_err_t esp_ble_gap_get_local_used_addr(esp_bd_addr_t local_used_addr, uint8_t * addr_type)
|
esp_err_t esp_ble_gap_get_local_used_addr(esp_bd_addr_t local_used_addr, uint8_t * addr_type)
|
||||||
{
|
{
|
||||||
if(esp_bluedroid_get_status() != (ESP_BLUEDROID_STATUS_ENABLED)) {
|
if(esp_bluedroid_get_status() != (ESP_BLUEDROID_STATUS_ENABLED)) {
|
||||||
|
@ -135,7 +135,7 @@ typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capab
|
|||||||
|
|
||||||
/// GAP BLE callback event type
|
/// GAP BLE callback event type
|
||||||
typedef enum {
|
typedef enum {
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_42_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT = 0, /*!< When advertising data set complete, the event comes */
|
ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT = 0, /*!< When advertising data set complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< When scan response data set complete, the event comes */
|
ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< When scan response data set complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */
|
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */
|
||||||
@ -144,7 +144,7 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
|
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
|
||||||
ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */
|
ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */
|
ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */
|
||||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /*!< Authentication complete indication. */
|
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /*!< Authentication complete indication. */
|
||||||
ESP_GAP_BLE_KEY_EVT, /*!< BLE key event for peer device keys */
|
ESP_GAP_BLE_KEY_EVT, /*!< BLE key event for peer device keys */
|
||||||
ESP_GAP_BLE_SEC_REQ_EVT, /*!< BLE security request */
|
ESP_GAP_BLE_SEC_REQ_EVT, /*!< BLE security request */
|
||||||
@ -154,10 +154,10 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */
|
ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */
|
||||||
ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */
|
ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */
|
||||||
ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */
|
ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_42_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */
|
ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */
|
ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */
|
||||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT = 19, /*!< When set the static rand address complete, the event comes */
|
ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT = 19, /*!< When set the static rand address complete, the event comes */
|
||||||
ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT, /*!< When update connection parameters complete, the event comes */
|
ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT, /*!< When update connection parameters complete, the event comes */
|
||||||
ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT, /*!< When set pkt length complete, the event comes */
|
ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT, /*!< When set pkt length complete, the event comes */
|
||||||
@ -167,11 +167,11 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT, /*!< When get the bond device list complete, the event comes */
|
ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT, /*!< When get the bond device list complete, the event comes */
|
||||||
ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT, /*!< When read the rssi complete, the event comes */
|
ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT, /*!< When read the rssi complete, the event comes */
|
||||||
ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */
|
ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_42_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT, /*!< When update duplicate exceptional list complete, the event comes */
|
ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT, /*!< When update duplicate exceptional list complete, the event comes */
|
||||||
#endif //#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */
|
ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */
|
||||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
//BLE_50_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */
|
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */
|
||||||
ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */
|
ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */
|
||||||
ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */
|
ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */
|
||||||
@ -206,7 +206,10 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */
|
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */
|
||||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */
|
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */
|
||||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */
|
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */
|
||||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
|
ESP_GAP_BLE_SC_OOB_REQ_EVT, /*!< Secure Connection OOB request event */
|
||||||
|
ESP_GAP_BLE_SC_CR_LOC_OOB_EVT, /*!< Secure Connection create OOB data complete event */
|
||||||
|
ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT, /*!< When getting BT device name complete, the event comes */
|
||||||
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
||||||
} esp_gap_ble_cb_event_t;
|
} esp_gap_ble_cb_event_t;
|
||||||
|
|
||||||
@ -647,7 +650,9 @@ typedef enum {
|
|||||||
typedef enum{
|
typedef enum{
|
||||||
ESP_BLE_WHITELIST_REMOVE = 0X00, /*!< remove mac from whitelist */
|
ESP_BLE_WHITELIST_REMOVE = 0X00, /*!< remove mac from whitelist */
|
||||||
ESP_BLE_WHITELIST_ADD = 0X01, /*!< add address to whitelist */
|
ESP_BLE_WHITELIST_ADD = 0X01, /*!< add address to whitelist */
|
||||||
} esp_ble_wl_opration_t;
|
ESP_BLE_WHITELIST_CLEAR = 0x02, /*!< clear all device in whitelist */
|
||||||
|
} esp_ble_wl_operation_t;
|
||||||
|
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ESP_BLE_DUPLICATE_EXCEPTIONAL_LIST_ADD = 0, /*!< Add device info into duplicate scan exceptional list */
|
ESP_BLE_DUPLICATE_EXCEPTIONAL_LIST_ADD = 0, /*!< Add device info into duplicate scan exceptional list */
|
||||||
@ -910,6 +915,13 @@ typedef struct {
|
|||||||
* @brief Gap callback parameters union
|
* @brief Gap callback parameters union
|
||||||
*/
|
*/
|
||||||
typedef union {
|
typedef union {
|
||||||
|
/**
|
||||||
|
* @brief ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT
|
||||||
|
*/
|
||||||
|
struct ble_get_dev_name_cmpl_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate the get device name success status */
|
||||||
|
char *name; /*!< Name of bluetooth device */
|
||||||
|
} get_dev_name_cmpl; /*!< Event parameter of ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT */
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
/**
|
/**
|
||||||
* @brief ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
|
* @brief ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
|
||||||
@ -1053,7 +1065,7 @@ typedef union {
|
|||||||
*/
|
*/
|
||||||
struct ble_update_whitelist_cmpl_evt_param {
|
struct ble_update_whitelist_cmpl_evt_param {
|
||||||
esp_bt_status_t status; /*!< Indicate the add or remove whitelist operation success status */
|
esp_bt_status_t status; /*!< Indicate the add or remove whitelist operation success status */
|
||||||
esp_ble_wl_opration_t wl_opration; /*!< The value is ESP_BLE_WHITELIST_ADD if add address to whitelist operation success, ESP_BLE_WHITELIST_REMOVE if remove address from the whitelist operation success */
|
esp_ble_wl_operation_t wl_opration; /*!< The value is ESP_BLE_WHITELIST_ADD if add address to whitelist operation success, ESP_BLE_WHITELIST_REMOVE if remove address from the whitelist operation success */
|
||||||
} update_whitelist_cmpl; /*!< Event parameter of ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT */
|
} update_whitelist_cmpl; /*!< Event parameter of ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT */
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
/**
|
/**
|
||||||
@ -1537,7 +1549,17 @@ esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
|
|||||||
esp_err_t esp_ble_gap_set_device_name(const char *name);
|
esp_err_t esp_ble_gap_set_device_name(const char *name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function is called to get local used address and adress type.
|
* @brief Get device name of the local device
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_gap_get_device_name(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to get local used address and address type.
|
||||||
* uint8_t *esp_bt_dev_get_address(void) get the public address
|
* uint8_t *esp_bt_dev_get_address(void) get the public address
|
||||||
*
|
*
|
||||||
* @param[in] local_used_addr - current local used ble address (six bytes)
|
* @param[in] local_used_addr - current local used ble address (six bytes)
|
||||||
|
@ -673,6 +673,27 @@ void bta_dm_set_dev_name (tBTA_DM_MSG *p_data)
|
|||||||
#endif /// CLASSIC_BT_INCLUDED
|
#endif /// CLASSIC_BT_INCLUDED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function bta_dm_get_dev_name
|
||||||
|
**
|
||||||
|
** Description Gets local device name
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** Returns void
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
void bta_dm_get_dev_name (tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
tBTM_STATUS status;
|
||||||
|
char *name = NULL;
|
||||||
|
|
||||||
|
status = BTM_ReadLocalDeviceName(&name);
|
||||||
|
if (p_data->get_name.p_cback) {
|
||||||
|
(*p_data->get_name.p_cback)(status, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_dm_set_afh_channels
|
** Function bta_dm_set_afh_channels
|
||||||
@ -824,14 +845,14 @@ void bta_dm_ble_set_channels (tBTA_DM_MSG *p_data)
|
|||||||
void bta_dm_update_white_list(tBTA_DM_MSG *p_data)
|
void bta_dm_update_white_list(tBTA_DM_MSG *p_data)
|
||||||
{
|
{
|
||||||
#if (BLE_INCLUDED == TRUE)
|
#if (BLE_INCLUDED == TRUE)
|
||||||
BTM_BleUpdateAdvWhitelist(p_data->white_list.add_remove, p_data->white_list.remote_addr, p_data->white_list.addr_type, p_data->white_list.add_wl_cb);
|
BTM_BleUpdateAdvWhitelist(p_data->white_list.add_remove, p_data->white_list.remote_addr, p_data->white_list.addr_type, p_data->white_list.update_wl_cb);
|
||||||
#endif ///BLE_INCLUDED == TRUE
|
#endif ///BLE_INCLUDED == TRUE
|
||||||
}
|
}
|
||||||
|
|
||||||
void bta_dm_clear_white_list(tBTA_DM_MSG *p_data)
|
void bta_dm_clear_white_list(tBTA_DM_MSG *p_data)
|
||||||
{
|
{
|
||||||
#if (BLE_INCLUDED == TRUE)
|
#if (BLE_INCLUDED == TRUE)
|
||||||
BTM_BleClearWhitelist();
|
BTM_BleClearWhitelist(p_data->white_list.update_wl_cb);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,6 +181,27 @@ void BTA_DmSetDeviceName(const char *p_name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function BTA_DmGetDeviceName
|
||||||
|
**
|
||||||
|
** Description This function gets the Bluetooth name of local device
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** Returns void
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_GET_NAME *p_msg;
|
||||||
|
|
||||||
|
if ((p_msg = (tBTA_DM_API_GET_NAME *) osi_malloc(sizeof(tBTA_DM_API_GET_NAME))) != NULL) {
|
||||||
|
p_msg->hdr.event = BTA_DM_API_GET_NAME_EVT;
|
||||||
|
p_msg->p_cback = p_cback;
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
|
|
||||||
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
||||||
@ -303,26 +324,26 @@ void BTA_DmBleSetChannels(const uint8_t *channels, tBTA_CMPL_CB *set_channels_c
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBLE_ADDR_TYPE addr_type, tBTA_ADD_WHITELIST_CBACK *add_wl_cb)
|
void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBLE_ADDR_TYPE addr_type, tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||||
{
|
{
|
||||||
tBTA_DM_API_UPDATE_WHITE_LIST *p_msg;
|
tBTA_DM_API_UPDATE_WHITE_LIST *p_msg;
|
||||||
if ((p_msg = (tBTA_DM_API_UPDATE_WHITE_LIST *)osi_malloc(sizeof(tBTA_DM_API_UPDATE_WHITE_LIST))) != NULL) {
|
if ((p_msg = (tBTA_DM_API_UPDATE_WHITE_LIST *)osi_malloc(sizeof(tBTA_DM_API_UPDATE_WHITE_LIST))) != NULL) {
|
||||||
p_msg->hdr.event = BTA_DM_API_UPDATE_WHITE_LIST_EVT;
|
p_msg->hdr.event = BTA_DM_API_UPDATE_WHITE_LIST_EVT;
|
||||||
p_msg->add_remove = add_remove;
|
p_msg->add_remove = add_remove;
|
||||||
p_msg->addr_type = addr_type;
|
p_msg->addr_type = addr_type;
|
||||||
p_msg->add_wl_cb = add_wl_cb;
|
p_msg->update_wl_cb = update_wl_cb;
|
||||||
memcpy(p_msg->remote_addr, remote_addr, sizeof(BD_ADDR));
|
memcpy(p_msg->remote_addr, remote_addr, sizeof(BD_ADDR));
|
||||||
|
|
||||||
bta_sys_sendmsg(p_msg);
|
bta_sys_sendmsg(p_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTA_DmClearWhiteList(void)
|
void BTA_DmClearWhiteList(tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||||
{
|
{
|
||||||
tBTA_DM_API_ENABLE *p_msg;
|
tBTA_DM_API_UPDATE_WHITE_LIST *p_msg;
|
||||||
if ((p_msg = (tBTA_DM_API_ENABLE *)osi_malloc(sizeof(tBTA_DM_API_ENABLE))) != NULL) {
|
if ((p_msg = (tBTA_DM_API_UPDATE_WHITE_LIST *)osi_malloc(sizeof(tBTA_DM_API_UPDATE_WHITE_LIST))) != NULL) {
|
||||||
p_msg->hdr.event = BTA_DM_API_CLEAR_WHITE_LIST_EVT;
|
p_msg->hdr.event = BTA_DM_API_CLEAR_WHITE_LIST_EVT;
|
||||||
p_msg->p_sec_cback = NULL;
|
p_msg->update_wl_cb = update_wl_cb;
|
||||||
|
|
||||||
bta_sys_sendmsg(p_msg);
|
bta_sys_sendmsg(p_msg);
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
|||||||
bta_dm_enable, /* BTA_DM_API_ENABLE_EVT */
|
bta_dm_enable, /* BTA_DM_API_ENABLE_EVT */
|
||||||
bta_dm_disable, /* BTA_DM_API_DISABLE_EVT */
|
bta_dm_disable, /* BTA_DM_API_DISABLE_EVT */
|
||||||
bta_dm_set_dev_name, /* BTA_DM_API_SET_NAME_EVT */
|
bta_dm_set_dev_name, /* BTA_DM_API_SET_NAME_EVT */
|
||||||
|
bta_dm_get_dev_name, /* BTA_DM_API_GET_NAME_EVT */
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,6 +53,7 @@ enum {
|
|||||||
BTA_DM_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_DM),
|
BTA_DM_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_DM),
|
||||||
BTA_DM_API_DISABLE_EVT,
|
BTA_DM_API_DISABLE_EVT,
|
||||||
BTA_DM_API_SET_NAME_EVT,
|
BTA_DM_API_SET_NAME_EVT,
|
||||||
|
BTA_DM_API_GET_NAME_EVT,
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
BTA_DM_API_CONFIG_EIR_EVT,
|
BTA_DM_API_CONFIG_EIR_EVT,
|
||||||
#endif
|
#endif
|
||||||
@ -228,6 +229,11 @@ typedef struct {
|
|||||||
BD_NAME name; /* max 248 bytes name, plus must be Null terminated */
|
BD_NAME name; /* max 248 bytes name, plus must be Null terminated */
|
||||||
} tBTA_DM_API_SET_NAME;
|
} tBTA_DM_API_SET_NAME;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_GET_DEV_NAME_CBACK *p_cback;
|
||||||
|
} tBTA_DM_API_GET_NAME;
|
||||||
|
|
||||||
/* data type for BTA_DM_API_CONFIG_EIR_EVT */
|
/* data type for BTA_DM_API_CONFIG_EIR_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BT_HDR hdr;
|
BT_HDR hdr;
|
||||||
@ -271,7 +277,7 @@ typedef struct {
|
|||||||
BOOLEAN add_remove;
|
BOOLEAN add_remove;
|
||||||
BD_ADDR remote_addr;
|
BD_ADDR remote_addr;
|
||||||
tBLE_ADDR_TYPE addr_type;
|
tBLE_ADDR_TYPE addr_type;
|
||||||
tBTA_ADD_WHITELIST_CBACK *add_wl_cb;
|
tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb;
|
||||||
}tBTA_DM_API_UPDATE_WHITE_LIST;
|
}tBTA_DM_API_UPDATE_WHITE_LIST;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -1014,6 +1020,7 @@ typedef union {
|
|||||||
tBTA_DM_API_ENABLE enable;
|
tBTA_DM_API_ENABLE enable;
|
||||||
|
|
||||||
tBTA_DM_API_SET_NAME set_name;
|
tBTA_DM_API_SET_NAME set_name;
|
||||||
|
tBTA_DM_API_GET_NAME get_name;
|
||||||
tBTA_DM_API_CONFIG_EIR config_eir;
|
tBTA_DM_API_CONFIG_EIR config_eir;
|
||||||
|
|
||||||
tBTA_DM_API_SET_AFH_CHANNELS set_afh_channels;
|
tBTA_DM_API_SET_AFH_CHANNELS set_afh_channels;
|
||||||
@ -1507,6 +1514,7 @@ extern void bta_dm_search_sm_disable( void );
|
|||||||
extern void bta_dm_enable (tBTA_DM_MSG *p_data);
|
extern void bta_dm_enable (tBTA_DM_MSG *p_data);
|
||||||
extern void bta_dm_disable (tBTA_DM_MSG *p_data);
|
extern void bta_dm_disable (tBTA_DM_MSG *p_data);
|
||||||
extern void bta_dm_set_dev_name (tBTA_DM_MSG *p_data);
|
extern void bta_dm_set_dev_name (tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_get_dev_name (tBTA_DM_MSG *p_data);
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
extern void bta_dm_config_eir (tBTA_DM_MSG *p_data);
|
extern void bta_dm_config_eir (tBTA_DM_MSG *p_data);
|
||||||
#endif
|
#endif
|
||||||
|
@ -517,8 +517,8 @@ void bta_gattc_co_get_addr_list(BD_ADDR *addr_list)
|
|||||||
void bta_gattc_co_cache_addr_save(BD_ADDR bd_addr, hash_key_t hash_key)
|
void bta_gattc_co_cache_addr_save(BD_ADDR bd_addr, hash_key_t hash_key)
|
||||||
{
|
{
|
||||||
esp_err_t err_code;
|
esp_err_t err_code;
|
||||||
UINT8 num = ++cache_env->num_addr;
|
|
||||||
UINT8 index = 0;
|
UINT8 index = 0;
|
||||||
|
UINT8 new_index = cache_env->num_addr;
|
||||||
UINT8 *p_buf = osi_malloc(MAX_ADDR_LIST_CACHE_BUF);
|
UINT8 *p_buf = osi_malloc(MAX_ADDR_LIST_CACHE_BUF);
|
||||||
// check the address list has the same hash key or not
|
// check the address list has the same hash key or not
|
||||||
if (bta_gattc_co_find_hash_in_cache(hash_key) != INVALID_ADDR_NUM) {
|
if (bta_gattc_co_find_hash_in_cache(hash_key) != INVALID_ADDR_NUM) {
|
||||||
@ -530,20 +530,22 @@ void bta_gattc_co_cache_addr_save(BD_ADDR bd_addr, hash_key_t hash_key)
|
|||||||
memcpy(cache_env->cache_addr[index].hash_key, hash_key, sizeof(hash_key_t));
|
memcpy(cache_env->cache_addr[index].hash_key, hash_key, sizeof(hash_key_t));
|
||||||
} else {
|
} else {
|
||||||
//if the bd_addr didn't in the address list, added the bd_addr to the last of the address list.
|
//if the bd_addr didn't in the address list, added the bd_addr to the last of the address list.
|
||||||
memcpy(cache_env->cache_addr[num - 1].hash_key, hash_key, sizeof(hash_key_t));
|
memcpy(cache_env->cache_addr[new_index].hash_key, hash_key, sizeof(hash_key_t));
|
||||||
memcpy(cache_env->cache_addr[num - 1].addr, bd_addr, sizeof(BD_ADDR));
|
memcpy(cache_env->cache_addr[new_index].addr, bd_addr, sizeof(BD_ADDR));
|
||||||
|
cache_env->num_addr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
APPL_TRACE_DEBUG("%s(), num = %d", __func__, num);
|
APPL_TRACE_DEBUG("%s(), num = %d", __func__, new_index + 1);
|
||||||
memcpy(cache_env->cache_addr[num - 1].addr, bd_addr, sizeof(BD_ADDR));
|
memcpy(cache_env->cache_addr[new_index].addr, bd_addr, sizeof(BD_ADDR));
|
||||||
memcpy(cache_env->cache_addr[num - 1].hash_key, hash_key, sizeof(hash_key_t));
|
memcpy(cache_env->cache_addr[new_index].hash_key, hash_key, sizeof(hash_key_t));
|
||||||
|
cache_env->num_addr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
nvs_handle_t *fp = &cache_env->addr_fp;
|
nvs_handle_t *fp = &cache_env->addr_fp;
|
||||||
UINT16 length = num*(sizeof(BD_ADDR) + sizeof(hash_key_t));
|
UINT16 length = cache_env->num_addr * (sizeof(BD_ADDR) + sizeof(hash_key_t));
|
||||||
|
|
||||||
for (UINT8 i = 0; i < num; i++) {
|
for (UINT8 i = 0; i < cache_env->num_addr; i++) {
|
||||||
//copy the address to the buffer.
|
//copy the address to the buffer.
|
||||||
memcpy(p_buf + i*(sizeof(BD_ADDR) + sizeof(hash_key_t)), cache_env->cache_addr[i].addr, sizeof(BD_ADDR));
|
memcpy(p_buf + i*(sizeof(BD_ADDR) + sizeof(hash_key_t)), cache_env->cache_addr[i].addr, sizeof(BD_ADDR));
|
||||||
//copy the hash key to the buffer.
|
//copy the hash key to the buffer.
|
||||||
|
@ -176,6 +176,8 @@ typedef struct {
|
|||||||
|
|
||||||
typedef UINT16 tBTA_SEC;
|
typedef UINT16 tBTA_SEC;
|
||||||
|
|
||||||
|
typedef tBTM_GET_DEV_NAME_CBACK tBTA_GET_DEV_NAME_CBACK;
|
||||||
|
|
||||||
/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
|
/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
|
||||||
#define BTA_DM_IGNORE 0x00FF
|
#define BTA_DM_IGNORE 0x00FF
|
||||||
|
|
||||||
@ -418,7 +420,7 @@ typedef tBTM_START_ADV_CMPL_CBACK tBTA_START_ADV_CMPL_CBACK;
|
|||||||
|
|
||||||
typedef tBTM_START_STOP_ADV_CMPL_CBACK tBTA_START_STOP_ADV_CMPL_CBACK;
|
typedef tBTM_START_STOP_ADV_CMPL_CBACK tBTA_START_STOP_ADV_CMPL_CBACK;
|
||||||
|
|
||||||
typedef tBTM_ADD_WHITELIST_CBACK tBTA_ADD_WHITELIST_CBACK;
|
typedef tBTM_UPDATE_WHITELIST_CBACK tBTA_UPDATE_WHITELIST_CBACK;
|
||||||
|
|
||||||
typedef tBTM_SET_PKT_DATA_LENGTH_CBACK tBTA_SET_PKT_DATA_LENGTH_CBACK;
|
typedef tBTM_SET_PKT_DATA_LENGTH_CBACK tBTA_SET_PKT_DATA_LENGTH_CBACK;
|
||||||
|
|
||||||
@ -1672,6 +1674,18 @@ extern void BTA_DisableTestMode(void);
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
extern void BTA_DmSetDeviceName(const char *p_name);
|
extern void BTA_DmSetDeviceName(const char *p_name);
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function BTA_DmGetDeviceName
|
||||||
|
**
|
||||||
|
** Description This function gets the Bluetooth name of the local device.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** Returns void
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
extern void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function BTA_DmGetRemoteName
|
** Function BTA_DmGetRemoteName
|
||||||
@ -1735,9 +1749,9 @@ void BTA_DmSetQos(BD_ADDR bd_addr, UINT32 t_poll, tBTM_CMPL_CB *p_cb);
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void BTA_DmBleSetChannels(const uint8_t *channels, tBTA_CMPL_CB *set_channels_cb);
|
void BTA_DmBleSetChannels(const uint8_t *channels, tBTA_CMPL_CB *set_channels_cb);
|
||||||
|
|
||||||
extern void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBLE_ADDR_TYPE addr_type, tBTA_ADD_WHITELIST_CBACK *add_wl_cb);
|
extern void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBLE_ADDR_TYPE addr_type, tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb);
|
||||||
|
|
||||||
extern void BTA_DmClearWhiteList(void);
|
extern void BTA_DmClearWhiteList(tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb);
|
||||||
|
|
||||||
extern void BTA_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb);
|
extern void BTA_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb);
|
||||||
#endif ///BLE_INCLUDED == TRUE
|
#endif ///BLE_INCLUDED == TRUE
|
||||||
|
@ -70,6 +70,33 @@ static inline void btc_gap_ble_cb_to_app(esp_gap_ble_cb_event_t event, esp_ble_g
|
|||||||
btc_gap_ble_cb(event, param);
|
btc_gap_ble_cb(event, param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void btc_gap_ble_get_dev_name_callback(UINT8 status, char *name)
|
||||||
|
{
|
||||||
|
esp_ble_gap_cb_param_t param;
|
||||||
|
bt_status_t ret;
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
|
||||||
|
memset(¶m, 0, sizeof(esp_ble_gap_cb_param_t));
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CB;
|
||||||
|
msg.pid = BTC_PID_GAP_BLE;
|
||||||
|
msg.act = ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT;
|
||||||
|
|
||||||
|
param.get_dev_name_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||||
|
param.get_dev_name_cmpl.name = (char *)osi_malloc(BTC_MAX_LOC_BD_NAME_LEN + 1);
|
||||||
|
if (param.get_dev_name_cmpl.name) {
|
||||||
|
BCM_STRNCPY_S(param.get_dev_name_cmpl.name, name, BTC_MAX_LOC_BD_NAME_LEN + 1);
|
||||||
|
} else {
|
||||||
|
param.get_dev_name_cmpl.status = ESP_BT_STATUS_NOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||||
|
if (ret != BT_STATUS_SUCCESS) {
|
||||||
|
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
static void btc_gap_adv_point_cleanup(void **buf)
|
static void btc_gap_adv_point_cleanup(void **buf)
|
||||||
{
|
{
|
||||||
@ -784,7 +811,7 @@ static void btc_gap_ble_set_channels_cmpl_callback(void *p_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void btc_add_whitelist_complete_callback(UINT8 status, tBTM_WL_OPERATION wl_opration)
|
static void btc_update_whitelist_complete_callback(UINT8 status, tBTM_WL_OPERATION wl_opration)
|
||||||
{
|
{
|
||||||
esp_ble_gap_cb_param_t param;
|
esp_ble_gap_cb_param_t param;
|
||||||
bt_status_t ret;
|
bt_status_t ret;
|
||||||
@ -1473,6 +1500,13 @@ void btc_gap_ble_cb_deep_free(btc_msg_t *msg)
|
|||||||
{
|
{
|
||||||
BTC_TRACE_DEBUG("%s", __func__);
|
BTC_TRACE_DEBUG("%s", __func__);
|
||||||
switch (msg->act) {
|
switch (msg->act) {
|
||||||
|
case ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT: {
|
||||||
|
char *value = ((esp_ble_gap_cb_param_t *)msg->arg)->get_dev_name_cmpl.name;
|
||||||
|
if (value) {
|
||||||
|
osi_free(value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
BTC_TRACE_DEBUG("Unhandled deep free %d", msg->act);
|
BTC_TRACE_DEBUG("Unhandled deep free %d", msg->act);
|
||||||
break;
|
break;
|
||||||
@ -1541,10 +1575,10 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
|||||||
btc_ble_config_local_icon(arg->cfg_local_icon.icon);
|
btc_ble_config_local_icon(arg->cfg_local_icon.icon);
|
||||||
break;
|
break;
|
||||||
case BTC_GAP_BLE_ACT_UPDATE_WHITE_LIST:
|
case BTC_GAP_BLE_ACT_UPDATE_WHITE_LIST:
|
||||||
BTA_DmUpdateWhiteList(arg->update_white_list.add_remove, arg->update_white_list.remote_bda, arg->update_white_list.wl_addr_type, btc_add_whitelist_complete_callback);
|
BTA_DmUpdateWhiteList(arg->update_white_list.add_remove, arg->update_white_list.remote_bda, arg->update_white_list.wl_addr_type, btc_update_whitelist_complete_callback);
|
||||||
break;
|
break;
|
||||||
case BTC_GAP_BLE_ACT_CLEAR_WHITE_LIST:
|
case BTC_GAP_BLE_ACT_CLEAR_WHITE_LIST:
|
||||||
BTA_DmClearWhiteList();
|
BTA_DmClearWhiteList(btc_update_whitelist_complete_callback);
|
||||||
break;
|
break;
|
||||||
case BTC_GAP_BLE_ACT_READ_RSSI:
|
case BTC_GAP_BLE_ACT_READ_RSSI:
|
||||||
BTA_DmReadRSSI(arg->read_rssi.remote_addr, BTA_TRANSPORT_LE, btc_read_ble_rssi_cmpl_callback);
|
BTA_DmReadRSSI(arg->read_rssi.remote_addr, BTA_TRANSPORT_LE, btc_read_ble_rssi_cmpl_callback);
|
||||||
@ -1559,6 +1593,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
|||||||
case BTC_GAP_BLE_ACT_SET_DEV_NAME:
|
case BTC_GAP_BLE_ACT_SET_DEV_NAME:
|
||||||
BTA_DmSetDeviceName(arg->set_dev_name.device_name);
|
BTA_DmSetDeviceName(arg->set_dev_name.device_name);
|
||||||
break;
|
break;
|
||||||
|
case BTC_GAP_BLE_ACT_GET_DEV_NAME:
|
||||||
|
BTA_DmGetDeviceName(btc_gap_ble_get_dev_name_callback);
|
||||||
|
break;
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
case BTC_GAP_BLE_ACT_CFG_ADV_DATA_RAW:
|
case BTC_GAP_BLE_ACT_CFG_ADV_DATA_RAW:
|
||||||
btc_ble_set_adv_data_raw(arg->cfg_adv_data_raw.raw_adv,
|
btc_ble_set_adv_data_raw(arg->cfg_adv_data_raw.raw_adv,
|
||||||
|
@ -91,6 +91,7 @@ typedef enum {
|
|||||||
BTC_GAP_BLE_STOP_EXT_SCAN,
|
BTC_GAP_BLE_STOP_EXT_SCAN,
|
||||||
BTC_GAP_BLE_SET_EXT_PEFER_CONNET_PARAMS,
|
BTC_GAP_BLE_SET_EXT_PEFER_CONNET_PARAMS,
|
||||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
|
BTC_GAP_BLE_ACT_GET_DEV_NAME,
|
||||||
} btc_gap_ble_act_t;
|
} btc_gap_ble_act_t;
|
||||||
|
|
||||||
/* btc_ble_gap_args_t */
|
/* btc_ble_gap_args_t */
|
||||||
|
@ -276,12 +276,12 @@ void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE ad
|
|||||||
** the white list.
|
** the white list.
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBTM_ADD_WHITELIST_CBACK *add_wl_cb)
|
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||||
{
|
{
|
||||||
if(addr_type > BLE_ADDR_RANDOM) {
|
if(addr_type > BLE_ADDR_RANDOM) {
|
||||||
BTM_TRACE_ERROR("%s address type is error, unable to add device", __func__);
|
BTM_TRACE_ERROR("%s address type is error, unable to add device", __func__);
|
||||||
if (add_wl_cb){
|
if (update_wl_cb){
|
||||||
add_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
update_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -313,8 +313,8 @@ BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_
|
|||||||
// do nothing
|
// do nothing
|
||||||
} else {
|
} else {
|
||||||
BTC_TRACE_ERROR(" controller not support resolvable address");
|
BTC_TRACE_ERROR(" controller not support resolvable address");
|
||||||
if (add_wl_cb){
|
if (update_wl_cb){
|
||||||
add_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
update_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -325,8 +325,8 @@ BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_
|
|||||||
|
|
||||||
if (to_add && p_cb->white_list_avail_size == 0) {
|
if (to_add && p_cb->white_list_avail_size == 0) {
|
||||||
BTM_TRACE_ERROR("%s Whitelist full, unable to add device", __func__);
|
BTM_TRACE_ERROR("%s Whitelist full, unable to add device", __func__);
|
||||||
if (add_wl_cb){
|
if (update_wl_cb){
|
||||||
add_wl_cb(HCI_ERR_MEMORY_FULL,to_add);
|
update_wl_cb(HCI_ERR_MEMORY_FULL,to_add);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -335,8 +335,8 @@ BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_
|
|||||||
/* added the bd_addr to the connection hash map queue */
|
/* added the bd_addr to the connection hash map queue */
|
||||||
if(!background_connection_add((bt_bdaddr_t *)bd_addr)) {
|
if(!background_connection_add((bt_bdaddr_t *)bd_addr)) {
|
||||||
/* if the bd_addr already exist in whitelist, just callback return TRUE */
|
/* if the bd_addr already exist in whitelist, just callback return TRUE */
|
||||||
if (add_wl_cb){
|
if (update_wl_cb){
|
||||||
add_wl_cb(HCI_SUCCESS,to_add);
|
update_wl_cb(HCI_SUCCESS,to_add);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -344,16 +344,16 @@ BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_
|
|||||||
/* remove the bd_addr to the connection hash map queue */
|
/* remove the bd_addr to the connection hash map queue */
|
||||||
if(!background_connection_remove((bt_bdaddr_t *)bd_addr)){
|
if(!background_connection_remove((bt_bdaddr_t *)bd_addr)){
|
||||||
/* if the bd_addr don't exist in whitelist, just callback return TRUE */
|
/* if the bd_addr don't exist in whitelist, just callback return TRUE */
|
||||||
if (add_wl_cb){
|
if (update_wl_cb){
|
||||||
add_wl_cb(HCI_SUCCESS,to_add);
|
update_wl_cb(HCI_SUCCESS,to_add);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (add_wl_cb){
|
if (update_wl_cb){
|
||||||
//save add whitelist complete callback
|
//save add whitelist complete callback
|
||||||
p_cb->add_wl_cb = add_wl_cb;
|
p_cb->update_wl_cb = update_wl_cb;
|
||||||
}
|
}
|
||||||
/* stop the auto connect */
|
/* stop the auto connect */
|
||||||
btm_suspend_wl_activity(p_cb->wl_state);
|
btm_suspend_wl_activity(p_cb->wl_state);
|
||||||
@ -371,11 +371,17 @@ BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_
|
|||||||
** Description This function clears the white list.
|
** Description This function clears the white list.
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void btm_ble_clear_white_list (void)
|
void btm_ble_clear_white_list (tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||||
{
|
{
|
||||||
|
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
||||||
|
|
||||||
BTM_TRACE_EVENT ("btm_ble_clear_white_list");
|
BTM_TRACE_EVENT ("btm_ble_clear_white_list");
|
||||||
btsnd_hcic_ble_clear_white_list();
|
btsnd_hcic_ble_clear_white_list();
|
||||||
background_connections_clear();
|
background_connections_clear();
|
||||||
|
|
||||||
|
if (update_wl_cb) {
|
||||||
|
p_cb->update_wl_cb = update_wl_cb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -399,6 +405,10 @@ void btm_ble_clear_white_list_complete(UINT8 *p_data, UINT16 evt_len)
|
|||||||
} else {
|
} else {
|
||||||
BTM_TRACE_ERROR ("%s failed, status 0x%x\n", __func__, status);
|
BTM_TRACE_ERROR ("%s failed, status 0x%x\n", __func__, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_cb->update_wl_cb) {
|
||||||
|
(*p_cb->update_wl_cb)(status, BTM_WHITELIST_CLEAR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -429,9 +439,9 @@ void btm_ble_add_2_white_list_complete(UINT8 status)
|
|||||||
--btm_cb.ble_ctr_cb.white_list_avail_size;
|
--btm_cb.ble_ctr_cb.white_list_avail_size;
|
||||||
}
|
}
|
||||||
// add whitelist complete callback
|
// add whitelist complete callback
|
||||||
if (p_cb->add_wl_cb)
|
if (p_cb->update_wl_cb)
|
||||||
{
|
{
|
||||||
(*p_cb->add_wl_cb)(status, BTM_WHITELIST_ADD);
|
(*p_cb->update_wl_cb)(status, BTM_WHITELIST_ADD);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -451,9 +461,9 @@ void btm_ble_remove_from_white_list_complete(UINT8 *p, UINT16 evt_len)
|
|||||||
if (*p == HCI_SUCCESS) {
|
if (*p == HCI_SUCCESS) {
|
||||||
++btm_cb.ble_ctr_cb.white_list_avail_size;
|
++btm_cb.ble_ctr_cb.white_list_avail_size;
|
||||||
}
|
}
|
||||||
if (p_cb->add_wl_cb)
|
if (p_cb->update_wl_cb)
|
||||||
{
|
{
|
||||||
(*p_cb->add_wl_cb)(*p, BTM_WHITELIST_REMOVE);
|
(*p_cb->update_wl_cb)(*p, BTM_WHITELIST_REMOVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,9 +321,9 @@ void BTM_BleRegiseterConnParamCallback(tBTM_UPDATE_CONN_PARAM_CBACK *update_conn
|
|||||||
** Returns void
|
** Returns void
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR remote_bda, tBLE_ADDR_TYPE addr_type, tBTM_ADD_WHITELIST_CBACK *add_wl_cb)
|
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR remote_bda, tBLE_ADDR_TYPE addr_type, tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||||
{
|
{
|
||||||
return btm_update_dev_to_white_list(add_remove, remote_bda, addr_type, add_wl_cb);
|
return btm_update_dev_to_white_list(add_remove, remote_bda, addr_type, update_wl_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -335,9 +335,9 @@ BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR remote_bda, tBLE_A
|
|||||||
** Returns void
|
** Returns void
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void BTM_BleClearWhitelist(void)
|
void BTM_BleClearWhitelist(tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
|
||||||
{
|
{
|
||||||
btm_ble_clear_white_list();
|
btm_ble_clear_white_list(update_wl_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -869,7 +869,7 @@ BOOLEAN BTM_BleConfigPrivacy(BOOLEAN privacy_mode, tBTM_SET_LOCAL_PRIVACY_CBACK
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(p_cb->inq_var.state == BTM_BLE_STOP_SCAN || p_cb->inq_var.state == BTM_BLE_STOP_ADV || p_cb->inq_var.state == BTM_BLE_IDLE)) {
|
if (p_cb->inq_var.state != BTM_BLE_IDLE) {
|
||||||
BTM_TRACE_ERROR("Advertising or scaning now, can't set privacy ");
|
BTM_TRACE_ERROR("Advertising or scaning now, can't set privacy ");
|
||||||
if (random_cb && random_cb->set_local_privacy_cback){
|
if (random_cb && random_cb->set_local_privacy_cback){
|
||||||
(*random_cb->set_local_privacy_cback)(BTM_SET_PRIVACY_FAIL);
|
(*random_cb->set_local_privacy_cback)(BTM_SET_PRIVACY_FAIL);
|
||||||
@ -1273,7 +1273,7 @@ BOOLEAN BTM_BleSetBgConnType(tBTM_BLE_CONN_TYPE bg_conn_type,
|
|||||||
void BTM_BleClearBgConnDev(void)
|
void BTM_BleClearBgConnDev(void)
|
||||||
{
|
{
|
||||||
btm_ble_start_auto_conn(FALSE);
|
btm_ble_start_auto_conn(FALSE);
|
||||||
btm_ble_clear_white_list();
|
btm_ble_clear_white_list(NULL);
|
||||||
gatt_reset_bgdev_list();
|
gatt_reset_bgdev_list();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1997,7 +1997,7 @@ tBTM_STATUS BTM_BleSetRandAddress(BD_ADDR rand_addr)
|
|||||||
return BTM_SET_STATIC_RAND_ADDR_FAIL;
|
return BTM_SET_STATIC_RAND_ADDR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(btm_cb.ble_ctr_cb.inq_var.state == BTM_BLE_STOP_SCAN || btm_cb.ble_ctr_cb.inq_var.state == BTM_BLE_STOP_ADV || btm_cb.ble_ctr_cb.inq_var.state == BTM_BLE_IDLE)) {
|
if (btm_cb.ble_ctr_cb.inq_var.state != BTM_BLE_IDLE) {
|
||||||
BTM_TRACE_ERROR("Advertising or scaning now, can't set randaddress %d", btm_cb.ble_ctr_cb.inq_var.state);
|
BTM_TRACE_ERROR("Advertising or scaning now, can't set randaddress %d", btm_cb.ble_ctr_cb.inq_var.state);
|
||||||
return BTM_SET_STATIC_RAND_ADDR_FAIL;
|
return BTM_SET_STATIC_RAND_ADDR_FAIL;
|
||||||
}
|
}
|
||||||
@ -2026,7 +2026,7 @@ tBTM_STATUS BTM_BleSetRandAddress(BD_ADDR rand_addr)
|
|||||||
void BTM_BleClearRandAddress(void)
|
void BTM_BleClearRandAddress(void)
|
||||||
{
|
{
|
||||||
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
||||||
if (btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type == BLE_ADDR_RANDOM && (!(p_cb->inq_var.state == BTM_BLE_STOP_SCAN || p_cb->inq_var.state == BTM_BLE_STOP_ADV || p_cb->inq_var.state == BTM_BLE_IDLE))) {
|
if (btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type == BLE_ADDR_RANDOM && (p_cb->inq_var.state != BTM_BLE_IDLE)) {
|
||||||
BTM_TRACE_ERROR("Advertising or scaning now, can't restore public address ");
|
BTM_TRACE_ERROR("Advertising or scaning now, can't restore public address ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2142,10 +2142,11 @@ void BTM_Recovery_Pre_State(void)
|
|||||||
{
|
{
|
||||||
tBTM_BLE_INQ_CB *ble_inq_cb = &btm_cb.ble_ctr_cb.inq_var;
|
tBTM_BLE_INQ_CB *ble_inq_cb = &btm_cb.ble_ctr_cb.inq_var;
|
||||||
|
|
||||||
if (ble_inq_cb->state == BTM_BLE_ADVERTISING) {
|
if (ble_inq_cb->state & BTM_BLE_ADVERTISING) {
|
||||||
btm_ble_stop_adv();
|
btm_ble_stop_adv();
|
||||||
btm_ble_start_adv();
|
btm_ble_start_adv();
|
||||||
} else if (ble_inq_cb->state == BTM_BLE_SCANNING) {
|
}
|
||||||
|
if (ble_inq_cb->state & BTM_BLE_SCANNING) {
|
||||||
btm_ble_start_scan();
|
btm_ble_start_scan();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3842,7 +3843,7 @@ tBTM_STATUS btm_ble_start_scan(void)
|
|||||||
if(scan_enable_status != BTM_SUCCESS) {
|
if(scan_enable_status != BTM_SUCCESS) {
|
||||||
status = BTM_NO_RESOURCES;
|
status = BTM_NO_RESOURCES;
|
||||||
}
|
}
|
||||||
btm_cb.ble_ctr_cb.inq_var.state = BTM_BLE_SCANNING;
|
btm_cb.ble_ctr_cb.inq_var.state |= BTM_BLE_SCANNING;
|
||||||
if (p_inq->scan_type == BTM_BLE_SCAN_MODE_ACTI) {
|
if (p_inq->scan_type == BTM_BLE_SCAN_MODE_ACTI) {
|
||||||
btm_ble_set_topology_mask(BTM_BLE_STATE_ACTIVE_SCAN_BIT);
|
btm_ble_set_topology_mask(BTM_BLE_STATE_ACTIVE_SCAN_BIT);
|
||||||
} else {
|
} else {
|
||||||
@ -3868,7 +3869,7 @@ void btm_ble_stop_scan(void)
|
|||||||
|
|
||||||
/* Clear the inquiry callback if set */
|
/* Clear the inquiry callback if set */
|
||||||
btm_cb.ble_ctr_cb.inq_var.scan_type = BTM_BLE_SCAN_MODE_NONE;
|
btm_cb.ble_ctr_cb.inq_var.scan_type = BTM_BLE_SCAN_MODE_NONE;
|
||||||
btm_cb.ble_ctr_cb.inq_var.state = BTM_BLE_STOP_SCAN;
|
btm_cb.ble_ctr_cb.inq_var.state &= ~BTM_BLE_SCANNING;
|
||||||
/* stop discovery now */
|
/* stop discovery now */
|
||||||
btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_DUPLICATE_ENABLE);
|
btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_DUPLICATE_ENABLE);
|
||||||
|
|
||||||
@ -3966,7 +3967,7 @@ static void btm_ble_stop_discover(void)
|
|||||||
if (!BTM_BLE_IS_SCAN_ACTIVE(p_ble_cb->scan_activity)) {
|
if (!BTM_BLE_IS_SCAN_ACTIVE(p_ble_cb->scan_activity)) {
|
||||||
/* Clear the inquiry callback if set */
|
/* Clear the inquiry callback if set */
|
||||||
btm_cb.ble_ctr_cb.inq_var.scan_type = BTM_BLE_SCAN_MODE_NONE;
|
btm_cb.ble_ctr_cb.inq_var.scan_type = BTM_BLE_SCAN_MODE_NONE;
|
||||||
btm_cb.ble_ctr_cb.inq_var.state = BTM_BLE_STOP_SCAN;
|
btm_cb.ble_ctr_cb.inq_var.state &= ~BTM_BLE_SCANNING;
|
||||||
/* stop discovery now */
|
/* stop discovery now */
|
||||||
if(btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_DUPLICATE_ENABLE)) {
|
if(btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_DUPLICATE_ENABLE)) {
|
||||||
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||||
@ -4063,7 +4064,7 @@ tBTM_STATUS btm_ble_start_adv(void)
|
|||||||
tBTM_BLE_GAP_STATE temp_state = p_cb->state;
|
tBTM_BLE_GAP_STATE temp_state = p_cb->state;
|
||||||
UINT8 adv_mode = p_cb->adv_mode;
|
UINT8 adv_mode = p_cb->adv_mode;
|
||||||
p_cb->adv_mode = BTM_BLE_ADV_ENABLE;
|
p_cb->adv_mode = BTM_BLE_ADV_ENABLE;
|
||||||
p_cb->state = BTM_BLE_ADVERTISING;
|
p_cb->state |= BTM_BLE_ADVERTISING;
|
||||||
btm_ble_adv_states_operation(btm_ble_set_topology_mask, p_cb->evt_type);
|
btm_ble_adv_states_operation(btm_ble_set_topology_mask, p_cb->evt_type);
|
||||||
if (btsnd_hcic_ble_set_adv_enable (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);
|
osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT);
|
||||||
@ -4107,7 +4108,7 @@ tBTM_STATUS btm_ble_stop_adv(void)
|
|||||||
|
|
||||||
p_cb->fast_adv_on = FALSE;
|
p_cb->fast_adv_on = FALSE;
|
||||||
p_cb->adv_mode = BTM_BLE_ADV_DISABLE;
|
p_cb->adv_mode = BTM_BLE_ADV_DISABLE;
|
||||||
p_cb->state = BTM_BLE_STOP_ADV;
|
p_cb->state &= ~BTM_BLE_ADVERTISING;
|
||||||
btm_cb.ble_ctr_cb.wl_state &= ~BTM_BLE_WL_ADV;
|
btm_cb.ble_ctr_cb.wl_state &= ~BTM_BLE_WL_ADV;
|
||||||
|
|
||||||
/* clear all adv states */
|
/* clear all adv states */
|
||||||
|
@ -107,13 +107,9 @@ typedef UINT8 tBTM_BLE_SEC_REQ_ACT;
|
|||||||
#define BTM_VSC_CHIP_CAPABILITY_M_VERSION 95
|
#define BTM_VSC_CHIP_CAPABILITY_M_VERSION 95
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BTM_BLE_IDLE,
|
BTM_BLE_IDLE = 0,
|
||||||
BTM_BLE_SCANNING,
|
BTM_BLE_SCANNING = 1,
|
||||||
BTM_BLE_SCAN_PENDING,
|
BTM_BLE_ADVERTISING = 2,
|
||||||
BTM_BLE_STOP_SCAN,
|
|
||||||
BTM_BLE_ADVERTISING,
|
|
||||||
BTM_BLE_ADV_PENDING,
|
|
||||||
BTM_BLE_STOP_ADV,
|
|
||||||
}tBTM_BLE_GAP_STATE;
|
}tBTM_BLE_GAP_STATE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -182,7 +178,7 @@ typedef struct {
|
|||||||
|
|
||||||
TIMER_LIST_ENT inq_timer_ent;
|
TIMER_LIST_ENT inq_timer_ent;
|
||||||
BOOLEAN scan_rsp;
|
BOOLEAN scan_rsp;
|
||||||
tBTM_BLE_GAP_STATE state; /* Current state that the inquiry process is in */
|
tBTM_BLE_GAP_STATE state; /* Current state that the adv or scan process is in */
|
||||||
INT8 tx_power;
|
INT8 tx_power;
|
||||||
} tBTM_BLE_INQ_CB;
|
} tBTM_BLE_INQ_CB;
|
||||||
|
|
||||||
@ -353,7 +349,7 @@ typedef struct {
|
|||||||
tBTM_BLE_SEL_CBACK *p_select_cback;
|
tBTM_BLE_SEL_CBACK *p_select_cback;
|
||||||
/* white list information */
|
/* white list information */
|
||||||
UINT8 white_list_avail_size;
|
UINT8 white_list_avail_size;
|
||||||
tBTM_ADD_WHITELIST_CBACK *add_wl_cb;
|
tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb;
|
||||||
tBTM_BLE_WL_STATE wl_state;
|
tBTM_BLE_WL_STATE wl_state;
|
||||||
|
|
||||||
fixed_queue_t *conn_pending_q;
|
fixed_queue_t *conn_pending_q;
|
||||||
@ -448,10 +444,10 @@ void btm_ble_update_sec_key_size(BD_ADDR bd_addr, UINT8 enc_key_size);
|
|||||||
UINT8 btm_ble_read_sec_key_size(BD_ADDR bd_addr);
|
UINT8 btm_ble_read_sec_key_size(BD_ADDR bd_addr);
|
||||||
|
|
||||||
/* white list function */
|
/* white list function */
|
||||||
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBTM_ADD_WHITELIST_CBACK *add_wl_cb);
|
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb);
|
||||||
void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy);
|
void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy);
|
||||||
void btm_update_adv_filter_policy(tBTM_BLE_AFP adv_policy);
|
void btm_update_adv_filter_policy(tBTM_BLE_AFP adv_policy);
|
||||||
void btm_ble_clear_white_list (void);
|
void btm_ble_clear_white_list (tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb);
|
||||||
void btm_read_white_list_size_complete(UINT8 *p, UINT16 evt_len);
|
void btm_read_white_list_size_complete(UINT8 *p, UINT16 evt_len);
|
||||||
void btm_ble_add_2_white_list_complete(UINT8 status);
|
void btm_ble_add_2_white_list_complete(UINT8 status);
|
||||||
void btm_ble_remove_from_white_list_complete(UINT8 *p, UINT16 evt_len);
|
void btm_ble_remove_from_white_list_complete(UINT8 *p, UINT16 evt_len);
|
||||||
|
@ -152,11 +152,13 @@ typedef struct {
|
|||||||
typedef enum{
|
typedef enum{
|
||||||
BTM_WHITELIST_REMOVE = 0X00,
|
BTM_WHITELIST_REMOVE = 0X00,
|
||||||
BTM_WHITELIST_ADD = 0X01,
|
BTM_WHITELIST_ADD = 0X01,
|
||||||
|
BTM_WHITELIST_CLEAR = 0x02,
|
||||||
}tBTM_WL_OPERATION;
|
}tBTM_WL_OPERATION;
|
||||||
|
|
||||||
|
|
||||||
typedef void (tBTM_DEV_STATUS_CB) (tBTM_DEV_STATUS status);
|
typedef void (tBTM_DEV_STATUS_CB) (tBTM_DEV_STATUS status);
|
||||||
|
|
||||||
|
typedef void (tBTM_GET_DEV_NAME_CBACK) (UINT8 status, char *name);
|
||||||
|
|
||||||
/* Callback function for when a vendor specific event occurs. The length and
|
/* Callback function for when a vendor specific event occurs. The length and
|
||||||
** array of returned parameter bytes are included. This asynchronous event
|
** array of returned parameter bytes are included. This asynchronous event
|
||||||
@ -189,7 +191,7 @@ typedef void (tBTM_SET_PKT_DATA_LENGTH_CBACK) (UINT8 status, tBTM_LE_SET_PKT_DAT
|
|||||||
|
|
||||||
typedef void (tBTM_SET_RAND_ADDR_CBACK) (UINT8 status);
|
typedef void (tBTM_SET_RAND_ADDR_CBACK) (UINT8 status);
|
||||||
|
|
||||||
typedef void (tBTM_ADD_WHITELIST_CBACK) (UINT8 status, tBTM_WL_OPERATION wl_opration);
|
typedef void (tBTM_UPDATE_WHITELIST_CBACK) (UINT8 status, tBTM_WL_OPERATION wl_opration);
|
||||||
|
|
||||||
typedef void (tBTM_SET_LOCAL_PRIVACY_CBACK) (UINT8 status);
|
typedef void (tBTM_SET_LOCAL_PRIVACY_CBACK) (UINT8 status);
|
||||||
|
|
||||||
|
@ -2232,7 +2232,7 @@ void BTM_BleTurnOnPrivacyOnRemote(BD_ADDR bd_addr,
|
|||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
//extern
|
//extern
|
||||||
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR emote_bda, tBLE_ADDR_TYPE addr_type, tBTM_ADD_WHITELIST_CBACK *add_wl_cb);
|
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR emote_bda, tBLE_ADDR_TYPE addr_type, tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
@ -2243,7 +2243,7 @@ BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR emote_bda, tBLE_AD
|
|||||||
** Returns void
|
** Returns void
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void BTM_BleClearWhitelist(void);
|
void BTM_BleClearWhitelist(tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
@ -280,7 +280,7 @@ void l2cble_notify_le_connection (BD_ADDR bda)
|
|||||||
tBTM_BLE_INQ_CB *p_cb = &btm_cb.ble_ctr_cb.inq_var;
|
tBTM_BLE_INQ_CB *p_cb = &btm_cb.ble_ctr_cb.inq_var;
|
||||||
if(p_cb) {
|
if(p_cb) {
|
||||||
p_cb->adv_mode = BTM_BLE_ADV_DISABLE;
|
p_cb->adv_mode = BTM_BLE_ADV_DISABLE;
|
||||||
p_cb->state = BTM_BLE_STOP_ADV;
|
p_cb->state &= ~BTM_BLE_ADVERTISING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* update link status */
|
/* update link status */
|
||||||
|
Reference in New Issue
Block a user