Skip to content

feat: runtime loadable custom dialect support - #523

Open
onur-ozkan wants to merge 7 commits into
mavlink:masterfrom
onur-ozkan:runtime-loaded-dialects
Open

feat: runtime loadable custom dialect support#523
onur-ozkan wants to merge 7 commits into
mavlink:masterfrom
onur-ozkan:runtime-loaded-dialects

Conversation

@onur-ozkan

@onur-ozkan onur-ozkan commented Jul 22, 2026

Copy link
Copy Markdown
Member

rust-mavlink currently supports only compile-time generated dialects. Users with a vehicle-specific or non-standard dialect must add the XML definition, regenerate bindings and rebuild their application before they can communicate with it.

That is not practical for applications that need to support arbitrary vehicles or allow users to provide their own dialect definitions. This change adds runtime-loaded dialect support so an application can accept a dialect XML path or uploaded file and communicate with that dialect without code generation and rebuilds.

Changes are simply:

  • Add the Dialect trait and dialect-aware read/write helpers for sync and async transports.
  • Keep generated dialect support unchanged through a static dialect adapter.
  • Add DynamicDialect behind the dialect-dynamic feature.
  • Add dialect-aware connection helpers including connect_with_dialect and async equivalents.
  • Add a runtime-dialect serial example and usage documentation.

1:1 byte representation is covered with a unit test in dynamic module.

@pv42

pv42 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

I read through some parts of it and here are some early comments:

  • consider renaming the Mavtype::len() to size() if it becomes public to be in line with other rust apis (would fix the lint)
  • returning InvalidPayloadLength on payloads to long is problematic since the sender could use an mavlink 2 extension that the current dialect is not yet aware of

@onur-ozkan onur-ozkan added kind:feature Request or change that adds new functionality. scope:dialects Affects MAVLink dialect definitions or dialect-generated code. scope:transports Affects transport layers. labels Jul 22, 2026
@onur-ozkan
onur-ozkan force-pushed the runtime-loaded-dialects branch 2 times, most recently from 0fb88d0 to 0fd0f20 Compare July 22, 2026 16:19
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan
onur-ozkan force-pushed the runtime-loaded-dialects branch from 0fd0f20 to b7c5159 Compare July 22, 2026 16:22
Signed-off-by: Onur Özkan <work@onurozkan.dev>
@onur-ozkan
onur-ozkan marked this pull request as ready for review July 23, 2026 07:19
@onur-ozkan
onur-ozkan force-pushed the runtime-loaded-dialects branch from 58e961a to 4e1ce03 Compare July 23, 2026 07:19
@onur-ozkan

Copy link
Copy Markdown
Member Author

Do we have any bandwith to review this PR as a release candidate?

cc @joaoantoniocardoso @patrickelectric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:feature Request or change that adds new functionality. scope:dialects Affects MAVLink dialect definitions or dialect-generated code. scope:transports Affects transport layers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants