Skip to content

Commit

Permalink
mavlink: match commands aimed at any sysid/compid
Browse files Browse the repository at this point in the history
When we send a command to any sysid or any compid, we need to match an
ack from a specific sysid or compid. If we don't do that, we keep
sending retransmissions and eventually time out.
  • Loading branch information
julianoes authored and dagar committed Aug 14, 2019
1 parent a4fb18a commit 82bee2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/mavlink/mavlink_command_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ void MavlinkCommandSender::handle_mavlink_command_ack(const mavlink_command_ack_
while (command_item_t *item = _commands.get_next()) {
// Check if the incoming ack matches any of the commands that we have sent.
if (item->command.command == ack.command &&
from_sysid == item->command.target_system &&
from_compid == item->command.target_component &&
(item->command.target_system == 0 || from_sysid == item->command.target_system) &&
(item->command.target_component == 0 || from_compid == item->command.target_component) &&
item->num_sent_per_channel[channel] != -1) {
item->num_sent_per_channel[channel] = -2; // mark this as acknowledged
break;
Expand Down

0 comments on commit 82bee2b

Please sign in to comment.