From dcc1818ee23aae7fd59de06f7b0749d400846a65 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 25 May 2022 08:57:36 +1000 Subject: [PATCH] AP_AccelCal: pass mavlink_command_ack_t to accelcal library The library needs to look at the content of the packet. Given that GCS_MAVLink is already within handle_command_ack, decoding it there makes sense. --- libraries/AP_AccelCal/AP_AccelCal.cpp | 6 ++---- libraries/AP_AccelCal/AP_AccelCal.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/AP_AccelCal/AP_AccelCal.cpp b/libraries/AP_AccelCal/AP_AccelCal.cpp index dd0c0d9b1f..64e4178619 100644 --- a/libraries/AP_AccelCal/AP_AccelCal.cpp +++ b/libraries/AP_AccelCal/AP_AccelCal.cpp @@ -362,15 +362,13 @@ bool AP_AccelCal::client_active(uint8_t client_num) } #if HAL_GCS_ENABLED -void AP_AccelCal::handleMessage(const mavlink_message_t &msg) +void AP_AccelCal::handle_command_ack(const mavlink_command_ack_t &packet) { if (!_waiting_for_mavlink_ack) { return; } _waiting_for_mavlink_ack = false; - if (msg.msgid == MAVLINK_MSG_ID_COMMAND_ACK) { - _start_collect_sample = true; - } + _start_collect_sample = true; } bool AP_AccelCal::gcs_vehicle_position(float position) diff --git a/libraries/AP_AccelCal/AP_AccelCal.h b/libraries/AP_AccelCal/AP_AccelCal.h index f8c4badda2..5b0e26d082 100644 --- a/libraries/AP_AccelCal/AP_AccelCal.h +++ b/libraries/AP_AccelCal/AP_AccelCal.h @@ -43,7 +43,7 @@ public: static void register_client(AP_AccelCal_Client* client); #if HAL_GCS_ENABLED - void handleMessage(const mavlink_message_t &msg); + void handle_command_ack(const mavlink_command_ack_t &packet); #endif // true if we are in a calibration process