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

19 statements  

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

1"""HTTP Control Point characteristic (0x2ABA).""" 

2 

3from __future__ import annotations 

4 

5from enum import IntEnum 

6 

7from .base import BaseCharacteristic 

8from .templates import EnumTemplate 

9 

10 

11class HTTPControlPointOpCode(IntEnum): 

12 """HTTP Control Point operation codes per HPS specification.""" 

13 

14 HTTP_GET_REQUEST = 0x01 

15 HTTP_HEAD_REQUEST = 0x02 

16 HTTP_POST_REQUEST = 0x03 

17 HTTP_PUT_REQUEST = 0x04 

18 HTTP_DELETE_REQUEST = 0x05 

19 HTTPS_GET_REQUEST = 0x06 

20 HTTPS_HEAD_REQUEST = 0x07 

21 HTTPS_POST_REQUEST = 0x08 

22 HTTPS_PUT_REQUEST = 0x09 

23 HTTPS_DELETE_REQUEST = 0x0A 

24 HTTP_REQUEST_CANCEL = 0x0B 

25 

26 

27class HTTPControlPointCharacteristic(BaseCharacteristic[HTTPControlPointOpCode]): 

28 """HTTP Control Point characteristic (0x2ABA). 

29 

30 org.bluetooth.characteristic.http_control_point 

31 

32 Used to initiate HTTP requests on the HTTP Proxy Service. 

33 """ 

34 

35 expected_length: int = 1 

36 _template = EnumTemplate.uint8(HTTPControlPointOpCode)