GCS_MAVLink: add support for ListDirectoryWithTime#33290
Open
julianoes wants to merge 2 commits into
Open
Conversation
hunt0r
approved these changes
Jun 2, 2026
Contributor
Author
|
FYI @peterbarker |
2170289 to
623000c
Compare
Contributor
Author
|
@hunt0r I've implemented this in QGroundControl and when testing it I found that I was missing log entries when using the FTP method! Claude narrowed the bug down to an issue where there are two null terminations between directory listings. The fix is to avoid the additional null termination. I checked MissionPlanner, pymavlink, and QGC, and they all ignore/skip additional nulls, so this fix should be backwards compatible. |
23 tasks
Contributor
Author
|
Gentle bump. QGC and MAVSDK has been merged, would be good to get this in, or closed if it's no good. Thanks! |
This extends MAVLink FTP to support the new opcode that allows to list files with modification time in UTC. This is according to the new spec in: mavlink/mavlink-devguide#701
Each directory entry was terminated with two null bytes instead of one: required_space already counts the trailing "%c" null from the snprintf format, so the additional "+ 1" left the snprintf-appended terminator in place as a stray second null. Clients that walk the listing as null-separated strings (e.g. QGC) read that stray null as an empty entry and advance their offset by one extra per entry. For listings that fit in a single packet this is harmless, but once a listing spans multiple packets the inflated offset causes the client to skip real entries, so the tail of the directory goes missing. This was latent for plain ListDirectory (short entries usually fit one packet) and is reliably triggered by ListDirectoryWithTime, whose longer entries make multi-packet listings the common case.
623000c to
3f3b6bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This extends MAVLink FTP to support the new opcode that allows to list files with modification time in UTC.
This is according to the new spec in:
mavlink/mavlink-devguide#701
Classification & Testing (check all that apply and add your own)
Description
Tested using SITL, MAVSDK (mavlink/MAVSDK#2891), and QGC (mavlink/qgroundcontrol#14495)