GCS_MAVLink: added handle_rc_bind()

This commit is contained in:
Andrew Tridgell 2016-10-15 19:51:17 +11:00
parent ba60cce0c1
commit 792f3b8a15
2 changed files with 16 additions and 0 deletions

View File

@ -269,6 +269,7 @@ protected:
void handle_log_message(mavlink_message_t *msg, DataFlash_Class &dataflash);
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);
private:

View File

@ -1764,3 +1764,18 @@ uint8_t GCS_MAVLINK::handle_preflight_reboot(const mavlink_command_long_t &packe
}
return MAV_RESULT_UNSUPPORTED;
}
/*
handle a R/C bind request (for spektrum)
*/
uint8_t 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
// right one
if (!hal.rcin->rc_bind(packet.param2>0?packet.param2:packet.param1)) {
return MAV_RESULT_FAILED;
}
return MAV_RESULT_ACCEPTED;
}