Skip to content

Commit

Permalink
GCS_MAVLink: add and use Battery backend internal-use-only flag
Browse files Browse the repository at this point in the history
sometimes the information from a backend is very useful for logging, but not via telemetry.

Add an option bit to signify this
  • Loading branch information
peterbarker committed Aug 7, 2024
1 parent 8ee09c2 commit 127e634
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 127e634

Please sign in to comment.