Skip to content

Commit

Permalink
fixes #36: add API for clearScanResponse()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Grover committed Apr 23, 2015
1 parent 35e1e8b commit d1cdeb3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions public/BLEDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ class BLEDevice
/**
* 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);

Expand Down Expand Up @@ -207,6 +210,15 @@ class BLEDevice
*/
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).
Expand Down Expand Up @@ -570,6 +582,13 @@ BLEDevice::accumulateScanResponse(GapAdvertisingData::DataType type, const uint8
return scanResponse.addData(type, data, len);
}

inline void
BLEDevice::clearScanResponse(void)
{
needToSetAdvPayload = true;
scanResponse.clear();
}

inline ble_error_t
BLEDevice::setAdvertisingPayload(void) {
needToSetAdvPayload = false;
Expand Down

0 comments on commit d1cdeb3

Please sign in to comment.