Getting Started
MAVLink-M is a standard MAVLink 2 dialect: military.xml includes common.xml, so any MAVLink 2 toolchain can consume it.
Use the pre-generated C library
Pre-generated C headers are published to mavlink-military-c_library_v2 and regenerated by CI on every change to military.xml on main. Add it as a submodule and include the dialect header:
sh
git submodule add https://github.com/Dronecode/mavlink-military-c_library_v2.git mavlinkc
#include "mavlink/military/mavlink.h"See the MAVLink C library guide for how to pack, send, and parse messages.
Generate bindings for another language
Generate bindings with mavgen. Because military.xml includes common.xml by relative path, place it next to the upstream definitions first:
sh
git clone https://github.com/mavlink/mavlink.git --recursive
cp military.xml mavlink/message_definitions/v1.0/
cd mavlink
python3 -m pymavlink.tools.mavgen \
--lang=C --wire-protocol=2.0 \
--output=out message_definitions/v1.0/military.xmlReplace --lang with any language mavgen supports (for example Python3, CS, Java, TypeScript).
Try it on hardware
nucleo-mavlink-m-demo is a worked example of a flight controller relaying MAVLink-M messages to a peripheral.