From 09180b9d4ad45d28a9cf362b2d14f716d252b984 Mon Sep 17 00:00:00 2001 From: David Jablonski Date: Mon, 4 May 2020 09:21:01 +0200 Subject: [PATCH] mavlink: increment cmd confirmation field (#14808) --- src/modules/mavlink/mavlink_command_sender.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/mavlink/mavlink_command_sender.cpp b/src/modules/mavlink/mavlink_command_sender.cpp index 1355bcce9d..c8fd0d1a3e 100644 --- a/src/modules/mavlink/mavlink_command_sender.cpp +++ b/src/modules/mavlink/mavlink_command_sender.cpp @@ -189,8 +189,8 @@ void MavlinkCommandSender::check_timeout(mavlink_channel_t channel) if (item->num_sent_per_channel[channel] < max_sent && item->num_sent_per_channel[channel] != -1) { // We are behind and need to do a retransmission. + item->command.confirmation = ++item->num_sent_per_channel[channel]; mavlink_msg_command_long_send_struct(channel, &item->command); - item->num_sent_per_channel[channel]++; CMD_DEBUG("command %d sent (not first, retries: %d/%d, channel: %d)", item->command.command, @@ -210,8 +210,8 @@ void MavlinkCommandSender::check_timeout(mavlink_channel_t channel) } // We are the first of a new retransmission series. + item->command.confirmation = ++item->num_sent_per_channel[channel]; mavlink_msg_command_long_send_struct(channel, &item->command); - item->num_sent_per_channel[channel]++; // Therefore, we are the ones setting the timestamp of this retry round. item->last_time_sent_us = hrt_absolute_time();