src.bluetooth_sig.registry.gss¶
GSS (GATT Service Specification) registry.
This module provides a registry for Bluetooth SIG GSS YAML files, extracting characteristic specifications with field metadata including units, resolutions, value ranges, and presence conditions.
Attributes¶
Name | Description |
|---|---|
Classes¶
Name | Description |
|---|---|
Registry for GSS (GATT Service Specification) characteristic definitions. |
Module Contents¶
- class src.bluetooth_sig.registry.gss.GssRegistry¶
Bases:
bluetooth_sig.registry.base.BaseGenericRegistry[bluetooth_sig.types.registry.gss_characteristic.GssCharacteristicSpec]Registry for GSS (GATT Service Specification) characteristic definitions.
Parses Bluetooth SIG GSS YAML files and extracts typed characteristic specifications with full field metadata. Implements singleton pattern with thread-safe lazy loading.
Example
registry = GssRegistry.get_instance() spec = registry.get_spec(“Battery Level”) if spec:
- for field in spec.structure:
print(f”{field.python_name}: {field.unit_id}”)
- extract_info_from_gss(char_data: dict[str, Any]) tuple[str | None, str | None]¶
Extract unit and value_type from GSS characteristic structure.
- Parameters:
char_data – Raw characteristic data from YAML
- Returns:
Tuple of (unit_symbol, value_type) or (None, None) if not found
- get_all_specs() dict[str, bluetooth_sig.types.registry.gss_characteristic.GssCharacteristicSpec]¶
Get all loaded GSS specifications.
- Returns:
Dictionary of all specifications keyed by name and ID
- classmethod get_instance() GssRegistry¶
Get the singleton instance of the GSS registry.
- get_spec(identifier: str) bluetooth_sig.types.registry.gss_characteristic.GssCharacteristicSpec | None¶
Get a GSS specification by name or ID.
- Parameters:
identifier – Characteristic name or ID
- Returns:
GssCharacteristicSpec if found, None otherwise
- src.bluetooth_sig.registry.gss.gss_registry = None¶