Minor temporary patch to allow DFU packet callback

Fork of BLE_API by Bluetooth Low Energy

Revision:
343:4d2576324b62
Parent:
342:152bd9c825d6
Child:
347:20be4234c6fe
--- 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;