Skip to content

Commit 56c69f4

Browse files
committed
fix(mavftp): don't use cache for other sys/comp ids
1 parent c7295c8 commit 56c69f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/modules/mavlink/mavlink_ftp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ MavlinkFTP::_process_request(
141141
mavlink_file_transfer_protocol_t *last_reply = reinterpret_cast<mavlink_file_transfer_protocol_t *>(_last_reply);
142142
PayloadHeader *last_payload = reinterpret_cast<PayloadHeader *>(&last_reply->payload[0]);
143143

144-
if (payload->seq_number + 1 == last_payload->seq_number) {
144+
if (payload->seq_number + 1 == last_payload->seq_number
145+
&& last_reply->target_system == target_system_id
146+
&& last_reply->target_component == target_comp_id) {
145147
// this is the same request as the one we replied to last. It means the (n)ack got lost, and the GCS
146148
// resent the request
147149
mavlink_msg_file_transfer_protocol_send_struct(_mavlink.get_channel(), last_reply);

0 commit comments

Comments
 (0)