From 3a59ca949c6faedd6655a2e04280989c0d6fcc99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Folles=C3=B8?= Date: Wed, 24 Jun 2026 14:50:14 +0200 Subject: [PATCH] Add dual-battery telemetry and drone PowerSource Prepare for X7 configurations that can run two batteries in parallel. - BatteryTel / BatteryBQ40Z50Tel: add second_battery (field 2, same type as battery) for the second parallel battery; documented as unset when only a single battery is used - Add PowerSource enum (unspecified/single/parallel, extensible to topside power) and DroneInfo.power_source (field 13) so clients can determine the power configuration without waiting for telemetry Co-Authored-By: Claude Opus 4.8 (1M context) --- protobuf_definitions/message_formats.proto | 12 ++++++++++++ protobuf_definitions/telemetry.proto | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/protobuf_definitions/message_formats.proto b/protobuf_definitions/message_formats.proto index 6b224a61..76ca9869 100644 --- a/protobuf_definitions/message_formats.proto +++ b/protobuf_definitions/message_formats.proto @@ -783,6 +783,17 @@ enum PressureSensorType { PRESSURE_SENSOR_TYPE_MS5637_02BA03 = 4; // The internal pressure sensor using the MS5637 02BA03 pressure sensor. } +// How the drone is powered. +// +// Lets clients determine the power configuration (e.g. parallel batteries on the +// X7) directly from DroneInfo, without waiting for telemetry. May be extended in +// the future, e.g. with topside power. +enum PowerSource { + POWER_SOURCE_UNSPECIFIED = 0; // Power source unknown / not determined. + POWER_SOURCE_SINGLE_BATTERY = 1; // A single battery. + POWER_SOURCE_PARALLEL_BATTERIES = 2; // Two batteries running in parallel (e.g. X7). +} + // Information about the drone. // // Information about a loaded computer vision model. @@ -816,6 +827,7 @@ message DroneInfo { GuestPortInfo gp = 9; // Guest port information. PressureSensorType depth_sensor = 11; // Type of depth sensor that is connected to the drone. repeated CvModelInfo cv_models = 12; // List of loaded computer vision models. + PowerSource power_source = 13; // How the drone is powered. } // Known error states for the drone. diff --git a/protobuf_definitions/telemetry.proto b/protobuf_definitions/telemetry.proto index 527bac8a..1ed074e5 100644 --- a/protobuf_definitions/telemetry.proto +++ b/protobuf_definitions/telemetry.proto @@ -108,14 +108,24 @@ message TimeLapseStateTel { } // Receive essential information about the battery status. +// +// On models with two batteries running in parallel (e.g. the X7), second_battery +// holds the essential information for the second battery. When only a single +// battery is used, second_battery is undefined (not set). message BatteryTel { Battery battery = 1; // Essential battery information. + Battery second_battery = 2; // Second battery, when present. Not set if only one battery is used. } // Receive detailed information about a battery using the // BQ40Z50 battery management system. +// +// On models with two batteries running in parallel (e.g. the X7), second_battery +// holds the detailed information for the second battery. When only a single +// battery is used, second_battery is undefined (not set). message BatteryBQ40Z50Tel { BatteryBQ40Z50 battery = 1; // Detailed battery information. + BatteryBQ40Z50 second_battery = 2; // Second battery, when present. Not set if only one battery is used. } // Receive the dive time of the drone.