Skip to content

MAVLink Dialects

Requires AMC 2.6.0+

Older AMC versions ignore mavlinkDialect.

A plugin can ship a MAVLink dialect XML. AMC reads it when the plugin loads, without a restart, and from then on receives, forwards and logs the dialect's messages like its own. The plugin sends and receives them with the MAVLink API.

Shipping a dialect

Name the XML in plugin.json and include it in the archive (list its folder in build.sh):

{
    "name": "MyPlugin",
    "apiVersion": "2.0",
    "type": "qml",
    "mavlinkDialect": "mavlink/mydialect.xml"
}
  • The XML uses the usual MAVLink XML format. AMC reads <messages>; enums are not read.
  • <include> of a dialect compiled into AMC (common.xml, standard.xml, minimal.xml, development.xml, auterion.xml) uses AMC's copy, so the plugin does not need to ship it. A message only in the plugin's own copy is therefore not available; with PluginManagerLog logging enabled, AMC logs which includes it replaced. Any other include must be a file inside the plugin.
  • Messages are laid out and checksummed as mavgen does, so they interoperate with code generated from the same XML.

When a dialect is refused

The plugin is not loaded, and Settings → Plugins shows the reason, if:

  • the XML is malformed, e.g. not well-formed, a bad type or array length, or a message larger than 255 bytes;
  • a message has the id or name of one compiled into AMC, with a different definition;
  • a message has the id or name of one another plugin brought, with a different definition.

Two plugins can ship the same dialect: identical messages are shared.

Lifetime

  • Messages are added only once the whole plugin has validated. A plugin refused for a QML error adds none, so after fixing it you can import it again, even with a changed dialect.
  • Once added, messages stay known until AMC restarts, also after the plugin is removed. A loaded plugin updated with a changed dialect needs a restart of AMC.

Messages of a plugin's dialect are not listed in Analyze → MAVLink Inspector.

See the MavlinkDialect example for a complete plugin.