src.bluetooth_sig.gatt.characteristics.battery_time_status

Battery Time Status characteristic implementation.

Implements the Battery Time Status characteristic (0x2BEE) from the Battery Service. An 8-bit flags field controls the presence of optional time fields.

All flag bits use normal logic (1 = present, 0 = absent).

The mandatory “Time until Discharged” field and both optional time fields use uint24 in minutes. Two sentinel values are defined:

  • 0xFFFFFF: Unknown

  • 0xFFFFFE: Greater than 0xFFFFFD

References

Bluetooth SIG Battery Service 1.1 org.bluetooth.characteristic.battery_time_status (GSS YAML)

Classes

Name

Description

BatteryTimeStatus

Parsed data from Battery Time Status characteristic.

BatteryTimeStatusCharacteristic

Battery Time Status characteristic (0x2BEE).

BatteryTimeStatusFlags

Battery Time Status flags as per Bluetooth SIG specification.

Module Contents

class src.bluetooth_sig.gatt.characteristics.battery_time_status.BatteryTimeStatus

Bases: msgspec.Struct

Parsed data from Battery Time Status characteristic.

flags

Raw 8-bit flags field.

time_until_discharged

Estimated minutes until discharged. None if raw == 0xFFFFFF (Unknown).

time_until_discharged_on_standby

Minutes until discharged on standby. None if absent or raw == 0xFFFFFF (Unknown).

time_until_recharged

Minutes until recharged. None if absent or raw == 0xFFFFFF (Unknown).

flags: BatteryTimeStatusFlags
time_until_discharged: int | None = None
time_until_discharged_on_standby: int | None = None
time_until_recharged: int | None = None
class src.bluetooth_sig.gatt.characteristics.battery_time_status.BatteryTimeStatusCharacteristic(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[BatteryTimeStatus]

Battery Time Status characteristic (0x2BEE).

Reports estimated times for battery discharge and recharge.

Flag-bit assignments (from GSS YAML):

Bit 0: Time until Discharged on Standby present Bit 1: Time until Recharged present Bits 2-7: Reserved for Future Use

The mandatory “Time until Discharged” field is always present after flags.

allow_variable_length: bool = True
expected_type
min_length: int = 4
class src.bluetooth_sig.gatt.characteristics.battery_time_status.BatteryTimeStatusFlags

Bases: enum.IntFlag

Battery Time Status flags as per Bluetooth SIG specification.

DISCHARGED_ON_STANDBY_PRESENT = 1
RECHARGED_PRESENT = 2