From 32815dc1d3898182bcf4b0cd1b472507ce7a30cc Mon Sep 17 00:00:00 2001 From: acfloria Date: Thu, 1 Mar 2018 17:30:24 +0100 Subject: [PATCH] Only generate the HIGH_LATENCY2 message if transmitting is allowed --- src/modules/mavlink/mavlink_messages.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/mavlink/mavlink_messages.cpp b/src/modules/mavlink/mavlink_messages.cpp index 2c61868b3d..b78443dea8 100644 --- a/src/modules/mavlink/mavlink_messages.cpp +++ b/src/modules/mavlink/mavlink_messages.cpp @@ -4305,7 +4305,13 @@ protected: _throttle.reset(); _windspeed.reset(); - mavlink_msg_high_latency2_send_struct(_mavlink->get_channel(), &msg); + // only send the struct if transmitting is allowed + // this assures that the stream timer is only reset when actually a message is transmitted + updated = _mavlink->should_transmit(); + + if (updated) { + mavlink_msg_high_latency2_send_struct(_mavlink->get_channel(), &msg); + } } return updated;