diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index 8dce905bea..93457fa392 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -299,6 +299,7 @@ protected: MAV_RESULT handle_command_long_message(mavlink_command_long_t &packet); MAV_RESULT handle_command_camera(const mavlink_command_long_t &packet); MAV_RESULT handle_command_do_send_banner(const mavlink_command_long_t &packet); + MAV_RESULT handle_command_do_set_mode(const mavlink_command_long_t &packet); // vehicle-overridable message send function virtual bool try_send_message(enum ap_message id); diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 7a10fc4598..a2f9b6ff0b 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -2036,12 +2036,24 @@ MAV_RESULT GCS_MAVLINK::handle_command_do_send_banner(const mavlink_command_long return MAV_RESULT_ACCEPTED; } +MAV_RESULT GCS_MAVLINK::handle_command_do_set_mode(const mavlink_command_long_t &packet) +{ + const MAV_MODE base_mode = (MAV_MODE)packet.param1; + const uint32_t custom_mode = (uint32_t)packet.param2; + + return _set_mode_common(base_mode, custom_mode); +} + MAV_RESULT GCS_MAVLINK::handle_command_long_message(mavlink_command_long_t &packet) { MAV_RESULT result = MAV_RESULT_FAILED; switch (packet.command) { + case MAV_CMD_DO_SET_MODE: + result = handle_command_do_set_mode(packet); + break; + case MAV_CMD_DO_SEND_BANNER: result = handle_command_do_send_banner(packet); break;