From 320e24af655bb187ce2ed0de0700bd3825157fea Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 24 Jul 2017 09:54:26 +1000 Subject: [PATCH] Plane: move mavlink reboot code up to base class --- ArduPlane/GCS_Mavlink.cpp | 9 +++++---- ArduPlane/GCS_Mavlink.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ArduPlane/GCS_Mavlink.cpp b/ArduPlane/GCS_Mavlink.cpp index f2ecf61fcc..f8fe9ff078 100644 --- a/ArduPlane/GCS_Mavlink.cpp +++ b/ArduPlane/GCS_Mavlink.cpp @@ -753,6 +753,11 @@ void GCS_MAVLINK_Plane::packetReceived(const mavlink_status_t &status, GCS_MAVLINK::packetReceived(status, msg); } +bool GCS_MAVLINK_Plane::should_disable_overrides_on_reboot() const +{ + return (plane.quadplane.enable != 0); +} + void GCS_MAVLINK_Plane::handleMessage(mavlink_message_t* msg) { switch (msg->msgid) { @@ -993,10 +998,6 @@ void GCS_MAVLINK_Plane::handleMessage(mavlink_message_t* msg) } break; - case MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN: - result = handle_preflight_reboot(packet, plane.quadplane.enable != 0); - break; - case MAV_CMD_DO_LAND_START: result = MAV_RESULT_FAILED; diff --git a/ArduPlane/GCS_Mavlink.h b/ArduPlane/GCS_Mavlink.h index 792959e96a..b004e8d79d 100644 --- a/ArduPlane/GCS_Mavlink.h +++ b/ArduPlane/GCS_Mavlink.h @@ -27,6 +27,7 @@ protected: uint8_t sysid_my_gcs() const override; bool set_mode(uint8_t mode) override; + bool should_disable_overrides_on_reboot() const override; MAV_RESULT handle_command_preflight_calibration(const mavlink_command_long_t &packet) override; MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_long_t &packet) override;