From 8c19af72e030339169bf788f3743894ec1444b66 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 3 Jun 2022 15:17:48 +0900 Subject: [PATCH] GCS_MAVLink: learn routes even on private channels Co-authored-by: Peter Barker --- libraries/GCS_MAVLink/MAVLink_routing.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/GCS_MAVLink/MAVLink_routing.cpp b/libraries/GCS_MAVLink/MAVLink_routing.cpp index 54d922f81e..934d55d268 100644 --- a/libraries/GCS_MAVLink/MAVLink_routing.cpp +++ b/libraries/GCS_MAVLink/MAVLink_routing.cpp @@ -97,14 +97,15 @@ bool MAVLink_routing::check_and_forward(mavlink_channel_t in_channel, const mavl return true; } + // learn new routes including private channels + // so that find_mav_type works for all channels + learn_route(in_channel, msg); + // don't ever forward data from a private channel if ((GCS_MAVLINK::is_private(in_channel))) { return true; } - // learn new routes - learn_route(in_channel, msg); - if (msg.msgid == MAVLINK_MSG_ID_RADIO || msg.msgid == MAVLINK_MSG_ID_RADIO_STATUS) { // don't forward RADIO packets