mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
test(bt/bluedroid): Support to disable BLE address resolution
This commit is contained in:
parent
0badb8863e
commit
338763fae7
@ -384,6 +384,10 @@ static BOOLEAN btm_ble_match_random_bda(tBTM_SEC_DEV_REC *p_dev_rec)
|
|||||||
void btm_ble_resolve_random_addr(BD_ADDR random_bda, tBTM_BLE_RESOLVE_CBACK *p_cback, void *p)
|
void btm_ble_resolve_random_addr(BD_ADDR random_bda, tBTM_BLE_RESOLVE_CBACK *p_cback, void *p)
|
||||||
{
|
{
|
||||||
#if (SMP_INCLUDED == TRUE)
|
#if (SMP_INCLUDED == TRUE)
|
||||||
|
if (btm_cb.addr_res_en == FALSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tBTM_LE_RANDOM_CB *p_mgnt_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
|
tBTM_LE_RANDOM_CB *p_mgnt_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
|
||||||
list_node_t *p_node = NULL;
|
list_node_t *p_node = NULL;
|
||||||
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
||||||
@ -458,6 +462,10 @@ tBTM_SEC_DEV_REC *btm_find_dev_by_identity_addr(BD_ADDR bd_addr, UINT8 addr_type
|
|||||||
BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type, BOOLEAN refresh)
|
BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type, BOOLEAN refresh)
|
||||||
{
|
{
|
||||||
#if BLE_PRIVACY_SPT == TRUE
|
#if BLE_PRIVACY_SPT == TRUE
|
||||||
|
if (btm_cb.addr_res_en == FALSE) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_identity_addr(bd_addr, *p_addr_type);
|
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_identity_addr(bd_addr, *p_addr_type);
|
||||||
|
|
||||||
BTM_TRACE_EVENT ("%s", __func__);
|
BTM_TRACE_EVENT ("%s", __func__);
|
||||||
@ -491,6 +499,10 @@ BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type,
|
|||||||
BOOLEAN btm_random_pseudo_to_identity_addr(BD_ADDR random_pseudo, UINT8 *p_static_addr_type)
|
BOOLEAN btm_random_pseudo_to_identity_addr(BD_ADDR random_pseudo, UINT8 *p_static_addr_type)
|
||||||
{
|
{
|
||||||
#if BLE_PRIVACY_SPT == TRUE
|
#if BLE_PRIVACY_SPT == TRUE
|
||||||
|
if (btm_cb.addr_res_en == FALSE) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (random_pseudo);
|
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (random_pseudo);
|
||||||
|
|
||||||
if (p_dev_rec != NULL) {
|
if (p_dev_rec != NULL) {
|
||||||
|
@ -84,6 +84,7 @@ void btm_init (void)
|
|||||||
#if BLE_INCLUDED == TRUE
|
#if BLE_INCLUDED == TRUE
|
||||||
btm_ble_lock_init();
|
btm_ble_lock_init();
|
||||||
btm_ble_sem_init();
|
btm_ble_sem_init();
|
||||||
|
btm_cb.addr_res_en = TRUE;
|
||||||
#endif
|
#endif
|
||||||
btm_sec_dev_init();
|
btm_sec_dev_init();
|
||||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
@ -133,3 +134,10 @@ uint8_t btm_acl_active_count(void)
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void btm_ble_addr_resolve_enable(bool enable)
|
||||||
|
{
|
||||||
|
#if (BLE_INCLUDED == TRUE)
|
||||||
|
btm_cb.addr_res_en = enable;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@ -876,6 +876,7 @@ typedef struct {
|
|||||||
UINT16 ediv; /* received ediv value from LTK request */
|
UINT16 ediv; /* received ediv value from LTK request */
|
||||||
UINT8 key_size;
|
UINT8 key_size;
|
||||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||||
|
BOOLEAN addr_res_en; /* internal use for test: address resolution enable/disable */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Packet types supported by the local device */
|
/* Packet types supported by the local device */
|
||||||
|
Loading…
Reference in New Issue
Block a user