From 6773821b3b02497d7031ad9f72dfe6a39b6c1800 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Fri, 3 Jul 2020 15:04:22 -0700 Subject: [PATCH] GCS_MAVLink: Don't forward MAVLink data on channels marked private, make private channels more private --- libraries/GCS_MAVLink/GCS_Common.cpp | 4 ++++ libraries/GCS_MAVLink/MAVLink_routing.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index e34252574b..6cd06d6170 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -108,6 +108,10 @@ bool GCS_MAVLINK::init(uint8_t instance) return false; } + if (!serial_manager.should_forward_mavlink_telemetry(protocol, instance)) { + set_channel_private(chan); + } + /* Now try to cope with SiK radios that may be stuck in bootloader mode because CTS was held while powering on. This tells the diff --git a/libraries/GCS_MAVLink/MAVLink_routing.cpp b/libraries/GCS_MAVLink/MAVLink_routing.cpp index 5f1e9bae51..c4ca8ae21d 100644 --- a/libraries/GCS_MAVLink/MAVLink_routing.cpp +++ b/libraries/GCS_MAVLink/MAVLink_routing.cpp @@ -97,6 +97,11 @@ bool MAVLink_routing::check_and_forward(mavlink_channel_t in_channel, const mavl return true; } + // 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);