abc
Fork of BLE_API by
Diff: public/BLEDevice.h
- Revision:
- 407:ca6b956b33d1
- Parent:
- 406:cec6778acc66
- Child:
- 410:37a4202649dd
diff -r cec6778acc66 -r ca6b956b33d1 public/BLEDevice.h --- 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();