src.bluetooth_sig.gatt.characteristics.current_elapsed_time

Current Elapsed Time characteristic implementation.

Implements the Current Elapsed Time characteristic (0x2BF2).

Structure (from GSS YAML - org.bluetooth.characteristic.elapsed_time):

Flags (uint8, 1 byte) – interpretation flags Time Value (uint48, 6 bytes) – counter in time-resolution units Time Sync Source Type (uint8, 1 byte) – sync source enum TZ/DST Offset (sint8, 1 byte) – combined offset in 15-minute units

Note: The GSS YAML identifier is elapsed_time but the UUID registry identifier is current_elapsed_time (0x2BF2). File is named to match the UUID registry for auto-discovery.

Flag bits:

0: Tick counter (0=time of day, 1=relative counter) 1: UTC (0=local time, 1=UTC) — meaningless for tick counter 2-3: Time resolution (00=1s, 01=100ms, 10=1ms, 11=100µs) 4: TZ/DST offset used (0=not used, 1=used) 5: Current timeline (0=not current, 1=current) 6-7: Reserved

References

Bluetooth SIG Generic Sensor Service org.bluetooth.characteristic.elapsed_time (GSS YAML)

Classes

Name

Description

CurrentElapsedTimeCharacteristic

Current Elapsed Time characteristic (0x2BF2).

CurrentElapsedTimeData

Parsed data from Current Elapsed Time characteristic.

ElapsedTimeFlags

Flags for the Elapsed Time characteristic.

TimeResolution

Time resolution values (bits 2-3 of flags).

Module Contents

class src.bluetooth_sig.gatt.characteristics.current_elapsed_time.CurrentElapsedTimeCharacteristic(info: src.bluetooth_sig.types.CharacteristicInfo | None = None, validation: src.bluetooth_sig.gatt.characteristics.characteristic_meta.ValidationConfig | None = None)

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

Current Elapsed Time characteristic (0x2BF2).

Reports the current time of a clock or tick counter. Fixed 9-byte structure.

expected_type
min_length: int = 9
class src.bluetooth_sig.gatt.characteristics.current_elapsed_time.CurrentElapsedTimeData

Bases: msgspec.Struct

Parsed data from Current Elapsed Time characteristic.

flags

Interpretation flags.

time_value

Counter value in the resolution defined by flags.

time_resolution

Resolution of the time value.

is_tick_counter

True if time_value is a relative counter.

is_utc

True if time_value reports UTC (only meaningful if not tick counter).

tz_dst_used

True if tz_dst_offset is meaningful.

is_current_timeline

True if time stamp is from the current timeline.

sync_source_type

Time synchronisation source type.

tz_dst_offset

Combined TZ/DST offset from UTC in 15-minute units.

flags: ElapsedTimeFlags
is_current_timeline: bool
is_tick_counter: bool
is_utc: bool
sync_source_type: src.bluetooth_sig.gatt.characteristics.reference_time_information.TimeSource
time_resolution: TimeResolution
time_value: int
tz_dst_offset: int
tz_dst_used: bool
class src.bluetooth_sig.gatt.characteristics.current_elapsed_time.ElapsedTimeFlags

Bases: enum.IntFlag

Flags for the Elapsed Time characteristic.

CURRENT_TIMELINE = 32
TICK_COUNTER = 1
TZ_DST_USED = 16
UTC = 2
class src.bluetooth_sig.gatt.characteristics.current_elapsed_time.TimeResolution

Bases: enum.IntEnum

Time resolution values (bits 2-3 of flags).

HUNDRED_MICROSECONDS = 3
HUNDRED_MILLISECONDS = 1
ONE_MILLISECOND = 2
ONE_SECOND = 0