Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate writable_gatt ... more
Diff: nRF51Gap.h
- Revision:
- 166:fa0e88cac390
- Parent:
- 140:3a5282e3f30c
- Child:
- 168:a24112aa18a1
diff -r 67fcad70785a -r fa0e88cac390 nRF51Gap.h
--- a/nRF51Gap.h Wed May 13 08:49:34 2015 +0100
+++ b/nRF51Gap.h Wed May 13 08:49:34 2015 +0100
@@ -77,6 +77,26 @@
ble_radio_notification_init(NRF_APP_PRIORITY_HIGH, NRF_RADIO_NOTIFICATION_DISTANCE_800US, onRadioNotification);
}
+ virtual ble_error_t startScanning(const GapScanningParams &scanningParams, AdvertisementReportCallback_t callback) {
+ if ((onAdvertisementReport = callback) != NULL) {
+
+ ble_gap_scan_params_t scanParams = {
+ .active = 0, /**< If 1, perform active scanning (scan requests). */
+ .selective = 0, /**< If 1, ignore unknown devices (non whitelisted). */
+ .p_whitelist = NULL, /**< Pointer to whitelist, NULL if none is given. */
+ .interval = scanningParams.getInterval(), /**< Scan interval between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
+ .window = scanningParams.getWindow(), /**< Scan window between 0x0004 and 0x4000 in 0.625ms units (2.5ms to 10.24s). */
+ .timeout = scanningParams.getTimeout(), /**< Scan timeout between 0x0001 and 0xFFFF in seconds, 0x0000 disables timeout. */
+ };
+
+ if (sd_ble_gap_scan_start(&scanParams) != NRF_SUCCESS) {
+ return BLE_ERROR_PARAM_OUT_OF_RANGE;
+ }
+ }
+
+ return BLE_ERROR_NONE;
+ }
+
private:
uint16_t m_connectionHandle;
nRF51Gap() {

