Skip to content

Commit ba61c09

Browse files
committed
BLE NRF51: Resolve private address on connection in peripheral role
Soft device inconsistency: The address is not resolved automatically if the device is a peripheral.
1 parent 755cf5f commit ba61c09

File tree

1 file changed

+10
-0
lines changed
  • features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source

1 file changed

+10
-0
lines changed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/nRF5xGap.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,16 @@ void nRF5xGap::on_connection(Gap::Handle_t handle, const ble_gap_evt_connected_t
12481248

12491249
#if (NRF_SD_BLE_API_VERSION <= 2)
12501250
bool private_peer_known = evt.irk_match;
1251+
1252+
// thanks to softdevice consistencies; addresses are not resolved on the
1253+
// peripheral side ...
1254+
if (_privacy_enabled &&
1255+
evt.role == BLE_GAP_ROLE_PERIPH &&
1256+
_peripheral_privacy_configuration.resolution_strategy != PeripheralPrivacyConfiguration_t::DO_NOT_RESOLVE &&
1257+
get_sm().resolve_address(evt.peer_addr.addr) != NULL
1258+
) {
1259+
private_peer_known = true;
1260+
}
12511261
#else
12521262
bool private_peer_known = evt.peer_addr.addr_id_peer;
12531263
#endif

0 commit comments

Comments
 (0)