From d768bcc90451faaab43dd4d83b09d9a2d9b54db0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 11 Jul 2022 14:43:18 +1000 Subject: [PATCH] GCS_MAVLink: eliminate get_mavlink_channel there's no dependence on any SerialManager stuff when determining this. The protocol passed through was always mavlink... --- libraries/GCS_MAVLink/GCS_Common.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index ff14a0227c..a83433cd82 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -119,15 +119,13 @@ bool GCS_MAVLINK::init(uint8_t instance) const AP_SerialManager::SerialProtocol protocol = AP_SerialManager::SerialProtocol_MAVLink; // get associated mavlink channel - if (!serial_manager.get_mavlink_channel(protocol, instance, chan)) { - // return immediately in unlikely case mavlink channel cannot be found - return false; - } - // and init the gcs instance + chan = (mavlink_channel_t)(MAVLINK_COMM_0 + instance); if (!valid_channel(chan)) { return false; } + // and init the gcs instance + if (!serial_manager.should_forward_mavlink_telemetry(protocol, instance)) { set_channel_private(chan); }