Coverage for src / bluetooth_sig / gatt / characteristics / time_source.py: 100%
15 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 20:14 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 20:14 +0000
1"""Time Source characteristic implementation."""
3from __future__ import annotations
5from enum import IntEnum
7from .base import BaseCharacteristic
8from .templates import EnumTemplate
11class TimeSource(IntEnum):
12 """Time source enumeration.
14 Indicates the type of time source used for reference time.
15 """
17 UNKNOWN = 0
18 NETWORK_TIME_PROTOCOL = 1 # NTP, SNTP
19 GPS = 2 # GPS, Galileo, GLONASS, BeiDou
20 RADIO_TIME_SIGNAL = 3 # Atomic clock synchronized through RF
21 MANUAL = 4 # Manually set time
22 ATOMIC_CLOCK = 5 # Legacy, usually same as RADIO_TIME_SIGNAL
23 CELLULAR_NETWORK = 6 # GSM, CDMA, 4G
24 NOT_SYNCHRONIZED = 7
27class TimeSourceCharacteristic(BaseCharacteristic[int]):
28 """Time Source characteristic (0x2A13).
30 org.bluetooth.characteristic.time_source
32 Indicates the source of the time information as an 8-bit enumeration.
33 """
35 _template = EnumTemplate.uint8(TimeSource)