From 127e634589181d2164f8176e209b9cebfe81bcfb Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 7 Aug 2024 16:10:07 +1000 Subject: [PATCH] GCS_MAVLink: add and use Battery backend internal-use-only flag sometimes the information from a backend is very useful for logging, but not via telemetry. Add an option bit to signify this --- libraries/GCS_MAVLink/GCS_Common.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 12792cc301..4e22558349 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -379,7 +379,8 @@ bool GCS_MAVLINK::send_battery_status() const uint8_t battery_id = (last_battery_status_idx + 1) % AP_BATT_MONITOR_MAX_INSTANCES; const auto configured_type = battery.configured_type(battery_id); if (configured_type != AP_BattMonitor::Type::NONE && - configured_type == battery.allocated_type(battery_id)) { + configured_type == battery.allocated_type(battery_id) && + !battery.option_is_set(battery_id, AP_BattMonitor_Params::Options::InternalUseOnly)) { CHECK_PAYLOAD_SIZE(BATTERY_STATUS); send_battery_status(battery_id); last_battery_status_idx = battery_id;