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

11 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-11 20:14 +0000

1"""HID Control Point characteristic implementation.""" 

2 

3from __future__ import annotations 

4 

5from enum import IntEnum 

6 

7from .base import BaseCharacteristic 

8from .templates import EnumTemplate 

9 

10# Constants per Bluetooth HID specification 

11HID_CONTROL_POINT_DATA_LENGTH = 1 # Fixed data length: 1 byte 

12 

13 

14class HidControlPointCommand(IntEnum): 

15 """HID Control Point commands.""" 

16 

17 SUSPEND = 0 

18 EXIT_SUSPEND = 1 

19 

20 

21class HidControlPointCharacteristic(BaseCharacteristic[int]): 

22 """HID Control Point characteristic (0x2A4C). 

23 

24 org.bluetooth.characteristic.hid_control_point 

25 

26 HID Control Point characteristic. 

27 """ 

28 

29 _template = EnumTemplate.uint8(HidControlPointCommand) 

30 expected_length = HID_CONTROL_POINT_DATA_LENGTH