Browse Source

mavlink: increment cmd confirmation field (#14808)

sbg
David Jablonski 5 years ago committed by GitHub
parent
commit
09180b9d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/modules/mavlink/mavlink_command_sender.cpp

4
src/modules/mavlink/mavlink_command_sender.cpp

@ -189,8 +189,8 @@ void MavlinkCommandSender::check_timeout(mavlink_channel_t channel) @@ -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) @@ -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();

Loading…
Cancel
Save