GCS_MAVLink: add support for MAV_CMD_RUN_PREARM_CHECKS

This commit is contained in:
Peter Barker 2021-06-01 18:48:15 +10:00 committed by Andrew Tridgell
parent 32bb616bb5
commit 8d9d3ca437
2 changed files with 14 additions and 0 deletions

View File

@ -463,6 +463,7 @@ protected:
bool telemetry_delayed() const;
virtual uint32_t telem_delay() const = 0;
MAV_RESULT handle_command_run_prearm_checks(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_preflight_set_sensor_offsets(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_flash_bootloader(const mavlink_command_long_t &packet);

View File

@ -3802,6 +3802,15 @@ MAV_RESULT GCS_MAVLINK::handle_command_preflight_calibration(const mavlink_comma
return _handle_command_preflight_calibration(packet);
}
MAV_RESULT GCS_MAVLINK::handle_command_run_prearm_checks(const mavlink_command_long_t &packet)
{
if (hal.util->get_soft_armed()) {
return MAV_RESULT_TEMPORARILY_REJECTED;
}
(void)AP::arming().pre_arm_checks(true);
return MAV_RESULT_ACCEPTED;
}
MAV_RESULT GCS_MAVLINK::handle_command_preflight_can(const mavlink_command_long_t &packet)
{
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
@ -4173,6 +4182,10 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t
result = handle_command_preflight_can(packet);
break;
case MAV_CMD_RUN_PREARM_CHECKS:
result = handle_command_run_prearm_checks(packet);
break;
case MAV_CMD_FLASH_BOOTLOADER:
result = handle_command_flash_bootloader(packet);
break;