src.bluetooth_sig.gatt.characteristics.reference_time_information

Reference Time Information characteristic (0x2A14) implementation.

Provides information about the reference time source, including its type, accuracy, and time since last update.

Based on Bluetooth SIG GATT Specification: - Reference Time Information: 4 bytes (Time Source + Time Accuracy + Days Since Update + Hours Since Update) - Time Source: uint8 (0=Unknown, 1=NTP, 2=GPS, etc.) - Time Accuracy: uint8 (0-253 in 125ms steps, 254=out of range, 255=unknown) - Days Since Update: uint8 (0-254, 255 means >=255 days) - Hours Since Update: uint8 (0-23, 255 means >=255 days)

Attributes

Classes

Name

Description

ReferenceTimeInformationCharacteristic

Reference Time Information characteristic (0x2A14).

ReferenceTimeInformationData

Reference Time Information characteristic data structure.

TimeSource

Time source enumeration per Bluetooth SIG specification.

Module Contents

class src.bluetooth_sig.gatt.characteristics.reference_time_information.ReferenceTimeInformationCharacteristic

Bases: src.bluetooth_sig.gatt.characteristics.base.BaseCharacteristic[ReferenceTimeInformationData]

Reference Time Information characteristic (0x2A14).

Represents information about the reference time source including type, accuracy, and time elapsed since last synchronization.

Structure (4 bytes): - Time Source: uint8 (0=Unknown, 1=NTP, 2=GPS, 3=Radio, 4=Manual, 5=Atomic, 6=Cellular, 7=Not Sync) - Time Accuracy: uint8 (0-253 in 125ms steps, 254=out of range >31.625s, 255=unknown) - Days Since Update: uint8 (0-254 days, 255 means >=255 days) - Hours Since Update: uint8 (0-23 hours, 255 means >=255 days)

Used by Current Time Service (0x1805).

expected_length: int = 4
class src.bluetooth_sig.gatt.characteristics.reference_time_information.ReferenceTimeInformationData

Bases: msgspec.Struct

Reference Time Information characteristic data structure.

days_since_update: int
hours_since_update: int
time_accuracy: int
time_source: TimeSource
class src.bluetooth_sig.gatt.characteristics.reference_time_information.TimeSource

Bases: enum.IntEnum

Time source enumeration per Bluetooth SIG specification.

ATOMIC_CLOCK = 5
CELLULAR_NETWORK = 6
GPS = 2
MANUAL = 4
NETWORK_TIME_PROTOCOL = 1
NOT_SYNCHRONIZED = 7
RADIO_TIME_SIGNAL = 3
UNKNOWN = 0
src.bluetooth_sig.gatt.characteristics.reference_time_information.HOURS_SINCE_UPDATE_MAX = 23
src.bluetooth_sig.gatt.characteristics.reference_time_information.HOURS_SINCE_UPDATE_OUT_OF_RANGE = 255
src.bluetooth_sig.gatt.characteristics.reference_time_information.REFERENCE_TIME_INFO_LENGTH = 4
src.bluetooth_sig.gatt.characteristics.reference_time_information.TIME_SOURCE_MAX = 7