Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect external storage format #1851

Merged
merged 1 commit into from
Jul 18, 2022
Merged

Conversation

JonasVautherin
Copy link
Collaborator

@JonasVautherin JonasVautherin commented Jul 12, 2022

It could be that some other component (or the user, manually) formats the storage. MAVSDK can detect that by observing that the image_count became smaller than it was before (e.g. image_count = 30 followed by image_count = 0 means that the storage was formatted). Because we can lose messages, I don't check image_count == 0, but last_image_count > new_image_count. The only reason why the image count would get lower is because the storage was formatted.

Also, it should work if just a few pictures are removed from the storage: here it just invalidates the whole photo list and MAVSDK has to start all over again, so that should be fine. Still, that's not a supported use case in the MAVLink specs.

@JonasVautherin JonasVautherin marked this pull request as ready for review July 13, 2022 10:08
julianoes
julianoes previously approved these changes Jul 15, 2022
@JonasVautherin JonasVautherin merged commit 508640a into main Jul 18, 2022
@JonasVautherin JonasVautherin deleted the handle-implicit-storage-format branch July 18, 2022 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants