diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index 3d793bd34e..940c46f98d 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -590,7 +590,9 @@ protected: #if AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED void handle_send_autopilot_version(const mavlink_message_t &msg); #endif +#if AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED MAV_RESULT handle_command_request_autopilot_capabilities(const mavlink_command_long_t &packet); +#endif virtual void send_banner(); diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index ec697621e1..104bddaff8 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -4410,6 +4410,7 @@ MAV_RESULT GCS_MAVLINK::handle_command_mag_cal(const mavlink_command_long_t &pac #endif } +#if AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED MAV_RESULT GCS_MAVLINK::handle_command_request_autopilot_capabilities(const mavlink_command_long_t &packet) { if (!is_equal(packet.param1,1.0f)) { @@ -4420,6 +4421,7 @@ MAV_RESULT GCS_MAVLINK::handle_command_request_autopilot_capabilities(const mavl return MAV_RESULT_ACCEPTED; } +#endif MAV_RESULT GCS_MAVLINK::handle_command_do_send_banner(const mavlink_command_long_t &packet) @@ -4679,10 +4681,12 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t result = handle_command_mount(packet); break; +#if AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED case MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES: { result = handle_command_request_autopilot_capabilities(packet); break; } +#endif case MAV_CMD_DO_SET_ROI_NONE: return handle_command_do_set_roi_none(); diff --git a/libraries/GCS_MAVLink/GCS_config.h b/libraries/GCS_MAVLink/GCS_config.h index 2442546d27..171765b9d7 100644 --- a/libraries/GCS_MAVLink/GCS_config.h +++ b/libraries/GCS_MAVLink/GCS_config.h @@ -25,3 +25,9 @@ #ifndef AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED #define AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED 1 #endif + +// handling of MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES is slated to be +// removed; the message can be requested with MAV_CMD_REQUEST_MESSAGE +#ifndef AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED +#define AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED 1 +#endif