mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-02-03 21:55:09 +01:00
[Breaking] Refactor NimBLEUUID.
* msbFirst parameter has been removed from constructor as it was unnecessary, caller should reverse the data first or call the new `reverseByteOrder` method after. * `getNative` method replaced with `getBase` which returns a read-only pointer to the UUID size underlying. * Added `reverseByteOrder` method, this will reverse the bytes of the UUID, which can be useful for advertising/logging. * Added `getValue` method, which returns a read-only `uint8_t` pointer to the UUID value. * Removed `m_valueSet` member variable, `bitSize()` can be used as a replacement. * General code cleanup.
This commit is contained in:
@@ -176,7 +176,11 @@ void NimBLEEddystoneTLM::setData(const std::string &data) {
|
||||
* @param [in] l_uuid The UUID.
|
||||
*/
|
||||
void NimBLEEddystoneTLM::setUUID(const NimBLEUUID &l_uuid) {
|
||||
beaconUUID = l_uuid.getNative()->u16.value;
|
||||
if (l_uuid.bitSize() != 16) {
|
||||
NIMBLE_LOGE(LOG_TAG, "UUID must be 16 bits");
|
||||
return;
|
||||
}
|
||||
beaconUUID = *reinterpret_cast<const uint16_t*>(l_uuid.getValue());
|
||||
} // setUUID
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user