mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-12 16:03:34 +08:00
mavlink_ftp: fix to correctly trim reply messages
Clear any not used payload data to correctly trim mavlink ftp message reply to avoid sending long ACK and NACK messages.
This commit is contained in:
@@ -331,6 +331,9 @@ MavlinkFTP::_reply(mavlink_file_transfer_protocol_t *ftp_req)
|
||||
memcpy(_last_reply, ftp_req, sizeof(_last_reply));
|
||||
}
|
||||
|
||||
// clear any not used payload data to correctly trim mavlink ftp message reply
|
||||
memset(&payload->data[payload->size], 0, kMaxDataLength - payload->size);
|
||||
|
||||
PX4_DEBUG("FTP: %s seq_number: %" PRIu16, payload->opcode == kRspAck ? "Ack" : "Nak", payload->seq_number);
|
||||
|
||||
#ifdef MAVLINK_FTP_UNIT_TEST
|
||||
|
||||
Reference in New Issue
Block a user