mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Component/bt: add new param for update_whitelist()
This commit is contained in:
parent
69b58f1e9c
commit
c0bdea6aae
@ -287,7 +287,7 @@ esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda)
|
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda, esp_ble_wl_addr_type_t wl_addr_type)
|
||||||
{
|
{
|
||||||
btc_msg_t msg;
|
btc_msg_t msg;
|
||||||
btc_ble_gap_args_t arg;
|
btc_ble_gap_args_t arg;
|
||||||
@ -302,6 +302,7 @@ esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda
|
|||||||
msg.pid = BTC_PID_GAP_BLE;
|
msg.pid = BTC_PID_GAP_BLE;
|
||||||
msg.act = BTC_GAP_BLE_ACT_UPDATE_WHITE_LIST;
|
msg.act = BTC_GAP_BLE_ACT_UPDATE_WHITE_LIST;
|
||||||
arg.update_white_list.add_remove = add_remove;
|
arg.update_white_list.add_remove = add_remove;
|
||||||
|
arg.update_white_list.wl_addr_type = wl_addr_type;
|
||||||
memcpy(arg.update_white_list.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
memcpy(arg.update_white_list.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
||||||
|
|
||||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL)
|
||||||
|
@ -112,6 +112,12 @@ typedef enum {
|
|||||||
BLE_ADDR_TYPE_RPA_RANDOM = 0x03,
|
BLE_ADDR_TYPE_RPA_RANDOM = 0x03,
|
||||||
} esp_ble_addr_type_t;
|
} esp_ble_addr_type_t;
|
||||||
|
|
||||||
|
/// white list address type
|
||||||
|
typedef enum {
|
||||||
|
BLE_WL_ADDR_TYPE_PUBLIC = 0x00,
|
||||||
|
BLE_WL_ADDR_TYPE_RANDOM = 0x01,
|
||||||
|
} esp_ble_wl_addr_type_t;
|
||||||
|
|
||||||
/// Used to exchange the encryption key in the init key & response key
|
/// Used to exchange the encryption key in the init key & response key
|
||||||
#define ESP_BLE_ENC_KEY_MASK (1 << 0) /* relate to BTM_BLE_ENC_KEY_MASK in stack/btm_api.h */
|
#define ESP_BLE_ENC_KEY_MASK (1 << 0) /* relate to BTM_BLE_ENC_KEY_MASK in stack/btm_api.h */
|
||||||
/// Used to exchange the IRK key in the init key & response key
|
/// Used to exchange the IRK key in the init key & response key
|
||||||
|
@ -932,12 +932,13 @@ esp_err_t esp_ble_gap_config_local_icon (uint16_t icon);
|
|||||||
*
|
*
|
||||||
* @param[in] add_remove: the value is true if added the ble device to the white list, and false remove to the white list.
|
* @param[in] add_remove: the value is true if added the ble device to the white list, and false remove to the white list.
|
||||||
* @param[in] remote_bda: the remote device address add/remove from the white list.
|
* @param[in] remote_bda: the remote device address add/remove from the white list.
|
||||||
|
* @param[in] wl_addr_type: whitelist address type
|
||||||
* @return
|
* @return
|
||||||
* - ESP_OK : success
|
* - ESP_OK : success
|
||||||
* - other : failed
|
* - other : failed
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda);
|
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda, esp_ble_wl_addr_type_t wl_addr_type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the whitelist size in the controller
|
* @brief Get the whitelist size in the controller
|
||||||
|
@ -595,7 +595,7 @@ void bta_dm_set_dev_name (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)
|
||||||
{
|
{
|
||||||
BTM_BleUpdateAdvWhitelist(p_data->white_list.add_remove, p_data->white_list.remote_addr, 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.add_wl_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bta_dm_ble_read_adv_tx_power(tBTA_DM_MSG *p_data)
|
void bta_dm_ble_read_adv_tx_power(tBTA_DM_MSG *p_data)
|
||||||
|
@ -183,12 +183,13 @@ void BTA_DmSetDeviceName(const char *p_name)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBTA_ADD_WHITELIST_CBACK *add_wl_cb)
|
void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBLE_ADDR_TYPE addr_type, tBTA_ADD_WHITELIST_CBACK *add_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->add_wl_cb = add_wl_cb;
|
p_msg->add_wl_cb = add_wl_cb;
|
||||||
memcpy(p_msg->remote_addr, remote_addr, sizeof(BD_ADDR));
|
memcpy(p_msg->remote_addr, remote_addr, sizeof(BD_ADDR));
|
||||||
|
|
||||||
|
@ -192,6 +192,7 @@ typedef struct {
|
|||||||
BT_HDR hdr;
|
BT_HDR hdr;
|
||||||
BOOLEAN add_remove;
|
BOOLEAN add_remove;
|
||||||
BD_ADDR remote_addr;
|
BD_ADDR remote_addr;
|
||||||
|
tBLE_ADDR_TYPE addr_type;
|
||||||
tBTA_ADD_WHITELIST_CBACK *add_wl_cb;
|
tBTA_ADD_WHITELIST_CBACK *add_wl_cb;
|
||||||
}tBTA_DM_API_UPDATE_WHITE_LIST;
|
}tBTA_DM_API_UPDATE_WHITE_LIST;
|
||||||
|
|
||||||
|
@ -1450,7 +1450,7 @@ extern void BTA_DisableTestMode(void);
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
extern void BTA_DmSetDeviceName(const char *p_name);
|
extern void BTA_DmSetDeviceName(const char *p_name);
|
||||||
|
|
||||||
extern void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBTA_ADD_WHITELIST_CBACK *add_wl_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_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb);
|
extern void BTA_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb);
|
||||||
|
|
||||||
|
@ -1117,7 +1117,7 @@ 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, 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_add_whitelist_complete_callback);
|
||||||
break;
|
break;
|
||||||
case BTC_GAP_BLE_ACT_READ_RSSI:
|
case BTC_GAP_BLE_ACT_READ_RSSI:
|
||||||
BTA_DmBleReadRSSI(arg->read_rssi.remote_addr, BTA_TRANSPORT_LE, btc_read_ble_rssi_cmpl_callback);
|
BTA_DmBleReadRSSI(arg->read_rssi.remote_addr, BTA_TRANSPORT_LE, btc_read_ble_rssi_cmpl_callback);
|
||||||
|
@ -95,6 +95,7 @@ typedef union {
|
|||||||
struct update_white_list_args {
|
struct update_white_list_args {
|
||||||
bool add_remove;
|
bool add_remove;
|
||||||
esp_bd_addr_t remote_bda;
|
esp_bd_addr_t remote_bda;
|
||||||
|
esp_ble_wl_addr_type_t wl_addr_type;
|
||||||
} update_white_list;
|
} update_white_list;
|
||||||
//BTC_GAP_BLE_UPDATE_DUPLICATE_SCAN_EXCEPTIONAL_LIST
|
//BTC_GAP_BLE_UPDATE_DUPLICATE_SCAN_EXCEPTIONAL_LIST
|
||||||
struct update_duplicate_exceptional_list_args {
|
struct update_duplicate_exceptional_list_args {
|
||||||
|
@ -154,8 +154,9 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy)
|
|||||||
**
|
**
|
||||||
** Description This function load the device into controller white list
|
** Description This function load the device into controller white list
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
BOOLEAN btm_add_dev_to_controller (BOOLEAN to_add, BD_ADDR bd_addr)
|
BOOLEAN btm_add_dev_to_controller (BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE wl_addr_type)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
|
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
|
||||||
tBLE_ADDR_TYPE addr_type = BLE_ADDR_PUBLIC;
|
tBLE_ADDR_TYPE addr_type = BLE_ADDR_PUBLIC;
|
||||||
BOOLEAN started = FALSE;
|
BOOLEAN started = FALSE;
|
||||||
@ -184,7 +185,7 @@ BOOLEAN btm_add_dev_to_controller (BOOLEAN to_add, BD_ADDR bd_addr)
|
|||||||
}
|
}
|
||||||
p_dev_rec->ble.in_controller_list &= ~BTM_WHITE_LIST_BIT;
|
p_dev_rec->ble.in_controller_list &= ~BTM_WHITE_LIST_BIT;
|
||||||
}
|
}
|
||||||
} /* if not a known device, shall we add it? */
|
} // if not a known device, shall we add it?
|
||||||
else {
|
else {
|
||||||
BTM_ReadDevInfo(bd_addr, &dev_type, &addr_type);
|
BTM_ReadDevInfo(bd_addr, &dev_type, &addr_type);
|
||||||
|
|
||||||
@ -196,6 +197,23 @@ BOOLEAN btm_add_dev_to_controller (BOOLEAN to_add, BD_ADDR bd_addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return started;
|
return started;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Controller do not support resolvable address now, only support public address and static random address */
|
||||||
|
BOOLEAN started = FALSE;
|
||||||
|
if(wl_addr_type > BLE_ADDR_RANDOM) {
|
||||||
|
BTM_TRACE_ERROR("wl_addr_type is error\n");
|
||||||
|
return started;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (to_add) {
|
||||||
|
started = btsnd_hcic_ble_add_white_list (wl_addr_type, bd_addr);
|
||||||
|
}else{
|
||||||
|
started = btsnd_hcic_ble_remove_from_white_list (wl_addr_type, bd_addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return started;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -212,7 +230,7 @@ BOOLEAN btm_execute_wl_dev_operation(void)
|
|||||||
|
|
||||||
for (i = 0; i < BTM_BLE_MAX_BG_CONN_DEV_NUM && rt; i ++, p_dev_op ++) {
|
for (i = 0; i < BTM_BLE_MAX_BG_CONN_DEV_NUM && rt; i ++, p_dev_op ++) {
|
||||||
if (p_dev_op->in_use) {
|
if (p_dev_op->in_use) {
|
||||||
rt = btm_add_dev_to_controller(p_dev_op->to_add, p_dev_op->bd_addr);
|
rt = btm_add_dev_to_controller(p_dev_op->to_add, p_dev_op->bd_addr, p_dev_op->addr_type);
|
||||||
memset(p_dev_op, 0, sizeof(tBTM_BLE_WL_OP));
|
memset(p_dev_op, 0, sizeof(tBTM_BLE_WL_OP));
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@ -226,13 +244,13 @@ BOOLEAN btm_execute_wl_dev_operation(void)
|
|||||||
**
|
**
|
||||||
** Description enqueue the pending whitelist device operation(loading or removing).
|
** Description enqueue the pending whitelist device operation(loading or removing).
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr)
|
void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type)
|
||||||
{
|
{
|
||||||
tBTM_BLE_WL_OP *p_dev_op = btm_cb.ble_ctr_cb.wl_op_q;
|
tBTM_BLE_WL_OP *p_dev_op = btm_cb.ble_ctr_cb.wl_op_q;
|
||||||
UINT8 i = 0;
|
UINT8 i = 0;
|
||||||
|
|
||||||
for (i = 0; i < BTM_BLE_MAX_BG_CONN_DEV_NUM; i ++, p_dev_op ++) {
|
for (i = 0; i < BTM_BLE_MAX_BG_CONN_DEV_NUM; i ++, p_dev_op ++) {
|
||||||
if (p_dev_op->in_use && !memcmp(p_dev_op->bd_addr, bd_addr, BD_ADDR_LEN)) {
|
if (p_dev_op->in_use && p_dev_op->addr_type == addr_type && !memcmp(p_dev_op->bd_addr, bd_addr, BD_ADDR_LEN)) {
|
||||||
p_dev_op->to_add = to_add;
|
p_dev_op->to_add = to_add;
|
||||||
return;
|
return;
|
||||||
} else if (!p_dev_op->in_use) {
|
} else if (!p_dev_op->in_use) {
|
||||||
@ -242,6 +260,7 @@ void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr)
|
|||||||
if (i != BTM_BLE_MAX_BG_CONN_DEV_NUM) {
|
if (i != BTM_BLE_MAX_BG_CONN_DEV_NUM) {
|
||||||
p_dev_op->in_use = TRUE;
|
p_dev_op->in_use = TRUE;
|
||||||
p_dev_op->to_add = to_add;
|
p_dev_op->to_add = to_add;
|
||||||
|
p_dev_op->addr_type = addr_type;
|
||||||
memcpy(p_dev_op->bd_addr, bd_addr, BD_ADDR_LEN);
|
memcpy(p_dev_op->bd_addr, bd_addr, BD_ADDR_LEN);
|
||||||
} else {
|
} else {
|
||||||
BTM_TRACE_ERROR("max pending WL operation reached, discard");
|
BTM_TRACE_ERROR("max pending WL operation reached, discard");
|
||||||
@ -257,8 +276,40 @@ void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr)
|
|||||||
** the white list.
|
** the white list.
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, 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_ADD_WHITELIST_CBACK *add_wl_cb)
|
||||||
{
|
{
|
||||||
|
if(addr_type > BLE_ADDR_RANDOM) {
|
||||||
|
BTM_TRACE_ERROR("%s address type is error, unable to add device", __func__);
|
||||||
|
if (add_wl_cb){
|
||||||
|
add_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if(addr_type == BLE_ADDR_RANDOM) {
|
||||||
|
/*
|
||||||
|
A static address is a 48-bit randomly generated address and shall meet the following requirements:
|
||||||
|
• The two most significant bits of the address shall be equal to 1
|
||||||
|
• All bits of the random part of the address shall not be equal to 1
|
||||||
|
• All bits of the random part of the address shall not be equal to 0
|
||||||
|
*/
|
||||||
|
BD_ADDR invalid_rand_addr_a, invalid_rand_addr_b;
|
||||||
|
memset(invalid_rand_addr_a, 0xff, sizeof(BD_ADDR));
|
||||||
|
memset(invalid_rand_addr_b, 0x00, sizeof(BD_ADDR));
|
||||||
|
invalid_rand_addr_b[0] = invalid_rand_addr_b[0] | BT_STATIC_RAND_ADDR_MASK;
|
||||||
|
if((bd_addr[0] & BT_STATIC_RAND_ADDR_MASK) == BT_STATIC_RAND_ADDR_MASK
|
||||||
|
&& memcmp(invalid_rand_addr_a, bd_addr, BD_ADDR_LEN) != 0
|
||||||
|
&& memcmp(invalid_rand_addr_b, bd_addr, BD_ADDR_LEN) != 0){
|
||||||
|
// do nothing
|
||||||
|
} else {
|
||||||
|
BTC_TRACE_ERROR(" controller not support resolvable address");
|
||||||
|
if (add_wl_cb){
|
||||||
|
add_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
|
||||||
|
|
||||||
if (to_add && p_cb->white_list_avail_size == 0) {
|
if (to_add && p_cb->white_list_avail_size == 0) {
|
||||||
@ -296,7 +347,7 @@ BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBTM_ADD_W
|
|||||||
/* stop the auto connect */
|
/* stop the auto connect */
|
||||||
btm_suspend_wl_activity(p_cb->wl_state);
|
btm_suspend_wl_activity(p_cb->wl_state);
|
||||||
/* save the bd_addr to the btm_cb env */
|
/* save the bd_addr to the btm_cb env */
|
||||||
btm_enq_wl_dev_operation(to_add, bd_addr);
|
btm_enq_wl_dev_operation(to_add, bd_addr, addr_type);
|
||||||
/* save the ba_addr to the controller white list */
|
/* save the ba_addr to the controller white list */
|
||||||
btm_wl_update_to_controller();
|
btm_wl_update_to_controller();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -300,9 +300,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, tBTM_ADD_WHITELIST_CBACK *add_wl_cb)
|
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR remote_bda, tBLE_ADDR_TYPE addr_type, tBTM_ADD_WHITELIST_CBACK *add_wl_cb)
|
||||||
{
|
{
|
||||||
return btm_update_dev_to_white_list(add_remove, remote_bda, add_wl_cb);
|
return btm_update_dev_to_white_list(add_remove, remote_bda, addr_type, add_wl_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -1083,7 +1083,7 @@ void BTM_BleClearBgConnDev(void)
|
|||||||
BOOLEAN BTM_BleUpdateBgConnDev(BOOLEAN add_remove, BD_ADDR remote_bda)
|
BOOLEAN BTM_BleUpdateBgConnDev(BOOLEAN add_remove, BD_ADDR remote_bda)
|
||||||
{
|
{
|
||||||
BTM_TRACE_EVENT("%s() add=%d", __func__, add_remove);
|
BTM_TRACE_EVENT("%s() add=%d", __func__, add_remove);
|
||||||
return btm_update_dev_to_white_list(add_remove, remote_bda, NULL);
|
return btm_update_dev_to_white_list(add_remove, remote_bda, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -293,6 +293,7 @@ typedef struct {
|
|||||||
BOOLEAN in_use;
|
BOOLEAN in_use;
|
||||||
BOOLEAN to_add;
|
BOOLEAN to_add;
|
||||||
BD_ADDR bd_addr;
|
BD_ADDR bd_addr;
|
||||||
|
tBLE_ADDR_TYPE addr_type;
|
||||||
UINT8 attr;
|
UINT8 attr;
|
||||||
} tBTM_BLE_WL_OP;
|
} tBTM_BLE_WL_OP;
|
||||||
|
|
||||||
@ -427,7 +428,7 @@ 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, 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_ADD_WHITELIST_CBACK *add_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 (void);
|
||||||
|
@ -2447,7 +2447,8 @@ BOOLEAN gatt_add_bg_dev_list(tGATT_REG *p_reg, BD_ADDR bd_addr, BOOLEAN is_init
|
|||||||
p_dev->listen_gif[i] = gatt_if;
|
p_dev->listen_gif[i] = gatt_if;
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
ret = BTM_BleUpdateAdvWhitelist(TRUE, bd_addr, NULL);
|
// To check, we do not support background connection, code will not be called here
|
||||||
|
ret = BTM_BleUpdateAdvWhitelist(TRUE, bd_addr, 0, NULL);
|
||||||
} else {
|
} else {
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
@ -2587,7 +2588,8 @@ BOOLEAN gatt_remove_bg_dev_from_list(tGATT_REG *p_reg, BD_ADDR bd_addr, BOOLEAN
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p_dev->listen_gif[0] == 0) {
|
if (p_dev->listen_gif[0] == 0) {
|
||||||
ret = BTM_BleUpdateAdvWhitelist(FALSE, p_dev->remote_bda, NULL);
|
// To check, we do not support background connection, code will not be called here
|
||||||
|
ret = BTM_BleUpdateAdvWhitelist(FALSE, p_dev->remote_bda, 0, NULL);
|
||||||
} else {
|
} else {
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
@ -2648,7 +2650,8 @@ void gatt_deregister_bgdev_list(tGATT_IF gatt_if)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p_dev_list->listen_gif[0] == 0) {
|
if (p_dev_list->listen_gif[0] == 0) {
|
||||||
BTM_BleUpdateAdvWhitelist(FALSE, p_dev_list->remote_bda, NULL);
|
// To check, we do not support background connection, code will not be called here
|
||||||
|
BTM_BleUpdateAdvWhitelist(FALSE, p_dev_list->remote_bda, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1802,7 +1802,7 @@ void BTM_BleTurnOnPrivacyOnRemote(BD_ADDR bd_addr,
|
|||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
//extern
|
//extern
|
||||||
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR emote_bda, tBTM_ADD_WHITELIST_CBACK *add_wl_cb);
|
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR emote_bda, tBLE_ADDR_TYPE addr_type, tBTM_ADD_WHITELIST_CBACK *add_wl_cb);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user