diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index 4bbbcf9b64..3d793bd34e 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -587,7 +587,9 @@ protected: virtual MAV_RESULT handle_flight_termination(const mavlink_command_long_t &packet); +#if AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED void handle_send_autopilot_version(const mavlink_message_t &msg); +#endif MAV_RESULT handle_command_request_autopilot_capabilities(const mavlink_command_long_t &packet); virtual void send_banner(); diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 7e9b8f2c5c..ec697621e1 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -3869,9 +3869,11 @@ void GCS_MAVLINK::handle_common_message(const mavlink_message_t &msg) handle_set_mode(msg); break; +#if AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED case MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST: handle_send_autopilot_version(msg); break; +#endif case MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST: case MAVLINK_MSG_ID_MISSION_REQUEST_LIST: @@ -4141,10 +4143,12 @@ void GCS_MAVLINK::handle_common_mission_message(const mavlink_message_t &msg) } } +#if AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED void GCS_MAVLINK::handle_send_autopilot_version(const mavlink_message_t &msg) { send_message(MSG_AUTOPILOT_VERSION); } +#endif void GCS_MAVLINK::send_banner() { diff --git a/libraries/GCS_MAVLink/GCS_config.h b/libraries/GCS_MAVLink/GCS_config.h index 31fdc205ea..2442546d27 100644 --- a/libraries/GCS_MAVLink/GCS_config.h +++ b/libraries/GCS_MAVLink/GCS_config.h @@ -18,3 +18,10 @@ #ifndef AP_MAVLINK_MISSION_SET_CURRENT_ENABLED #define AP_MAVLINK_MISSION_SET_CURRENT_ENABLED 1 #endif + +// AUTOPILOT_VERSION_REQUEST is slated to be removed; an instance of +// AUTOPILOT_VERSION can be requested with MAV_CMD_REQUEST_MESSAGE, +// which gets you an ACK/NACK +#ifndef AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED +#define AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED 1 +#endif