mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
GCS_MAVLink: Don't send BATTERY_STATUS for empty instances
This commit is contained in:
parent
d96aad86a5
commit
f7b34677df
@ -256,9 +256,11 @@ bool GCS_MAVLINK::send_battery_status() const
|
||||
const AP_BattMonitor &battery = AP::battery();
|
||||
|
||||
for(uint8_t i = 0; i < battery.num_instances(); i++) {
|
||||
if (battery.get_type(i) != AP_BattMonitor_Params::BattMonitor_Type::BattMonitor_TYPE_NONE) {
|
||||
CHECK_PAYLOAD_SIZE(BATTERY_STATUS);
|
||||
send_battery_status(battery, i);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user