Skip to content

Commit ef20891

Browse files
committed
BLE NRF52: Report correct own address type for connection
The function that gets the address doesn't work when privacy is enabled; report own address as private resolvable.
1 parent 30dac7c commit ef20891

File tree

1 file changed

+3
-0
lines changed
  • features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,9 @@ void nRF5xGap::on_connection(Gap::Handle_t handle, const ble_gap_evt_connected_t
13401340
memcpy(own_address, evt.own_addr.addr, sizeof(own_address));
13411341
#else
13421342
getAddress(&own_addr_type, own_address.data());
1343+
if (_privacy_enabled) {
1344+
own_addr_type = LegacyAddressType::RANDOM_PRIVATE_RESOLVABLE;
1345+
}
13431346
#endif
13441347

13451348
#if (NRF_SD_BLE_API_VERSION <= 2)

0 commit comments

Comments
 (0)