blatann.uuid module

class blatann.uuid.Uuid(nrf_uuid=None, description='')

Bases: object

Base class for UUIDs

property descriptive_string: str
class blatann.uuid.Uuid128(uuid, description='')

Bases: Uuid

Represents a 128-bit UUID

property uuid_base: List[int]

Read Only

The base of the 128-bit UUID which can be used to create other UUIDs with the same base

property uuid16: int

Read Only

The 16-bit representation of the 128-bit UUID

new_uuid_from_base(uuid16)

Creates a new 128-bit UUID with the same base as this UUID, replacing out the 16-bit individual identifier with the value provided

Parameters

uuid16 (Union[str, int, Uuid16]) – The new 16-bit UUID to append to the base. Should either be a 16-bit integer, a hex string of the value (without the leading ‘0x’), or a Uuid16 object

Return type

Uuid128

Returns

The newly created UUID

classmethod combine_with_base(uuid16, uuid128_base)

Combines a 16-bit UUID with a 128-bit UUID base and returns the new UUID

Parameters
  • uuid16 (Union[str, int, Uuid16]) – The 16-bit UUID to use. See new_uuid_from_base for format.

  • uuid128_base (Union[str, bytes, List[int]]) – The 128-bit base UUID to use. See __init__ for format.

Return type

Uuid128

Returns

The created UUID

class blatann.uuid.Uuid16(uuid, description='')

Bases: Uuid

Represents a 16-bit “short form” UUID

blatann.uuid.generate_random_uuid16()

Generates a random 16-bit UUID

Return type

Uuid16

Returns

The generated 16-bit UUID

blatann.uuid.generate_random_uuid128()

Generates a random 128-bit UUID

Return type

Uuid128

Returns

The generated 128-bit UUID