src.bluetooth_sig.core.registration¶
Custom characteristic and service registration manager.
Provides runtime registration of custom characteristic and service classes into the SIG registries. Stateless — writes to global registries.
Classes¶
Name | Description |
|---|---|
Handles runtime registration of custom characteristics and services. |
Module Contents¶
- class src.bluetooth_sig.core.registration.RegistrationManager¶
Handles runtime registration of custom characteristics and services.
All registrations write to the global CharacteristicRegistry, GattServiceRegistry, and uuid_registry singletons.
- static register_custom_characteristic_class(uuid_or_name: str, cls: type[src.bluetooth_sig.gatt.characteristics.base.BaseCharacteristic[Any]], info: src.bluetooth_sig.types.CharacteristicInfo | None = None, override: bool = False) None¶
Register a custom characteristic class at runtime.
- Parameters:
uuid_or_name – The characteristic UUID or name
cls – The characteristic class to register
info – Optional CharacteristicInfo with metadata (name, unit, value_type)
override – Whether to override existing registrations
- Raises:
TypeError – If cls does not inherit from BaseCharacteristic
ValueError – If UUID conflicts with existing registration and override=False
- static register_custom_service_class(uuid_or_name: str, cls: type[src.bluetooth_sig.gatt.services.base.BaseGattService], info: src.bluetooth_sig.types.ServiceInfo | None = None, override: bool = False) None¶
Register a custom service class at runtime.
- Parameters:
uuid_or_name – The service UUID or name
cls – The service class to register
info – Optional ServiceInfo with metadata (name)
override – Whether to override existing registrations
- Raises:
TypeError – If cls does not inherit from BaseGattService
ValueError – If UUID conflicts with existing registration and override=False