Class BleUuid

extends Object
A BLE Universally Unique ID.
UUIDs are used to identify services, characteristics and descriptions.
UUIDs can have different sizes, with 16-bit and 128-bit the most common ones.
The 128-bit UUID is referred to as the vendor specific UUID. These must be used when making custom services or characteristics.
16-bit UUIDs of the form "XXXX" are short-hands for "0000XXXX-0000-1000-8000-00805F9B34FB", where "00000000-0000-1000-8000-00805F9B34FB" comes from the BLE standard and is called the "base UUID".
Similarly, a 32-bit UUID of the form "XXXXXXXX" is a short-hand for "XXXXXXXX-0000-1000-8000-00805F9B34FB".

Class summary


constructor data/Data
Constructs a new UUID from a byte array or a string.

Constructors

Constructs a new UUID from a byte array or a string.
Does not check if a UUID can be shrunk by using the base UUID.

Statics

Constructs a new UUID from a 16-bit UUID where the bytes are reversed.

Methods

The size, in bits, of the UUID.

The size, in bytes, of the UUID.

Returns a string representation of this UUID.
If a deterministic UUID string representation is needed, prefer using to-string.

to-byte-array --reversed/bool=false -> ByteArray
Returns the UUID as a byte array.
The result is 2 bytes long for 16-bit UUIDs, 4 bytes long for 32-bit UUIDs, and 16 bytes long for 128-bit UUIDs.

Returns the UUID as a string of the form "XXXX" (16-bit UUID), "XXXXXXXX" (32-bit UUID), or "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" (other UUIDs).