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

v1.4 fix storage type translation (STORAGE_TYPE_OTHER) #2150

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

JonasVautherin
Copy link
Collaborator

We should not use static_cast to translate between a MAVLink enum and a MAVSDK enum, because their values don't necessarily correspond. Here STORAGE_TYPE_OTHER has a MAVLink value of 254 and fails to translate.

_status.data.storage_type = static_cast<Camera::Status::StorageType>(storage_information.type);

_status.data.available_storage_mib = storage_information.available_capacity;
_status.data.used_storage_mib = storage_information.used_capacity;
_status.data.total_storage_mib = storage_information.total_capacity;
_status.data.storage_id = storage_information.storage_id;
_status.data.storage_type =
static_cast<Camera::Status::StorageType>(storage_information.type);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the bug.

@julianoes julianoes merged commit 441ba3a into v1.4 Oct 10, 2023
29 checks passed
@julianoes julianoes deleted the v1.4-fix-storage-type branch October 10, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants