From a7e57aa3fc51b8e280452ffa3fc7954c2a8f211f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 17 Jul 2017 09:49:21 +1000 Subject: [PATCH] GCS_MAVLink: move MAV_CMD_START_RX_PAIR handling to base class --- libraries/GCS_MAVLink/GCS.h | 2 +- libraries/GCS_MAVLink/GCS_Common.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index cd052e02c6..24c47438a2 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -264,7 +264,7 @@ protected: void handle_common_message(mavlink_message_t *msg); void handle_setup_signing(const mavlink_message_t *msg); uint8_t handle_preflight_reboot(const mavlink_command_long_t &packet, bool disable_overrides); - uint8_t handle_rc_bind(const mavlink_command_long_t &packet); + MAV_RESULT handle_rc_bind(const mavlink_command_long_t &packet); void handle_device_op_read(mavlink_message_t *msg); void handle_device_op_write(mavlink_message_t *msg); diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 05bffd164e..2ad99f0bf7 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -1646,7 +1646,7 @@ uint8_t GCS_MAVLINK::handle_preflight_reboot(const mavlink_command_long_t &packe /* handle a R/C bind request (for spektrum) */ -uint8_t GCS_MAVLINK::handle_rc_bind(const mavlink_command_long_t &packet) +MAV_RESULT GCS_MAVLINK::handle_rc_bind(const mavlink_command_long_t &packet) { // initiate bind procedure. We accept the DSM type from either // param1 or param2 due to a past mixup with what parameter is the @@ -1841,6 +1841,10 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_message(mavlink_command_long_t &pack switch (packet.command) { + case MAV_CMD_START_RX_PAIR: + result = handle_rc_bind(packet); + break; + case MAV_CMD_DO_SET_SERVO: /* fall through */ case MAV_CMD_DO_REPEAT_SERVO: