add accumulateScanResponse() to BLEDevice.h

This commit is contained in:
Rohit Grover 2014-07-09 09:08:53 +01:00
parent ddfdb06026
commit 8c0e55c918
1 changed files with 18 additions and 1 deletions

View File

@ -183,6 +183,16 @@ public:
*/
ble_error_t accumulateAdvertisingPayload(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len);
/**
* Accumulate a variable length byte-stream as an AD structure in the
* scanResponse payload.
*
* @param type The type which describes the variable length data.
* @param data data bytes.
* @param len length of data.
*/
ble_error_t accumulateScanResponse(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len);
/**
* Start advertising (GAP Discoverable, Connectable modes, Broadcast
* Procedure).
@ -356,12 +366,19 @@ BLEDevice::accumulateAdvertisingPayloadTxPower(int8_t txPower)
}
inline ble_error_t
BLEDevice::accumulateAdvertisingPayload(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
BLEDevice::accumulateAdvertisingPayload(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
{
needToSetAdvPayload = true;
return advPayload.addData(type, data, len);
}
inline ble_error_t
BLEDevice::accumulateScanResponse(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
{
needToSetAdvPayload = true;
return scanResponse.addData(type, data, len);
}
inline ble_error_t
BLEDevice::setAdvertisingPayload(void) {
needToSetAdvPayload = false;