Coverage for src / bluetooth_sig / gatt / characteristics / service_cycle_data.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-03 16:41 +0000

1"""Service Cycle Data characteristic (0x2C11). 

2 

3Variable-length service cycle data record from an Industrial Monitoring Device. 

4 

5References: 

6 Bluetooth SIG Industrial Monitoring Device Service 

7""" 

8 

9from __future__ import annotations 

10 

11from ...types.gatt_enums import CharacteristicRole 

12from ..context import CharacteristicContext 

13from .base import BaseCharacteristic 

14 

15 

16class ServiceCycleDataCharacteristic(BaseCharacteristic[bytes]): 

17 """Service Cycle Data characteristic (0x2C11). 

18 

19 org.bluetooth.characteristic.service_cycle_data 

20 

21 Contains variable-length service cycle data from an Industrial Monitoring Device. 

22 """ 

23 

24 _manual_role = CharacteristicRole.INFO 

25 min_length = 1 

26 allow_variable_length = True 

27 

28 def _decode_value( 

29 self, data: bytearray, ctx: CharacteristicContext | None = None, *, validate: bool = True 

30 ) -> bytes: 

31 return bytes(data) 

32 

33 def _encode_value(self, data: bytes) -> bytearray: 

34 return bytearray(data)