Coverage for src / bluetooth_sig / gatt / characteristics / ap_sync_key_material.py: 100%
9 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"""AP Sync Key Material characteristic (0x2BF7).
316-byte key material for AP synchronisation.
5References:
6 Bluetooth SIG Common Audio Profile specification
7"""
9from __future__ import annotations
11from ..context import CharacteristicContext
12from .base import BaseCharacteristic
15class APSyncKeyMaterialCharacteristic(BaseCharacteristic[bytes]):
16 """AP Sync Key Material characteristic (0x2BF7).
18 org.bluetooth.characteristic.ap_sync_key_material
20 16-byte key material used for audio profile synchronisation.
21 """
23 expected_length = 16
25 def _decode_value(
26 self, data: bytearray, ctx: CharacteristicContext | None = None, *, validate: bool = True
27 ) -> bytes:
28 return bytes(data[:16])
30 def _encode_value(self, data: bytes) -> bytearray:
31 return bytearray(data[:16].ljust(16, b"\x00"))