From 74b0e485e7336de945b703cf0c91aa023bef84aa Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 18 May 2017 10:21:15 +0200 Subject: [PATCH] MAVLink stream: Ensure the message is not sent again if it was already dispatched. --- src/modules/mavlink/mavlink_stream.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/mavlink/mavlink_stream.cpp b/src/modules/mavlink/mavlink_stream.cpp index ab964915de..55bf145964 100644 --- a/src/modules/mavlink/mavlink_stream.cpp +++ b/src/modules/mavlink/mavlink_stream.cpp @@ -83,6 +83,12 @@ MavlinkStream::update(const hrt_abstime t) return 0; } + // One of the previous iterations sent the update + // already before the deadline + if (_last_sent > t) { + return -1; + } + int64_t dt = t - _last_sent; int interval = _interval;