forked from Archive/PX4-Autopilot
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:
parent
cd971948da
commit
6ea3c6a7d2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue