From df8d8cefd61f0d1f1496813388c716bc6f62feb6 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 29 Jun 2020 11:47:22 +1000 Subject: [PATCH] AP_Generator: use new mavlink generator status flags --- libraries/AP_Generator/AP_Generator_RichenPower.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.cpp b/libraries/AP_Generator/AP_Generator_RichenPower.cpp index 73046a7dce..a7224c676f 100644 --- a/libraries/AP_Generator/AP_Generator_RichenPower.cpp +++ b/libraries/AP_Generator/AP_Generator_RichenPower.cpp @@ -405,6 +405,16 @@ void AP_Generator_RichenPower::send_generator_status(const GCS_MAVLINK &channel) status |= MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER; } + if (last_reading.errors & (uint8_t)Errors::MaintenanceRequired) { + status |= MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED; + } + if (last_reading.errors & (uint8_t)Errors::StartDisabled) { + status |= MAV_GENERATOR_STATUS_FLAG_START_INHIBITED; + } + if (last_reading.errors & (uint8_t)Errors::LowBatteryVoltage) { + status |= MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT; + } + mavlink_msg_generator_status_send( channel.get_chan(), status,