Permalink
Browse files

commander: make sure all code paths return an (n)ack to MAV_CMD_PREFL…

…IGHT_CALIBRATION
  • Loading branch information...
1 parent 8cd913c commit 48c5ec54bbfd5be1d57f102526803e144d526f86 @bkueng bkueng committed Jan 11, 2017
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/modules/commander/commander.cpp
@@ -4024,14 +4024,15 @@ void *commander_low_prio_loop(void *arg)
} else if ((int)(cmd.param4) == 0) {
/* RC calibration ended - have we been in one worth confirming? */
if (status_flags.rc_input_blocked) {
- answer_command(cmd, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED, command_ack_pub, command_ack);
/* enable RC control input */
status_flags.rc_input_blocked = false;
mavlink_log_info(&mavlink_log_pub, "CAL: Re-enabling RC IN");
- calib_ret = OK;
}
+ answer_command(cmd, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED, command_ack_pub, command_ack);
/* this always succeeds */
calib_ret = OK;
+ } else {
+ answer_command(cmd, vehicle_command_s::VEHICLE_CMD_RESULT_UNSUPPORTED, command_ack_pub, command_ack);
}
status_flags.condition_calibration_enabled = false;

0 comments on commit 48c5ec5

Please sign in to comment.