LBLEUuid
Represents a 128-bit or 16-bit BT UUID.
This class represents BT UUIDs that are used to identifie characteristics and other BLE GATT attributes.
Many GATT Service and characteristic APIs relies on this class to identify different attributes.
This class supports the Printable interface and therefore can be passed to Serial.print.
Constructors
LBLEUuid()
There are 2 versions - a String version that creates 128-bit UUID, and an unsigned short version that creates 16-bit Assigned Number UUID.
Syntax
Parameters
String: Creates UUID from 128-bit string representation
uint16_t: Creates 16-bit Bluetooth assigned UUID. Creates an assigned 16-bit BT UUID from an unsigned short. In the example below, we create an UUID for "Device Information" service. See https://www.bluetooth.com/specifications/gatt/services for a list of assigned numbers for services.
Returns
LBLEUuid object
Methods
isEmpty()
is16Bit()
getUuid16()
Check if the UUID is empty (just created).
Syntax
Parameters
none
Returns
true if the UUID is empty; false if the UUID is not empty.
Check if this UUID is a 16-bit UUID.
Check if the UUID is an 16-bit UUID, which is assigned by BT SIG, or a generic, developer-generated 128-bit UUID.
Syntax
Parameters
none
Returns
true if the UUID is 16-bit assigned number. Note that this method does not check if the 16-bit is actually a BT SIG assigned number; it simply check if it is 16-bit long.false if the UUID is 128-bit UUID.
Get the unsigned short representation of a 16-bit assigned UUID.
Syntax
Parameters
none
Returns
unsigned short value of the 16-bit assigned UUID.
0 if the LBLEUuid is not a 16-bit UUID.
Last updated