Module battery

Module battery 

Source
Expand description

Battery status snapshot codec (PROP_BATTERY).

The property value is either empty — the implementation reports no battery measurements at all — or one field-flags octet followed by the present fields in fixed order: voltage (UINT16_LE, millivolts), level (UINT8, percent), charge state (PUI). Reserved flag bits must be zero, and the value length must match the flags exactly.

Structs§

BatteryStatus
One battery status snapshot: the fields the platform reports.

Enums§

BatteryChargeState
The battery charge-state enumeration.
BatteryError
Snapshot or decode error.

Constants§

FLAG_CHARGE_STATE
Field-flags bit for the charge-state field.
FLAG_LEVEL
Field-flags bit for the level field.
FLAG_VOLTAGE
Field-flags bit for the voltage field.
MAX_ENCODED_LEN
Largest encoded size of a snapshot: flags + voltage + level + a one-byte PUI charge state.