API Reference mavlink2 v#0.1.0

Copy Markdown View Source

Modules

MAVLink v2 for Elixir. See the README for an overview, and the modules for each part

MAVLink's checksum: CRC-16/MCRF4XX, also called the X.25 CRC, as MAVLink's crc_accumulate computes it (seed 0xFFFF).

Message payloads from a wire layout (MAVLink2.XML): fields little endian, in wire order.

MAVLink's command protocol: a COMMAND_LONG or COMMAND_INT to a target, answered by COMMAND_ACK.

A MAVLink dialect: for each message id, the crc_extra byte the checksum ends with and the payload length the receiver zero-extends to.

A MAVLink2.Dialect generated at compile time from a MAVLink XML file and its includes

MAVLink v2 frame encoding and decoding, for a MAVLink2.Dialect.

A MAVLink link over one transport: it owns the transport, reassembles frames from the byte stream, numbers what it sends and delivers each decoded frame to its subscribers as {MAVLink2.Link, link, frame}, where link is the link's name or pid.

MAVLink's mission protocol: upload, download and clear a mission, geofence or rally point list.

MAVLink's parameter protocol: read, set and list a component's parameters.

Forwards frames between MAVLink2.Links, by MAVLink's routing rules

MAVLink v2 message signing: a 32-byte secret shared by both ends, a link id, and a timestamp that only moves forward.

The byte transport under a MAVLink2.Link: MAVLink2.Transport.UART for a serial port, MAVLink2.Transport.Loopback for tests.

An in-memory transport for tests. With echo: true everything written comes back to the owner; with peer: a pid or registered name (another link), everything written goes to it, or nowhere while it is not running. inject/2 delivers bytes as though the peer had sent them, and written/1 returns what was written.

A serial port through Circuits.UART, 8N1 and no flow control.

Reads a MAVLink message definition file, following its <include>s, into messages and enums with their wire layout.