@@ -244,7 +244,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms)
244
244
{
245
245
uint32_t err;
246
246
ble_gap_adv_params_t adv_para = {0 };
247
-
247
+
248
248
/* Make sure we support the advertising type */
249
249
if (params.getAdvertisingType () == GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED) {
250
250
/* ToDo: This requires a propery security implementation, etc. */
@@ -296,7 +296,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms)
296
296
return error;
297
297
}
298
298
}
299
-
299
+
300
300
if (_privacy_enabled) {
301
301
if (_peripheral_privacy_configuration.resolution_strategy != PeripheralPrivacyConfiguration_t::DO_NOT_RESOLVE) {
302
302
ArrayView<resolving_list_entry_t > entries = get_sm ().get_resolving_list ();
@@ -336,7 +336,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms)
336
336
}
337
337
#endif
338
338
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */
339
-
339
+
340
340
/* Start Advertising */
341
341
342
342
@@ -345,7 +345,7 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms)
345
345
adv_para.fp = advertisingPolicyMode;
346
346
adv_para.interval = params.getIntervalInADVUnits (); // advertising interval (in units of 0.625 ms)
347
347
adv_para.timeout = params.getTimeout ();
348
-
348
+
349
349
#if (NRF_SD_BLE_API_VERSION >= 5)
350
350
err = sd_ble_gap_adv_start (&adv_para, NRF_CONNECTION_TAG);
351
351
#else
@@ -365,9 +365,9 @@ ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams ¶ms)
365
365
#if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110)
366
366
ble_error_t nRF5xGap::startRadioScan (const GapScanningParams &scanningParams)
367
367
{
368
-
368
+
369
369
ble_gap_scan_params_t scanParams;
370
-
370
+
371
371
#if (NRF_SD_BLE_API_VERSION <= 2)
372
372
/* Allocate the stack's whitelist statically */
373
373
ble_gap_whitelist_t whitelist;
@@ -386,17 +386,17 @@ ble_error_t nRF5xGap::startRadioScan(const GapScanningParams &scanningParams)
386
386
return error;
387
387
}
388
388
}
389
-
389
+
390
390
// FIXME: fill the irk list once addresses are resolved by the softdevice.
391
391
scanParams.selective = scanningPolicyMode; /* *< If 1, ignore unknown devices (non whitelisted). */
392
392
scanParams.p_whitelist = &whitelist; /* *< Pointer to whitelist, NULL if none is given. */
393
393
#else
394
394
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */
395
-
395
+
396
396
scanParams.use_whitelist = scanningPolicyMode;
397
397
scanParams.adv_dir_report = 0 ;
398
398
#endif
399
-
399
+
400
400
scanParams.active = scanningParams.getActiveScanning (); /* *< If 1, perform active scanning (scan requests). */
401
401
402
402
scanParams.interval = scanningParams.getInterval (); /* *< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
@@ -545,7 +545,7 @@ ble_error_t nRF5xGap::connect(
545
545
}
546
546
547
547
ble_gap_scan_params_t scanParams ={0 };
548
-
548
+
549
549
#if (NRF_SD_BLE_API_VERSION <= 2)
550
550
/* Allocate the stack's whitelist statically */
551
551
ble_gap_whitelist_t whitelist;
@@ -564,7 +564,7 @@ ble_error_t nRF5xGap::connect(
564
564
return error;
565
565
}
566
566
}
567
-
567
+
568
568
scanParams.selective = scanningPolicyMode; /* *< If 1, ignore unknown devices (non whitelisted). */
569
569
scanParams.p_whitelist = &whitelist; /* *< Pointer to whitelist, NULL if none is given. */
570
570
if (_privacy_enabled) {
@@ -597,7 +597,7 @@ ble_error_t nRF5xGap::connect(
597
597
}
598
598
#else
599
599
/* For NRF_SD_BLE_API_VERSION >= 3 nRF5xGap::setWhitelist setups the whitelist. */
600
-
600
+
601
601
scanParams.use_whitelist = (whitelistAddressesSize) ? 1 : 0 ;
602
602
603
603
if (_privacy_enabled) {
@@ -797,7 +797,7 @@ ble_error_t nRF5xGap::setAddress(LegacyAddressType_t type, const Address_t addre
797
797
if (_privacy_enabled) {
798
798
return BLE_ERROR_INVALID_STATE;
799
799
}
800
-
800
+
801
801
ble_gap_addr_t dev_addr;
802
802
memcpy (dev_addr.addr , address, ADDR_LEN);
803
803
if (type == LegacyAddressType::PUBLIC) {
@@ -1472,7 +1472,6 @@ ble_error_t nRF5xGap::get_role(ble::connection_handle_t connection, Role_t& role
1472
1472
if (c.is_allocated && c.connection == connection) {
1473
1473
role = c.is_peripheral ? PERIPHERAL : CENTRAL;
1474
1474
return BLE_ERROR_NONE;
1475
-
1476
1475
}
1477
1476
}
1478
1477
0 commit comments