Skip to content

Commit 8c0e55c

Browse files
author
Rohit Grover
committed
add accumulateScanResponse() to BLEDevice.h
1 parent ddfdb06 commit 8c0e55c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

hw/BLEDevice.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,16 @@ class BLEDevice
183183
*/
184184
ble_error_t accumulateAdvertisingPayload(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len);
185185

186+
/**
187+
* Accumulate a variable length byte-stream as an AD structure in the
188+
* scanResponse payload.
189+
*
190+
* @param type The type which describes the variable length data.
191+
* @param data data bytes.
192+
* @param len length of data.
193+
*/
194+
ble_error_t accumulateScanResponse(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len);
195+
186196
/**
187197
* Start advertising (GAP Discoverable, Connectable modes, Broadcast
188198
* Procedure).
@@ -356,12 +366,19 @@ BLEDevice::accumulateAdvertisingPayloadTxPower(int8_t txPower)
356366
}
357367

358368
inline ble_error_t
359-
BLEDevice::accumulateAdvertisingPayload(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
369+
BLEDevice::accumulateAdvertisingPayload(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
360370
{
361371
needToSetAdvPayload = true;
362372
return advPayload.addData(type, data, len);
363373
}
364374

375+
inline ble_error_t
376+
BLEDevice::accumulateScanResponse(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len)
377+
{
378+
needToSetAdvPayload = true;
379+
return scanResponse.addData(type, data, len);
380+
}
381+
365382
inline ble_error_t
366383
BLEDevice::setAdvertisingPayload(void) {
367384
needToSetAdvPayload = false;

0 commit comments

Comments
 (0)