Skip to content

Commit

Permalink
GCS_Common: whitelist AUTOPILOT_VERSION for in_delay_callback sending
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
peterbarker committed May 11, 2020
1 parent ca4af94 commit 5100c9f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down

0 comments on commit 5100c9f

Please sign in to comment.