From a292fe13d6d88a142345198c154906965b2b293e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 30 Aug 2021 15:16:34 +1000 Subject: [PATCH] GCS_MAVLink: add option to create internal error via preflight-reboot useful for testing our handling of internal errors --- libraries/GCS_MAVLink/GCS_Common.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 78635d1fa4..b7a8045e1b 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -2776,6 +2776,11 @@ MAV_RESULT GCS_MAVLINK::handle_preflight_reboot(const mavlink_command_long_t &pa } return MAV_RESULT_ACCEPTED; } + if (is_equal(packet.param4, 98.0f)) { + send_text(MAV_SEVERITY_WARNING,"Creating internal error"); + INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control); + return MAV_RESULT_ACCEPTED; + } } if (hal.util->get_soft_armed()) {