Coverage for src/bluetooth_sig/gatt/characteristics/mesh_proxy_data_out.py: 100%
12 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-06-28 01:26 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-06-28 01:26 +0000
1"""Mesh Proxy Data Out characteristic implementation."""
3from __future__ import annotations
5from ...types.gatt_enums import CharacteristicRole
6from ..context import CharacteristicContext
7from .base import BaseCharacteristic
10class MeshProxyDataOutCharacteristic(BaseCharacteristic[bytes]):
11 """Mesh Proxy Data Out characteristic (0x2ADE).
13 org.bluetooth.characteristic.mesh_proxy_data_out
15 Notify-only characteristic for Mesh Proxy PDU passthrough.
16 Variable-length raw bytes sent by the proxy server.
17 """
19 _manual_role = CharacteristicRole.STATUS
20 min_length: int = 1
21 allow_variable_length: bool = True
23 def _decode_value(
24 self,
25 data: bytearray,
26 ctx: CharacteristicContext | None = None,
27 *,
28 validate: bool = True,
29 ) -> bytes:
30 """Pass through raw proxy PDU bytes.
32 Args:
33 data: Raw bytes (variable length).
34 ctx: Optional CharacteristicContext.
35 validate: Whether to validate ranges (default True).
37 Returns:
38 Raw PDU bytes.
40 """
41 return bytes(data)
43 def _encode_value(self, data: bytes) -> bytearray:
44 """Encode raw proxy PDU bytes.
46 Args:
47 data: Raw PDU bytes.
49 Returns:
50 Encoded bytearray.
52 """
53 return bytearray(data)