abc

Fork of BLE_API by Bluetooth Low Energy

Revision:
410:37a4202649dd
Parent:
407:ca6b956b33d1
Child:
411:af8f2d1b67b6
--- 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;