fixes #36: add API for clearScanResponse()

This commit is contained in:
Rohit Grover 2015-04-23 10:34:46 +01:00
parent 35e1e8b8c4
commit d1cdeb317f

View file

@ -147,6 +147,9 @@ public:
/**
* 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);
@ -207,6 +210,15 @@ public:
*/
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 @@ 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;