feat: support 32 bit system IDs and extended targets - #4
Draft
julianoes wants to merge 1 commit into
Draft
Conversation
Implements MAVLINK_IFLAG_SYSID32 and MAVLINK_IFLAG_TARGETTED as proposed in ArduPilot/pymavlink#1229, which makes the MAVLink 2 header variable length (10 to 18 bytes) instead of a fixed 10. HEADER_SIZE was doing double duty as both the wire header length and the offset of the payload within the backing memory. Field offsets are now payload relative and the payload offset is added at access time from Header::size(), so the header can grow without moving the fields. Only widens when the value needs it: a system ID up to 255 sets no flags, so peers that predate this keep receiving parsable frames. The golden frames in tests/Sysid32.cpp are the C implementation's output copied from the pymavlink PR, covering all four sysid/target width combinations plus a signed frame.
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.
Implements MAVLINK_IFLAG_SYSID32 and MAVLINK_IFLAG_TARGETTED as proposed in ArduPilot/pymavlink#1229, which makes the MAVLink 2 header variable length (10 to 18 bytes) instead of a fixed 10.
HEADER_SIZE was doing double duty as both the wire header length and the offset of the payload within the backing memory. Field offsets are now payload relative and the payload offset is added at access time from Header::size(), so the header can grow without moving the fields.
Only widens when the value needs it: a system ID up to 255 sets no flags, so peers that predate this keep receiving parsable frames.
The golden frames in tests/Sysid32.cpp are the C implementation's output copied from the pymavlink PR, covering all four sysid/target width combinations plus a signed frame.