Representation of a Universally Unique Identifier (UUID). More...
#include <UUID.h>
Public Types | |
typedef uint16_t | ShortUUIDBytes_t |
Type for a 16-bit UUID. More... | |
typedef uint8_t | LongUUIDBytes_t[LENGTH_OF_LONG_UUID] |
Type for a 128-bit UUID. More... | |
Public Member Functions | |
UUID (const char *stringUUID) | |
Construct a 128-bit UUID from a string. More... | |
UUID (const LongUUIDBytes_t longUUID, ByteOrder_t order=UUID::MSB) | |
Construct a new UUID from a 128-bit representation. More... | |
UUID (ShortUUIDBytes_t _shortUUID) | |
Creates a new 16-bit UUID. More... | |
UUID (const UUID &source) | |
UUID copy constructor. More... | |
UUID (void) | |
Default constructor. More... | |
void | setupLong (const LongUUIDBytes_t longUUID, ByteOrder_t order=UUID::MSB) |
Replace existing value with a 128-bit UUID. More... | |
UUID_Type_t | shortOrLong (void) const |
Return the internal type of the UUID. More... | |
const uint8_t * | getBaseUUID (void) const |
Get a pointer to the UUID value based on the current UUID type. More... | |
ShortUUIDBytes_t | getShortUUID (void) const |
Get the uint16_t value of the UUID. More... | |
uint8_t | getLen (void) const |
Get the length (in bytes) of the internal UUID representation. More... | |
bool | operator== (const UUID &other) const |
Equal to operator between UUIDs. More... | |
bool | operator!= (const UUID &other) const |
Not equal to operator. More... | |
Static Public Attributes | |
static const unsigned | LENGTH_OF_LONG_UUID = 16 |
Length in bytes of a long UUID. More... | |
static const unsigned | MAX_UUID_STRING_LENGTH = LENGTH_OF_LONG_UUID * 2 + 4 |
Maximum length for the string representation of a UUID excluding the null terminator. More... | |
Representation of a Universally Unique Identifier (UUID).
UUIDs are 128-bit wide numbers used to identify data type and elements in many layers of the Bluetooth specification.
Two representations of UUIDS exist:
This class acts as an adapter over these two kinds of UUIDs to allow indiscriminate use of both forms in Mbed BLE APIs.
typedef uint8_t LongUUIDBytes_t[LENGTH_OF_LONG_UUID] |
typedef uint16_t ShortUUIDBytes_t |
enum ByteOrder_t |
enum UUID_Type_t |
UUID | ( | const char * | stringUUID | ) |
Construct a 128-bit UUID from a string.
[in] | stringUUID | Human readable representation of the UUID following the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. |
UUID | ( | const LongUUIDBytes_t | longUUID, |
ByteOrder_t | order = UUID::MSB |
||
) |
UUID | ( | ShortUUIDBytes_t | _shortUUID | ) |
Creates a new 16-bit UUID.
The Bluetooth standard body defines 16-bit wide UUIDs. They are the shortened version of the UUID 0000xxxx-0000-1000-8000-00805F9B34FB, where xxxx is the value of the 16-bit UUID.
UUID | ( | void | ) |
Default constructor.
Construct an invalid UUID.
const uint8_t* getBaseUUID | ( | void | ) | const |
uint8_t getLen | ( | void | ) | const |
ShortUUIDBytes_t getShortUUID | ( | void | ) | const |
bool operator!= | ( | const UUID & | other | ) | const |
bool operator== | ( | const UUID & | other | ) | const |
void setupLong | ( | const LongUUIDBytes_t | longUUID, |
ByteOrder_t | order = UUID::MSB |
||
) |
UUID_Type_t shortOrLong | ( | void | ) | const |
|
static |
|
static |