src.bluetooth_sig.registry.utils

Common utilities for registry modules.

Functions

Name

Description

find_bluetooth_sig_path(→ pathlib.Path | None)

Find the Bluetooth SIG assigned_numbers directory.

load_yaml_uuids(→ list[dict[str, Any]])

Load UUID entries from a YAML file.

normalize_uuid_string(→ str)

Normalize a UUID string or int to uppercase hex without 0x prefix.

parse_bluetooth_uuid(...)

Parse various UUID formats into a BluetoothUUID.

Module Contents

src.bluetooth_sig.registry.utils.find_bluetooth_sig_path() pathlib.Path | None

Find the Bluetooth SIG assigned_numbers directory.

Returns:

Path to the uuids directory, or None if not found

src.bluetooth_sig.registry.utils.load_yaml_uuids(file_path: pathlib.Path) list[dict[str, Any]]

Load UUID entries from a YAML file.

Parameters:

file_path – Path to the YAML file

Returns:

List of UUID entry dictionaries

src.bluetooth_sig.registry.utils.normalize_uuid_string(uuid: str | int) str

Normalize a UUID string or int to uppercase hex without 0x prefix.

Parameters:

uuid – UUID as string (with or without 0x) or int

Returns:

Normalized UUID string

src.bluetooth_sig.registry.utils.parse_bluetooth_uuid(uuid: str | int | bluetooth_sig.types.uuid.BluetoothUUID) bluetooth_sig.types.uuid.BluetoothUUID

Parse various UUID formats into a BluetoothUUID.

Parameters:

uuid – UUID as string (with or without 0x), int, or BluetoothUUID

Returns:

BluetoothUUID instance

Raises:

ValueError – If UUID format is invalid