From 048fc8d39e9983339e450415a43e8991a4035ccf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 6 Apr 2016 19:30:03 +1000 Subject: [PATCH] GCS_MAVLink: adjust for min_length mavlink2 API change --- libraries/GCS_MAVLink/GCS_Common.cpp | 2 ++ libraries/GCS_MAVLink/GCS_Logs.cpp | 4 +++- libraries/GCS_MAVLink/GCS_serial_control.cpp | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index de5622c2d8..2574d16772 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -308,6 +308,7 @@ void GCS_MAVLINK::handle_mission_request(AP_Mission &mission, mavlink_message_t _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)&ret_packet, + MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); } else { @@ -349,6 +350,7 @@ void GCS_MAVLINK::handle_mission_request(AP_Mission &mission, mavlink_message_t _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&ret_packet, + MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); } diff --git a/libraries/GCS_MAVLink/GCS_Logs.cpp b/libraries/GCS_MAVLink/GCS_Logs.cpp index 8b40142722..643c61158b 100644 --- a/libraries/GCS_MAVLink/GCS_Logs.cpp +++ b/libraries/GCS_MAVLink/GCS_Logs.cpp @@ -238,7 +238,9 @@ bool GCS_MAVLINK::handle_log_send_data(DataFlash_Class &dataflash) packet.id = _log_num_data; packet.count = ret; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, - MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); + MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, + MAVLINK_MSG_ID_LOG_DATA_LEN, + MAVLINK_MSG_ID_LOG_DATA_CRC); _log_data_offset += len; _log_data_remaining -= len; diff --git a/libraries/GCS_MAVLink/GCS_serial_control.cpp b/libraries/GCS_MAVLink/GCS_serial_control.cpp index f382d6837f..35ef3e70b9 100644 --- a/libraries/GCS_MAVLink/GCS_serial_control.cpp +++ b/libraries/GCS_MAVLink/GCS_serial_control.cpp @@ -154,6 +154,7 @@ more_data: _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)&packet, + MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); if ((flags & SERIAL_CONTROL_FLAG_MULTI) && packet.count != 0) {