return ((x.address)[0] & BLE_RESOLVE_ADDR_MASK) == BLE_RESOLVE_ADDR_MSB;
}
-bool acl_refresh_remote_address(const tBTM_SEC_DEV_REC* p_sec_rec,
+bool acl_refresh_remote_address(const RawAddress& identity_address,
+ tBLE_ADDR_TYPE identity_address_type,
const RawAddress& bda, tBLE_ADDR_TYPE rra_type,
const RawAddress& rpa) {
tACL_CONN* p_acl = internal_.btm_bda_to_acl(bda, BT_TRANSPORT_LE);
if (rra_type == tBTM_SEC_BLE::BTM_BLE_ADDR_PSEUDO) {
/* use identity address, resolvable_private_addr is empty */
if (rpa.IsEmpty()) {
- p_acl->active_remote_addr_type =
- p_sec_rec->ble.identity_address_with_type.type;
- p_acl->active_remote_addr = p_sec_rec->ble.identity_address_with_type.bda;
+ p_acl->active_remote_addr_type = identity_address_type;
+ p_acl->active_remote_addr = identity_address;
} else {
p_acl->active_remote_addr_type = BLE_ADDR_RANDOM;
p_acl->active_remote_addr = rpa;
}
/* connection refresh remote address */
- if (!acl_refresh_remote_address(p_sec_rec, p_sec_rec->bd_addr, rra_type,
- rpa)) {
+ const auto& identity_address = p_sec_rec->ble.identity_address_with_type.bda;
+ auto identity_address_type = p_sec_rec->ble.identity_address_with_type.type;
+
+ if (!acl_refresh_remote_address(identity_address, identity_address_type,
+ p_sec_rec->bd_addr, rra_type, rpa)) {
// Try looking up the pseudo random address
- if (!acl_refresh_remote_address(p_sec_rec, p_sec_rec->ble.pseudo_addr,
- rra_type, rpa)) {
+ if (!acl_refresh_remote_address(identity_address, identity_address_type,
+ p_sec_rec->ble.pseudo_addr, rra_type,
+ rpa)) {
LOG_ERROR("%s Unknown device to refresh remote device", __func__);
}
}
bool BTM_BLE_IS_RESOLVE_BDA(const RawAddress& x);
-bool acl_refresh_remote_address(const tBTM_SEC_DEV_REC* p_dev_rec,
+bool acl_refresh_remote_address(const RawAddress& identity_address,
+ tBLE_ADDR_TYPE identity_address_type,
const RawAddress& remote_bda, uint8_t rra_type,
const RawAddress& rpa);