Coverage for src / bluetooth_sig / gatt / characteristics / on_demand_ranging_data.py: 100%
12 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-03 16:41 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-03 16:41 +0000
1"""On-demand Ranging Data characteristic (0x2C16).
3Variable-length on-demand ranging measurement data.
5References:
6 Bluetooth SIG Ranging Service
7"""
9from __future__ import annotations
11from ...types.gatt_enums import CharacteristicRole
12from ..context import CharacteristicContext
13from .base import BaseCharacteristic
16class OnDemandRangingDataCharacteristic(BaseCharacteristic[bytes]):
17 """On-demand Ranging Data characteristic (0x2C16).
19 org.bluetooth.characteristic.on_demand_ranging_data
21 Contains variable-length on-demand ranging measurement data.
22 """
24 _manual_role = CharacteristicRole.MEASUREMENT
25 min_length = 1
26 allow_variable_length = True
28 def _decode_value(
29 self, data: bytearray, ctx: CharacteristicContext | None = None, *, validate: bool = True
30 ) -> bytes:
31 return bytes(data)
33 def _encode_value(self, data: bytes) -> bytearray:
34 return bytearray(data)