Coverage for src / bluetooth_sig / gatt / services / human_interface_device.py: 100%

6 statements  

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

1"""Human Interface Device Service implementation.""" 

2 

3from __future__ import annotations 

4 

5from typing import ClassVar 

6 

7from ..characteristics.registry import CharacteristicName 

8from .base import BaseGattService 

9 

10 

11class HumanInterfaceDeviceService(BaseGattService): 

12 """Human Interface Device Service implementation. 

13 

14 Contains characteristics related to HID: 

15 - HID Information - Required 

16 - HID Control Point - Required 

17 - Report Map - Required 

18 - Report - Required 

19 - Protocol Mode - Required 

20 - PnP ID - Optional 

21 """ 

22 

23 service_characteristics: ClassVar[dict[CharacteristicName, bool]] = { 

24 CharacteristicName.HID_INFORMATION: True, # required 

25 CharacteristicName.HID_CONTROL_POINT: True, # required 

26 CharacteristicName.REPORT_MAP: True, # required 

27 CharacteristicName.REPORT: True, # required 

28 CharacteristicName.PROTOCOL_MODE: True, # required 

29 # CharacteristicName.PNP_ID: False, # optional - not implemented yet 

30 }