mirror of https://github.com/ARMmbed/mbed-os.git
BLE: return immutable buffer from AdvertisingDataBuilder::getAdvertisingData
parent
dfa7749d8a
commit
87f36450f5
|
@ -547,7 +547,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return A Span containing the payload.
|
* @return A Span containing the payload.
|
||||||
*/
|
*/
|
||||||
mbed::Span<uint8_t> getAdvertisingData() const;
|
mbed::Span<const uint8_t> getAdvertisingData() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new field into the payload. Will return an error if type is already present.
|
* Add a new field into the payload. Will return an error if type is already present.
|
||||||
|
|
|
@ -28,7 +28,7 @@ AdvertisingDataBuilder::AdvertisingDataBuilder(uint8_t* buffer, size_t buffer_si
|
||||||
_payload_length(0) {
|
_payload_length(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
mbed::Span<uint8_t> AdvertisingDataBuilder::getAdvertisingData() const {
|
mbed::Span<const uint8_t> AdvertisingDataBuilder::getAdvertisingData() const {
|
||||||
return _buffer.first(_payload_length);
|
return _buffer.first(_payload_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue