Coverage for src / bluetooth_sig / gatt / characteristics / mesh_proxy_data_in.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"""Mesh Proxy Data In characteristic implementation."""
3from __future__ import annotations
5from ...types.gatt_enums import CharacteristicRole
6from ..context import CharacteristicContext
7from .base import BaseCharacteristic
10class MeshProxyDataInCharacteristic(BaseCharacteristic[bytes]):
11 """Mesh Proxy Data In characteristic (0x2ADD).
13 org.bluetooth.characteristic.mesh_proxy_data_in
15 Write-only characteristic for Mesh Proxy PDU passthrough.
16 Variable-length raw bytes written by the proxy client.
17 """
19 _manual_role = CharacteristicRole.CONTROL
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)