src.bluetooth_sig.types.context

Context objects used during characteristic parsing.

Classes

Name

Description

CharacteristicContext

Runtime context passed into parsers - INPUT only.

DeviceInfo

Basic device metadata available to parsers.

Module Contents

class src.bluetooth_sig.types.context.CharacteristicContext

Bases: msgspec.Struct

Runtime context passed into parsers - INPUT only.

This provides the parsing context (device info, other characteristics for dependencies, etc.) but does NOT contain output fields. Descriptors have their own separate parsing flow.

device_info

Basic device metadata (address, name, manufacturer data).

advertisement

Raw advertisement bytes if available.

other_characteristics

Mapping from characteristic UUID string to previously-parsed characteristic result. Parsers may consult this mapping to implement multi-characteristic decoding.

descriptors

Mapping from descriptor UUID string to parsed descriptor data. Provides access to characteristic descriptors during parsing.

raw_service

Optional raw service-level payload when applicable.

advertisement: bytes = b''
descriptors: collections.abc.Mapping[str, src.bluetooth_sig.types.registry.descriptor_types.DescriptorData] | None = None
device_info: DeviceInfo | None = None
other_characteristics: collections.abc.Mapping[str, Any] | None = None
raw_service: bytes = b''
class src.bluetooth_sig.types.context.DeviceInfo

Bases: msgspec.Struct

Basic device metadata available to parsers.

address: str = ''
manufacturer_data: dict[int, bytes]
name: str = ''
service_uuids: list[src.bluetooth_sig.types.uuid.BluetoothUUID]