@@ -1322,7 +1322,7 @@ void nRF5xGap::on_connection(Gap::Handle_t handle, const ble_gap_evt_connected_t
1322
1322
// deal with own address
1323
1323
LegacyAddressType_t own_addr_type;
1324
1324
ble::address_t own_address;
1325
- ble:: address_t own_resolvable_address;
1325
+ const uint8_t * own_resolvable_address = NULL ;
1326
1326
1327
1327
#if (NRF_SD_BLE_API_VERSION <= 2)
1328
1328
if (evt.own_addr .addr_type == BLE_GAP_ADDR_TYPE_PUBLIC) {
@@ -1335,14 +1335,6 @@ void nRF5xGap::on_connection(Gap::Handle_t handle, const ble_gap_evt_connected_t
1335
1335
getAddress (&own_addr_type, own_address.data ());
1336
1336
#endif
1337
1337
1338
- if (_privacy_enabled) {
1339
- // swap own address with own resolvable address as when privacy is
1340
- // enabled own_address is invalid and the address returned by getAddress
1341
- // is the resolvable one.
1342
- std::swap (own_address, own_resolvable_address);
1343
- own_addr_type = LegacyAddressType::RANDOM_PRIVATE_RESOLVABLE;
1344
- }
1345
-
1346
1338
#if (NRF_SD_BLE_API_VERSION <= 2)
1347
1339
bool private_peer_known = evt.irk_match ;
1348
1340
#else
@@ -1374,11 +1366,11 @@ void nRF5xGap::on_connection(Gap::Handle_t handle, const ble_gap_evt_connected_t
1374
1366
private_peer_known,
1375
1367
evt.peer_addr .addr_type
1376
1368
);
1369
+
1377
1370
// NOTE: when privacy is enabled, the only address returned is the resolved
1378
- // address; set peer and resolved address to the same value in such case .
1371
+ // address.
1379
1372
const uint8_t * peer_address = evt.peer_addr .addr ;
1380
- const uint8_t * peer_resolvable_address =
1381
- private_peer_known ? peer_address : NULL ;
1373
+ const uint8_t * peer_resolvable_address = NULL ;
1382
1374
1383
1375
// notify internal event handler before applying the resolution strategy
1384
1376
if (_connection_event_handler) {
@@ -1422,7 +1414,7 @@ void nRF5xGap::on_connection(Gap::Handle_t handle, const ble_gap_evt_connected_t
1422
1414
own_address.data (),
1423
1415
reinterpret_cast <const ConnectionParams_t *>(&(evt.conn_params )),
1424
1416
peer_resolvable_address,
1425
- own_resolvable_address. data ()
1417
+ own_resolvable_address
1426
1418
);
1427
1419
}
1428
1420
0 commit comments