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.
Fork of nRF51822 by
Diff: nRF51Gap.h
- Revision:
- 177:e0397a086ff5
- Parent:
- 174:555dc8af9269
- Child:
- 178:3b34428e80ea
--- a/nRF51Gap.h Wed May 13 08:49:36 2015 +0100 +++ b/nRF51Gap.h Mon May 18 09:53:05 2015 +0100 @@ -78,9 +78,8 @@ ble_radio_notification_init(NRF_APP_PRIORITY_HIGH, NRF_RADIO_NOTIFICATION_DISTANCE_800US, onRadioNotification); } - virtual ble_error_t startScan(const GapScanningParams &scanningParams, AdvertisementReportCallback_t callback) { - if ((onAdvertisementReport = callback) != NULL) { - + virtual ble_error_t startScan(const GapScanningParams &scanningParams, void (*callback)(const AdvertisementCallbackParams_t *params)) { + if (callback != NULL) { ble_gap_scan_params_t scanParams = { .active = scanningParams.getActiveScanning(), /**< If 1, perform active scanning (scan requests). */ .selective = 0, /**< If 1, ignore unknown devices (non whitelisted). */ @@ -93,6 +92,8 @@ if (sd_ble_gap_scan_start(&scanParams) != NRF_SUCCESS) { return BLE_ERROR_PARAM_OUT_OF_RANGE; } + + onAdvertisementReport.attach(callback); } return BLE_ERROR_NONE;