From 0bb98c3db5f389651aca39398fa28071f665a684 Mon Sep 17 00:00:00 2001 From: olliw42 Date: Fri, 1 Mar 2024 02:17:56 +0100 Subject: [PATCH] GCS_MAVLink: handle RADIO_RC_CHANNELS --- libraries/GCS_MAVLink/GCS.h | 1 + libraries/GCS_MAVLink/GCS_Common.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index 52f728c9d2..efd5fbbd1a 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -690,6 +690,7 @@ protected: void handle_optical_flow(const mavlink_message_t &msg); void handle_manual_control(const mavlink_message_t &msg); + void handle_radio_rc_channels(const mavlink_message_t &msg); // default empty handling of LANDING_TARGET virtual void handle_landing_target(const mavlink_landing_target_t &packet, uint32_t timestamp_ms) { } diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 0ad5337c31..fbdfcce5ca 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -4193,6 +4193,11 @@ void GCS_MAVLINK::handle_message(const mavlink_message_t &msg) case MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE: handle_rc_channels_override(msg); break; +#if AP_RCPROTOCOL_MAVLINK_RADIO_ENABLED + case MAVLINK_MSG_ID_RADIO_RC_CHANNELS: + handle_radio_rc_channels(msg); + break; +#endif #endif #if AP_OPTICALFLOW_ENABLED @@ -6976,4 +6981,14 @@ MAV_RESULT GCS_MAVLINK::handle_control_high_latency(const mavlink_command_int_t } #endif // HAL_HIGH_LATENCY2_ENABLED +#if AP_RCPROTOCOL_MAVLINK_RADIO_ENABLED +void GCS_MAVLINK::handle_radio_rc_channels(const mavlink_message_t &msg) +{ + mavlink_radio_rc_channels_t packet; + mavlink_msg_radio_rc_channels_decode(&msg, &packet); + + AP::RC().handle_radio_rc_channels(&packet); +} +#endif // AP_RCPROTOCOL_MAVLINK_RADIO_ENABLED + #endif // HAL_GCS_ENABLED