High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 409:37a4202649dd, committed 2015-06-08
- Comitter:
- rgrover1
- Date:
- Mon Jun 08 10:41:17 2015 +0100
- Parent:
- 408:388570b048a7
- Child:
- 410:af8f2d1b67b6
- Commit message:
- Synchronized with git rev 8c397032
Author: Marcus Chang
Added get/set methods for advPayload and advParams.
Changed in this revision
public/BLEDevice.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/public/BLEDevice.h Mon Jun 08 10:41:17 2015 +0100 +++ b/public/BLEDevice.h Mon Jun 08 10:41:17 2015 +0100 @@ -136,6 +136,12 @@ void setAdvertisingParams(const GapAdvertisingParams &advParams); /** + * @return Read back advertising parameters. Useful for storing and + * restoring parameters rapidly. + */ + GapAdvertisingParams getAdvertisingParams(void); + + /** * This API is typically used as an internal helper to udpate the transport * backend with advertising data before starting to advertise. It may also * be explicity used to dynamically reset the accumulated advertising @@ -146,6 +152,17 @@ ble_error_t setAdvertisingPayload(void); /** + * Set advertising data using object. + */ + ble_error_t setAdvertisingData(const GapAdvertisingData &advData); + + /** + * @return Read back advertising data. Useful for storing and + * restoring payload. + */ + GapAdvertisingData getAdvertisingData(void); + + /** * Reset any advertising payload prepared from prior calls to * accumulateAdvertisingPayload(). * @@ -679,6 +696,12 @@ advParams = newAdvParams; } +inline GapAdvertisingParams +BLEDevice::getAdvertisingParams(void) +{ + return advParams; +} + inline void BLEDevice::clearAdvertisingPayload(void) { @@ -739,6 +762,19 @@ } inline ble_error_t +BLEDevice::setAdvertisingData(const GapAdvertisingData& newPayload) +{ + advPayload = newPayload; + + return setAdvertisingPayload(); +} + +inline GapAdvertisingData +BLEDevice::getAdvertisingData(void) { + return advPayload; +} + +inline ble_error_t BLEDevice::startAdvertising(void) { ble_error_t rc;