aboutsummaryrefslogtreecommitdiff
path: root/src/modules/mavlink/mavlink_receiver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/mavlink/mavlink_receiver.cpp')
-rw-r--r--src/modules/mavlink/mavlink_receiver.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp
index 1f91654da..3f9f7e139 100644
--- a/src/modules/mavlink/mavlink_receiver.cpp
+++ b/src/modules/mavlink/mavlink_receiver.cpp
@@ -955,9 +955,11 @@ MavlinkReceiver::handle_message_ping(mavlink_message_t *msg)
{
mavlink_ping_t ping;
mavlink_msg_ping_decode( msg, &ping);
- if (mavlink_system.sysid == ping.target_system &&
- mavlink_system.compid == ping.target_component) {
- _mavlink->send_message(MAVLINK_MSG_ID_PING, &msg);
+ if ((mavlink_system.sysid == ping.target_system) &&
+ (mavlink_system.compid == ping.target_component)) {
+ mavlink_message_t msg_out;
+ mavlink_msg_ping_encode(_mavlink->get_system_id(), _mavlink->get_component_id(), &msg_out, &ping);
+ _mavlink->send_message(MAVLINK_MSG_ID_PING, &msg_out);
}
}