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

Fix sequence order in serialization function #204

Conversation

IhsenBouallegue
Copy link
Contributor

@IhsenBouallegue IhsenBouallegue commented Nov 20, 2023

I am currently doing my bachelor's degree about MAVLink and LoRa. I decided to use rust and therefore rust-mavlink.
I need to serialize and deserialize MavFrames to send them over the LoRa link. While doing that, I noticed a weird behavior of the deser function. The order of serializing the header fields (system_id, component_id and sequence) does not align with the order of deserialization.

Here is a screenshot showing the problem
image

Order of serialization
image

Old order of deserialization
image

Also, if you look closely, the values are all over the place and do not match (it's not a corrupt message problem). I am going to open a separate issue for that (#205), as I am still investigating it and is not related to the header.

Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

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

Hi @IhsenBouallegue, thanks for identifying the problem!
But the issue is in the serialization and not on deserialization.
The order behind it is explained here:
https://mavlink.io/en/guide/serialization.html

@IhsenBouallegue
Copy link
Contributor Author

Hi @IhsenBouallegue, thanks for identifying the problem! But the issue is in the serialization and not on deserialization. The order behind it is explained here: https://mavlink.io/en/guide/serialization.html

Oh I blindly assumed that the serialization is the right one. I will switch that one then. Thanks for the catch!

@patrickelectric patrickelectric changed the title Fix sequence order in deser function Fix sequence order in serialization function Nov 20, 2023
@patrickelectric
Copy link
Member

Fix #205

@patrickelectric patrickelectric merged commit 3a17105 into mavlink:master Nov 20, 2023
26 checks passed
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