Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate BLE_ANCS_SDAPI_IRC ... more
Diff: public/UUID.h
- Revision:
- 464:c99b83a7ea55
- Parent:
- 463:fd7a5b8d81bd
- Child:
- 480:67700bd40bd3
diff -r fd7a5b8d81bd -r c99b83a7ea55 public/UUID.h
--- a/public/UUID.h Fri Jun 19 15:51:58 2015 +0100
+++ b/public/UUID.h Fri Jun 19 15:51:58 2015 +0100
@@ -43,8 +43,7 @@
* The 128-bit (16-byte) UUID value, MSB first (big-endian).
*/
UUID(const LongUUIDBytes_t longUUID) : type(UUID_TYPE_LONG), baseUUID(), shortUUID(0) {
- memcpy(baseUUID, longUUID, LENGTH_OF_LONG_UUID);
- shortUUID = (uint16_t)((longUUID[2] << 8) | (longUUID[3]));
+ setupLong(longUUID);
}
/**
@@ -87,6 +86,15 @@
/* empty */
}
+ /**
+ * Fill in a 128-bit UUID; this is useful when UUID isn't known at the time of object construction.
+ */
+ void setupLong(const LongUUIDBytes_t longUUID) {
+ type = UUID_TYPE_LONG;
+ memcpy(baseUUID, longUUID, LENGTH_OF_LONG_UUID);
+ shortUUID = (uint16_t)((longUUID[2] << 8) | (longUUID[3]));
+ }
+
public:
UUID_Type_t shortOrLong(void) const {return type; }
const uint8_t *getBaseUUID(void) const {