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: microbit-dal microbit-dal microbit-ble-open microbit-dal ... more
Fork of BLE_API by
Diff: public/BLEDevice.h
- Revision:
- 407:ca6b956b33d1
- Parent:
- 406:cec6778acc66
- Child:
- 409:37a4202649dd
--- a/public/BLEDevice.h Mon May 18 09:54:27 2015 +0100
+++ b/public/BLEDevice.h Mon May 18 09:54:27 2015 +0100
@@ -272,6 +272,18 @@
ble_error_t startScan(void (*callback)(const Gap::AdvertisementCallbackParams_t *params));
/**
+ * Start scanning (Observer Procedure) based on the scan-params currently
+ * in effect.
+ *
+ * @param[in] object
+ * @param[in] callbackMember
+ * The above pair of parameters define the callback object
+ * and member function to receive the advertisement params.
+ */
+ template<typename T>
+ ble_error_t startScan(T *object, void (T::*memberCallback)(const Gap::AdvertisementCallbackParams_t *params));
+
+ /**
* Stop scanning. The current scanning parameters remain in effect.
*
* @retval BLE_ERROR_NONE if successfully stopped scanning procedure.
@@ -787,6 +799,12 @@
return transport->getGap().startScan(scanningParams, callback);
}
+template<typename T>
+inline ble_error_t
+BLEDevice::startScan(T *object, void (T::*memberCallback)(const Gap::AdvertisementCallbackParams_t *params)) {
+ return transport->getGap().startScan(scanningParams, object, memberCallback);
+}
+
inline ble_error_t
BLEDevice::stopScan(void) {
return transport->getGap().stopScan();
