From 5100c9fb8c3b2688a6717e4330fbeaf3fcf3e85a Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 5 Mar 2020 10:37:55 +1100 Subject: [PATCH] GCS_Common: whitelist AUTOPILOT_VERSION for in_delay_callback sending GCSs may request this very early on in the boot process, particularly for SITL. If we try to send it during a delay callback then we end up dropping it at the moment - but we'd already sent the ack in response to the request. --- libraries/GCS_MAVLink/GCS_Common.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index a8e4a641d5..8a0c2f7b07 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -791,10 +791,6 @@ bool GCS_MAVLINK::should_send_message_in_delay_callback(const ap_message id) con // No ID we return true for may take more than a few hundred // microseconds to return! - if (id == MSG_HEARTBEAT || id == MSG_NEXT_PARAM) { - return true; - } - if (in_hil_mode()) { // in HIL we need to keep sending servo values to ensure // the simulator doesn't pause, otherwise our sensor @@ -805,6 +801,15 @@ bool GCS_MAVLINK::should_send_message_in_delay_callback(const ap_message id) con } } + switch (id) { + case MSG_HEARTBEAT: + case MSG_NEXT_PARAM: + case MSG_AUTOPILOT_VERSION: + return true; + default: + return false; + } + return false; }