mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
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.
This commit is contained in:
@@ -123,14 +123,17 @@ class MavlinkLogStreaming():
|
|||||||
# m is either 'LOGGING_DATA_ACKED' or 'LOGGING_DATA':
|
# m is either 'LOGGING_DATA_ACKED' or 'LOGGING_DATA':
|
||||||
is_newer, num_drops = self.check_sequence(m.sequence)
|
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 is_newer:
|
||||||
if num_drops > 0:
|
if num_drops > 0:
|
||||||
self.num_dropouts += num_drops
|
self.num_dropouts += num_drops
|
||||||
|
|
||||||
if m.get_type() == 'LOGGING_DATA_ACKED':
|
if m.get_type() == 'LOGGING_DATA':
|
||||||
self.mav.mav.logging_ack_send(self.mav.target_system,
|
|
||||||
self.target_component, m.sequence)
|
|
||||||
else:
|
|
||||||
if not self.got_header_section:
|
if not self.got_header_section:
|
||||||
print('Header received in {:0.2f}s'.format(timer()-self.start_time))
|
print('Header received in {:0.2f}s'.format(timer()-self.start_time))
|
||||||
self.logging_started = True
|
self.logging_started = True
|
||||||
|
|||||||
Reference in New Issue
Block a user