From 4d6408857f6582d7108b15e1d355b58c0498836c Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 26 Sep 2016 22:11:18 +1000 Subject: [PATCH] Copter: return appropriate response to failed disarm --- ArduCopter/GCS_Mavlink.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index d32be0985a..43a4ca9d9b 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -964,10 +964,14 @@ void GCS_MAVLINK_Copter::handleMessage(mavlink_message_t* msg) if (copter.init_arm_motors(true)) { result = MAV_RESULT_ACCEPTED; } - } else if (is_zero(packet.param1) && (copter.ap.land_complete || is_equal(packet.param2,21196.0f))) { - // force disarming by setting param2 = 21196 is deprecated - copter.init_disarm_motors(); - result = MAV_RESULT_ACCEPTED; + } else if (is_zero(packet.param1)) { + if (copter.ap.land_complete || is_equal(packet.param2,21196.0f)) { + // force disarming by setting param2 = 21196 is deprecated + copter.init_disarm_motors(); + result = MAV_RESULT_ACCEPTED; + } else { + result = MAV_RESULT_FAILED; + } } else { result = MAV_RESULT_UNSUPPORTED; }