diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index dccf1b6d..63260f4b 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -8,12 +8,53 @@ option java_outer_classname = "TelemetryProtos"; option java_package = "org.meshtastic.proto"; option swift_prefix = ""; +/** + * Details about charging state of the battery. + * Added to preserve the battery percentage while it's charging. + */ +enum BatteryStatus { + /* + * No further information (yet) + */ + BATTERY_STATUS_UNKNOWN = 0; + + /* + * Running on battery (not externally powered) + */ + DISCHARGING = 1; + + /* + * Externally powered and actively charging + */ + CHARGING = 2; + + /* + * Externally powered and fully charged + */ + FULLY_CHARGED = 3; + + /* + * Battery not present + */ + NOT_PRESENT = 4; + + /* + * Externally powered but not charging (disabled, suspended, or not supported) + */ + NOT_CHARGING = 5; + + /* + * Externally powered but not charging due to anomaly (fault detected) + */ + CHARGE_FAILURE = 6; +} + /* * Key native device metrics such as battery level */ message DeviceMetrics { /* - * 0-100 (>100 means powered) + * 0-100 */ optional uint32 battery_level = 1; @@ -36,6 +77,11 @@ message DeviceMetrics { * How long the device has been running since the last reboot (in seconds) */ optional uint32 uptime_seconds = 5; + + /* + * Details about powered and charging state + */ + optional BatteryStatus battery_status = 6; } /*