From ce0f0938ee1f1e92c45f7937e236d9dbe2f959d5 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 21 Mar 2018 11:19:42 +1100 Subject: [PATCH] Copter: make superclass handle command_ack packets --- ArduCopter/GCS_Mavlink.cpp | 12 ++++++------ ArduCopter/GCS_Mavlink.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index acc0e38d96..b69613e3c5 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -708,6 +708,12 @@ void GCS_MAVLINK_Copter::send_banner() } +void GCS_MAVLINK_Copter::handle_command_ack(const mavlink_message_t* msg) +{ + copter.command_ack_counter++; + GCS_MAVLINK::handle_command_ack(msg); +} + void GCS_MAVLINK_Copter::handleMessage(mavlink_message_t* msg) { MAV_RESULT result = MAV_RESULT_FAILED; // assume failure. Each messages id is responsible for return ACK or NAK if required @@ -1337,12 +1343,6 @@ void GCS_MAVLINK_Copter::handleMessage(mavlink_message_t* msg) break; } - case MAVLINK_MSG_ID_COMMAND_ACK: // MAV ID: 77 - { - copter.command_ack_counter++; - break; - } - #if MODE_GUIDED_ENABLED == ENABLED case MAVLINK_MSG_ID_SET_ATTITUDE_TARGET: // MAV ID: 82 { diff --git a/ArduCopter/GCS_Mavlink.h b/ArduCopter/GCS_Mavlink.h index e237a70983..6a51b972f9 100644 --- a/ArduCopter/GCS_Mavlink.h +++ b/ArduCopter/GCS_Mavlink.h @@ -39,6 +39,7 @@ protected: private: void handleMessage(mavlink_message_t * msg) override; + void handle_command_ack(const mavlink_message_t* msg) override; bool handle_guided_request(AP_Mission::Mission_Command &cmd) override; void handle_change_alt_request(AP_Mission::Mission_Command &cmd) override; bool try_send_message(enum ap_message id) override;