From 2aae59437136fe610f8b899ac3fbd2111f3694b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 Feb 2015 14:58:42 +1100 Subject: [PATCH] GCS_MAVLink: handle serial loopback in routing --- libraries/GCS_MAVLink/MAVLink_routing.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/GCS_MAVLink/MAVLink_routing.cpp b/libraries/GCS_MAVLink/MAVLink_routing.cpp index 059aa5f305..420b3f1930 100644 --- a/libraries/GCS_MAVLink/MAVLink_routing.cpp +++ b/libraries/GCS_MAVLink/MAVLink_routing.cpp @@ -92,6 +92,13 @@ routing table. */ bool MAVLink_routing::check_and_forward(mavlink_channel_t in_channel, const mavlink_message_t* msg) { + // handle the case of loopback of our own messages, due to + // incorrect serial configuration. + if (msg->sysid == mavlink_system.sysid && + msg->compid == mavlink_system.compid) { + return true; + } + // learn new routes learn_route(in_channel, msg);