Skip to content

feat: support 32 bit system IDs and extended targets - #4

Draft
julianoes wants to merge 1 commit into
mavsdk-forkfrom
sysid32
Draft

feat: support 32 bit system IDs and extended targets#4
julianoes wants to merge 1 commit into
mavsdk-forkfrom
sysid32

Conversation

@julianoes

Copy link
Copy Markdown
Owner

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.

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.
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.

1 participant