src.bluetooth_sig.gatt.characteristics.device_time

Device Time characteristic (0x2B90).

Per DTS v1.0 Table 3.6, this characteristic uses epoch-based Base_Time (uint32 seconds since 1900-01-01 or 2000-01-01 per DT_Status bit 4), NOT the 7-byte Date-Time format used by other time characteristics.

Mandatory field layout (8 octets minimum, without E2E_CRC prefix):

Offset Field Type Octets Unit 0 Base_Time uint32 4 seconds since epoch 4 Time_Zone sint8 1 15-minute units (-48..+56) 5 DST_Offset uint8 1 0=Std, 2=+0.5h, 4=+1h, 8=+2h, 255=Unknown 6 DT_Status uint16 2 status bitfield (Table 3.7)

Optional trailing fields (present when corresponding feature flags are set):

User_Time (uint32), Accumulated_RTC_Drift (uint16), Next_Sequence_Number (uint16), Base_Time_Second_Fractions (uint16).

Total: 8-20 octets (without E2E_CRC).

References

Bluetooth SIG Device Time Service v1.0, Table 3.6, Table 3.7

Classes

Name

Description

DTStatus

DT_Status bitfield — DTS v1.0 Table 3.7.

DeviceTimeCharacteristic

Device Time characteristic (0x2B90).

DeviceTimeData

Parsed data from Device Time characteristic.

Module Contents

class src.bluetooth_sig.gatt.characteristics.device_time.DTStatus

Bases: enum.IntFlag

DT_Status bitfield — DTS v1.0 Table 3.7.

Bits 7-15 are Reserved for Future Use.

EPOCH_YEAR_2000 = 16
LOG_CONSOLIDATION_ACTIVE = 64
NON_LOGGED_TIME_CHANGE_ACTIVE = 32
PROPOSE_TIME_UPDATE_REQUEST = 8
QUALIFIED_LOCAL_TIME_SYNCHRONIZED = 4
TIME_FAULT = 1
UTC_ALIGNED = 2
class src.bluetooth_sig.gatt.characteristics.device_time.DeviceTimeCharacteristic

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

Device Time characteristic (0x2B90).

org.bluetooth.characteristic.device_time

Contains epoch-based Base_Time (uint32), Time_Zone (sint8), DST_Offset (uint8), and DT_Status (uint16 bitfield). Optional fields follow when their corresponding feature bits are set in the DT Feature characteristic.

allow_variable_length = True
min_length = 8
class src.bluetooth_sig.gatt.characteristics.device_time.DeviceTimeData

Bases: msgspec.Struct

Parsed data from Device Time characteristic.

base_time

Seconds since epoch (1900 or 2000 per DTStatus.EPOCH_YEAR_2000).

time_zone

Offset in 15-minute units (sint8, -48..+56).

dst_offset

DST offset (0=Std, 2=+0.5h, 4=+1h, 8=+2h, 255=Unknown).

dt_status

Device Time status bitfield (Table 3.7).

user_time

Optional seconds since epoch for user-facing display time.

accumulated_rtc_drift

Optional accumulated RTC drift in seconds.

next_sequence_number

Optional next time-change log sequence number.

base_time_second_fractions

Optional sub-second fractions (1/65536 s).

accumulated_rtc_drift: int | None = None
base_time: int
base_time_second_fractions: int | None = None
dst_offset: int
dt_status: DTStatus
next_sequence_number: int | None = None
time_zone: int
user_time: int | None = None