From faf2ae3a9c861fbb65f53a7317409870463dce53 Mon Sep 17 00:00:00 2001 From: Stephen Dade Date: Mon, 4 Mar 2024 22:59:45 +1100 Subject: [PATCH] GCS_MAVLink: filter out additional messages for High Latency link --- libraries/GCS_MAVLink/GCS.cpp | 5 +++++ libraries/GCS_MAVLink/GCS_Common.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS.cpp b/libraries/GCS_MAVLink/GCS.cpp index a31c35f011..609b91a17c 100644 --- a/libraries/GCS_MAVLink/GCS.cpp +++ b/libraries/GCS_MAVLink/GCS.cpp @@ -99,6 +99,11 @@ void GCS::send_to_active_channels(uint32_t msgid, const char *pkt) if (!c.is_active()) { continue; } +#if HAL_HIGH_LATENCY2_ENABLED + if (c.is_high_latency_link) { + continue; + } +#endif // size checks done by this method: c.send_message(pkt, entry); } diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 360cb06991..c655e464b8 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -1856,7 +1856,11 @@ GCS_MAVLINK::update_receive(uint32_t max_time_us) // send a timesync message every 10 seconds; this is for data // collection purposes +#if HAL_HIGH_LATENCY2_ENABLED + if (tnow - _timesync_request.last_sent_ms > _timesync_request.interval_ms && !is_private() && !is_high_latency_link) { +#else if (tnow - _timesync_request.last_sent_ms > _timesync_request.interval_ms && !is_private()) { +#endif if (HAVE_PAYLOAD_SPACE(chan, TIMESYNC)) { send_timesync(); _timesync_request.last_sent_ms = tnow;