From 2f19aebac019e87e9503267fb9a848246485a999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 14 Nov 2016 17:06:21 +0100 Subject: [PATCH] mavlink_ulog_streaming: always send an ack (#5853) Fixes the case where an ack got lost and the FMU resends the data, but the client does not resend the ack. --- Tools/mavlink_ulog_streaming.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Tools/mavlink_ulog_streaming.py b/Tools/mavlink_ulog_streaming.py index f26c3d2ba7..c320c2bcc9 100755 --- a/Tools/mavlink_ulog_streaming.py +++ b/Tools/mavlink_ulog_streaming.py @@ -123,14 +123,17 @@ class MavlinkLogStreaming(): # m is either 'LOGGING_DATA_ACKED' or 'LOGGING_DATA': is_newer, num_drops = self.check_sequence(m.sequence) + # return an ack, even we already sent it for the same sequence, + # because the ack could have been dropped + if m.get_type() == 'LOGGING_DATA_ACKED': + self.mav.mav.logging_ack_send(self.mav.target_system, + self.target_component, m.sequence) + if is_newer: if num_drops > 0: self.num_dropouts += num_drops - if m.get_type() == 'LOGGING_DATA_ACKED': - self.mav.mav.logging_ack_send(self.mav.target_system, - self.target_component, m.sequence) - else: + if m.get_type() == 'LOGGING_DATA': if not self.got_header_section: print('Header received in {:0.2f}s'.format(timer()-self.start_time)) self.logging_started = True