Skip to content

Commit

Permalink
GCS_MAVLink: handle RADIO_RC_CHANNELS
Browse files Browse the repository at this point in the history
  • Loading branch information
olliw42 committed Feb 29, 2024
1 parent 53c2118 commit d437991
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions libraries/GCS_MAVLink/GCS.h
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ class GCS_MAVLINK
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) { }
Expand Down
17 changes: 17 additions & 0 deletions libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4189,6 +4189,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
Expand Down Expand Up @@ -6970,4 +6975,16 @@ 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);

#if AP_RCPROTOCOL_ENABLED
AP::RC().handle_radio_rc_channels(&packet);
#endif
}
#endif // AP_RCPROTOCOL_MAVLINK_RADIO_ENABLED

#endif // HAL_GCS_ENABLED

0 comments on commit d437991

Please sign in to comment.