src.bluetooth_sig.gatt.descriptors.base¶
Base class for GATT descriptors.
Attributes¶
Name | Description |
|---|---|
Classes¶
Name | Description |
|---|---|
Base class for all GATT descriptors. |
|
Mixin for descriptors that provide min/max value validation. |
Module Contents¶
- class src.bluetooth_sig.gatt.descriptors.base.BaseDescriptor¶
Bases:
abc.ABCBase class for all GATT descriptors.
Automatically resolves UUID and name from Bluetooth SIG registry. Provides parsing capabilities for descriptor values.
- _descriptor_name¶
Optional explicit descriptor name for registry lookup.
- _writable¶
Whether this descriptor type supports write operations. Override to True in writable descriptor subclasses (CCCD, SCCD).
Note
Most descriptors are read-only per Bluetooth SIG specification. Some like CCCD (0x2902) and SCCD (0x2903) support writes.
- is_writable() bool¶
Check if descriptor type supports write operations.
- Returns:
True if descriptor type supports writes, False otherwise.
Note
Only checks descriptor type, not runtime permissions or security. Example writable descriptors (CCCD, SCCD) override _writable = True.
- parse_value(data: bytes) src.bluetooth_sig.types.DescriptorData¶
Parse raw descriptor data into structured format.
- Parameters:
data – Raw bytes from the descriptor read
- Returns:
DescriptorData object with parsed value and metadata
- property info: src.bluetooth_sig.types.DescriptorInfo¶
Get the descriptor information.
- property uuid: src.bluetooth_sig.types.uuid.BluetoothUUID¶
Get the descriptor UUID.
- class src.bluetooth_sig.gatt.descriptors.base.RangeDescriptorMixin¶
Mixin for descriptors that provide min/max value validation.
- get_max_value(data: bytes) int | float¶
Get the maximum valid value.
- Parameters:
data – Raw descriptor data
- Returns:
Maximum valid value for the characteristic
- src.bluetooth_sig.gatt.descriptors.base.logger¶