BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Thu Apr 30 08:37:21 2015 +0100
Parent:
342:152bd9c825d6
Child:
344:241987ac6b8b
Commit message:
Synchronized with git rev d1cdeb31
Author: Rohit Grover
fixes #36: add API for clearScanResponse()

Changed in this revision

public/BLEDevice.h Show annotated file Show diff for this revision Revisions of this file
--- a/public/BLEDevice.h	Thu Apr 30 08:37:21 2015 +0100
+++ b/public/BLEDevice.h	Thu Apr 30 08:37:21 2015 +0100
@@ -147,6 +147,9 @@
     /**
      * Reset any advertising payload prepared from prior calls to
      * accumulateAdvertisingPayload().
+     *
+     * Note: This should be followed by a call to setAdvertisingPayload() or
+     * startAdvertising() before the update takes effect.
      */
     void        clearAdvertisingPayload(void);
 
@@ -208,6 +211,15 @@
     ble_error_t accumulateScanResponse(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len);
 
     /**
+     * Reset any scan response prepared from prior calls to
+     * accumulateScanResponse().
+     *
+     * Note: This should be followed by a call to setAdvertisingPayload() or
+     * startAdvertising() before the update takes effect.
+     */
+    void        clearScanResponse(void);
+
+    /**
      * Start advertising (GAP Discoverable, Connectable modes, Broadcast
      * Procedure).
      */
@@ -570,6 +582,13 @@
     return scanResponse.addData(type, data, len);
 }
 
+inline void
+BLEDevice::clearScanResponse(void)
+{
+    needToSetAdvPayload = true;
+    scanResponse.clear();
+}
+
 inline ble_error_t
 BLEDevice::setAdvertisingPayload(void) {
     needToSetAdvPayload = false;