src.bluetooth_sig.gatt.uuid_registry

UUID registry loading from Bluetooth SIG YAML files.

Attributes

Name

Description

uuid_registry

Classes

Name

Description

UuidRegistry

Registry for Bluetooth SIG UUIDs with canonical storage + alias indices.

Module Contents

class src.bluetooth_sig.gatt.uuid_registry.UuidRegistry

Registry for Bluetooth SIG UUIDs with canonical storage + alias indices.

This registry stores a number of internal caches and mappings which legitimately exceed the default pylint instance attribute limit. The complexity is intentional and centralised; an inline disable is used to avoid noisy global configuration changes.

clear_custom_registrations() None

Clear all custom registrations (for testing).

static get_byte_order_hint() str

Get byte order hint for Bluetooth SIG specifications.

Returns:

“little” - Bluetooth SIG uses little-endian by convention

get_characteristic_info(identifier: str | bluetooth_sig.types.uuid.BluetoothUUID) bluetooth_sig.types.CharacteristicInfo | None

Get information about a characteristic by UUID, name, or ID.

get_descriptor_info(identifier: str | bluetooth_sig.types.uuid.BluetoothUUID) bluetooth_sig.types.registry.descriptor_types.DescriptorInfo | None

Get information about a descriptor by UUID, name, or ID.

get_gss_spec(identifier: str | bluetooth_sig.types.uuid.BluetoothUUID) bluetooth_sig.types.registry.gss_characteristic.GssCharacteristicSpec | None

Get the full GSS characteristic specification with all field metadata.

This provides access to the complete YAML structure including all fields, their units, resolutions, ranges, and presence conditions.

Parameters:

identifier – Characteristic name, ID, or UUID

Returns:

GssCharacteristicSpec with full field structure, or None if not found

Example

gss = uuid_registry.get_gss_spec(“Location and Speed”) if gss:

for field in gss.structure:

print(f”{field.python_name}: unit={field.unit_id}, resolution={field.resolution}”)

get_service_info(key: str | bluetooth_sig.types.uuid.BluetoothUUID) bluetooth_sig.types.ServiceInfo | None

Get information about a service by UUID, name, or ID.

get_signed_from_data_type(data_type: str | None) bool

Determine if data type is signed from GSS data type.

Parameters:

data_type – GSS data type string (e.g., “sint16”, “float32”, “uint8”)

Returns:

True if the type represents signed values, False otherwise

register_characteristic(uuid: bluetooth_sig.types.uuid.BluetoothUUID, name: str, identifier: str | None = None, unit: str | None = None, value_type: bluetooth_sig.types.gatt_enums.ValueType | None = None, override: bool = False) None

Register a custom characteristic at runtime.

Parameters:
  • uuid – The Bluetooth UUID for the characteristic

  • name – Human-readable name

  • identifier – Optional identifier (auto-generated if not provided)

  • unit – Optional unit of measurement

  • value_type – Optional value type

  • override – If True, allow overriding existing entries

register_service(uuid: bluetooth_sig.types.uuid.BluetoothUUID, name: str, identifier: str | None = None, override: bool = False) None

Register a custom service at runtime.

Parameters:
  • uuid – The Bluetooth UUID for the service

  • name – Human-readable name

  • identifier – Optional identifier (auto-generated if not provided)

  • override – If True, allow overriding existing entries

resolve_characteristic_spec(characteristic_name: str) src.bluetooth_sig.types.registry.CharacteristicSpec | None

Resolve characteristic specification with rich YAML metadata.

This method provides detailed characteristic information including data types, field sizes, units, and descriptions by cross-referencing multiple YAML sources.

Parameters:

characteristic_name – Name of the characteristic (e.g., “Temperature”, “Battery Level”)

Returns:

CharacteristicSpec with full metadata, or None if not found

Example

spec = uuid_registry.resolve_characteristic_spec(“Temperature”) if spec:

print(f”UUID: {spec.uuid}, Unit: {spec.unit_symbol}, Type: {spec.data_type}”)

src.bluetooth_sig.gatt.uuid_registry.uuid_registry