@@ -458,14 +458,30 @@ ble_error_t nRF5xGap::connect(
458
458
return BLE_ERROR_INVALID_PARAM;
459
459
}
460
460
461
- return connect (peerAddr, legacy_address, connectionParams, scanParamsIn);
461
+ bool identity =
462
+ peerAddrType == peer_address_type_t ::PUBLIC_IDENTITY ||
463
+ peerAddrType == peer_address_type_t ::RANDOM_STATIC_IDENTITY;
464
+
465
+ return connect (peerAddr, legacy_address, connectionParams, scanParamsIn, identity);
462
466
}
463
467
464
468
ble_error_t nRF5xGap::connect (
465
469
const Address_t peerAddr,
466
470
LegacyAddressType_t peerAddrType,
467
471
const ConnectionParams_t *connectionParams,
468
472
const GapScanningParams *scanParamsIn
473
+ ) {
474
+ return connect (peerAddr, peerAddrType, connectionParams, scanParamsIn, /* identity */ false );
475
+ }
476
+
477
+
478
+
479
+ ble_error_t nRF5xGap::connect (
480
+ const Address_t peerAddr,
481
+ LegacyAddressType_t peerAddrType,
482
+ const ConnectionParams_t *connectionParams,
483
+ const GapScanningParams *scanParamsIn,
484
+ bool identity
469
485
) {
470
486
ble_gap_addr_t addr;
471
487
ble_gap_addr_t * addr_ptr = &addr;
@@ -485,7 +501,7 @@ ble_error_t nRF5xGap::connect(
485
501
connParams.conn_sup_timeout = 600 ;
486
502
}
487
503
488
- ble_gap_scan_params_t scanParams ={ 0 };
504
+ ble_gap_scan_params_t scanParams = { 0 };
489
505
490
506
#if (NRF_SD_BLE_API_VERSION <= 2)
491
507
/* Allocate the stack's whitelist statically */
@@ -513,6 +529,11 @@ ble_error_t nRF5xGap::connect(
513
529
whitelistIrkPtrs[i] = (ble_gap_irk_t *) entries[i].peer_irk .data ();
514
530
}
515
531
whitelist.irk_count = limit;
532
+
533
+ if (identity) {
534
+ scanParams.selective = true ;
535
+ addr_ptr = NULL ;
536
+ }
516
537
}
517
538
518
539
set_private_resolvable_address ();
0 commit comments