UUID – BLE UUID

A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more.

class bleio.UUID(value)

Create a new UUID or UUID object encapsulating the uuid value. The value can be one of:

  • an int value in range 0 to 0xFFFF (Bluetooth SIG 16-bit UUID)
  • a buffer object (bytearray, bytes) of 16 bytes in little-endian order (128-bit UUID)
Parameters:value (int/buffer) – The uuid value to encapsulate
uuid16

The 16-bit part of the UUID. (read-only)

uuid128

The 128-bit value of the UUID, returned as bytes. Raises AttributeError if this is a 16-bit UUID. (read-only)

size

Returns 128 if this UUID represents a 128-bit vendor-specific UUID. Returns 16 if this UUID represents a 16-bit Bluetooth SIG assigned UUID. (read-only) 32-bit UUIDs are not currently supported.