From 1f8c030ebafac274e5f35acec80e127f5e3b3a74 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Mon, 10 Feb 2020 21:25:15 -0700 Subject: [PATCH] GCS_MAVLink: Allow scripting to start/stop the REPL --- libraries/GCS_MAVLink/GCS_Common.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 30914585c7..ef12122958 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -4053,6 +4054,16 @@ MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &p return handle_command_do_set_roi_sysid(packet); case MAV_CMD_DO_SET_HOME: return handle_command_int_do_set_home(packet); +#ifdef ENABLE_SCRIPTING + case MAV_CMD_SCRIPTING: + { + AP_Scripting *scripting = AP_Scripting::get_singleton(); + if (scripting == nullptr) { + return MAV_RESULT_UNSUPPORTED; + } + return scripting->handle_command_int_packet(packet); + } +#endif // ENABLE_SCRIPTING default: break; }