Skip to content

protocol: support 32 bit system IDs - #15

Draft
julianoes wants to merge 1 commit into
mainfrom
pr-sysid32
Draft

protocol: support 32 bit system IDs#15
julianoes wants to merge 1 commit into
mainfrom
pr-sysid32

Conversation

@julianoes

Copy link
Copy Markdown

This is a draft towards supporting 32 bit sysid, see: ArduPilot/pymavlink#1229, used in mavlink/MAVSDK#3041.


A system ID no longer fits the 8 bit fields this was using, so widen the ones that hold a system ID to uint32_t and take the 32 bit proposal's extended header into account where a target travels in it.

The three messages split into two groups:

  • REQUEST_EVENT and RESPONSE_EVENT_ERROR carry a target_system, so a target above 255 moves into the extended header and the payload field reads as 0. On receive, the generated getter already resolves that, so handleEventError() uses it instead of the decoded struct. On send, requestEvent() cannot express the wide target in the struct it hands out, so send_request_event_message() now gets it as a separate argument for the caller to pass to mavlink_msg_request_event_pack_chan().

  • EVENT's destination_system is not a routing target, which is what its name is about, so it never moves into the extended header and stays 8 bit. An event therefore cannot address a system above 255, and such a system only receives broadcast events. That needs a wider field in the message itself and is left as is, with a comment.

Note that send_request_event_message() gaining an argument is a source break for callers that build the Callbacks struct.

A system ID no longer fits the 8 bit fields this was using, so widen the
ones that hold a system ID to uint32_t and take the 32 bit proposal's
extended header into account where a target travels in it.

The three messages split into two groups:

- REQUEST_EVENT and RESPONSE_EVENT_ERROR carry a target_system, so a
  target above 255 moves into the extended header and the payload field
  reads as 0. On receive, the generated getter already resolves that, so
  handleEventError() uses it instead of the decoded struct. On send,
  requestEvent() cannot express the wide target in the struct it hands
  out, so send_request_event_message() now gets it as a separate
  argument for the caller to pass to mavlink_msg_request_event_pack_chan().

- EVENT's destination_system is not a routing target, which is what its
  name is about, so it never moves into the extended header and stays 8
  bit. An event therefore cannot address a system above 255, and such a
  system only receives broadcast events. That needs a wider field in the
  message itself and is left as is, with a comment.

Note that send_request_event_message() gaining an argument is a source
break for callers that build the Callbacks struct.
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