mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-13 16:01:36 +08:00
mavlink: add class for command retransmission
This adds a class to allow for retransmission of outgoing commands. The sent commands are kept in a timestamped list to check if they are acked as required by the mavlink protocol. If they are not acked within a timeout, they can be retransmitted.
This commit is contained in:
@@ -88,6 +88,7 @@
|
||||
#include "mavlink_bridge_header.h"
|
||||
#include "mavlink_receiver.h"
|
||||
#include "mavlink_main.h"
|
||||
#include "mavlink_command_sender.h"
|
||||
|
||||
static const float mg2ms2 = CONSTANTS_ONE_G / 1000.0f;
|
||||
|
||||
@@ -628,6 +629,8 @@ MavlinkReceiver::handle_message_command_ack(mavlink_message_t *msg)
|
||||
mavlink_msg_command_ack_decode(msg, &ack);
|
||||
|
||||
if (ack.result != MAV_RESULT_ACCEPTED && ack.result != MAV_RESULT_IN_PROGRESS) {
|
||||
MavlinkCommandSender::instance().handle_mavlink_command_ack(ack, msg->sysid, msg->compid);
|
||||
|
||||
if (msg->compid == MAV_COMP_ID_CAMERA) {
|
||||
PX4_WARN("Got unsuccessful result %d from camera", ack.result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user