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
This commit is contained in:
Peter Barker 2024-08-07 16:10:07 +10:00 committed by Peter Barker
parent 8ee09c299e
commit 127e634589

View File

@ -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 uint8_t battery_id = (last_battery_status_idx + 1) % AP_BATT_MONITOR_MAX_INSTANCES;
const auto configured_type = battery.configured_type(battery_id); const auto configured_type = battery.configured_type(battery_id);
if (configured_type != AP_BattMonitor::Type::NONE && 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); CHECK_PAYLOAD_SIZE(BATTERY_STATUS);
send_battery_status(battery_id); send_battery_status(battery_id);
last_battery_status_idx = battery_id; last_battery_status_idx = battery_id;