# mavlink2 v0.1.0 - API Reference

## Modules

- Overview
  - [MAVLink2](MAVLink2.md): MAVLink v2 for Elixir. See the README for an overview, and the modules
for each part

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

  - [MAVLink2.Frame](MAVLink2.Frame.md): MAVLink v2 frame encoding and decoding, for a `MAVLink2.Dialect`.
  - [MAVLink2.Signing](MAVLink2.Signing.md): MAVLink v2 message signing: a 32-byte secret shared by both ends, a link
id, and a timestamp that only moves forward.

- Dialects
  - [MAVLink2.Codec](MAVLink2.Codec.md): Message payloads from a wire layout (`MAVLink2.XML`): fields little
endian, in wire order.
  - [MAVLink2.Dialect](MAVLink2.Dialect.md): A MAVLink dialect: for each message id, the `crc_extra` byte the checksum
ends with and the payload length the receiver zero-extends to.
  - [MAVLink2.Dialect.XML](MAVLink2.Dialect.XML.md): A `MAVLink2.Dialect` generated at compile time from a MAVLink XML file
and its includes
  - [MAVLink2.XML](MAVLink2.XML.md): Reads a MAVLink message definition file, following its `<include>`s, into
messages and enums with their wire layout.

- Links
  - [MAVLink2.Link](MAVLink2.Link.md): 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.
  - [MAVLink2.Router](MAVLink2.Router.md): Forwards frames between `MAVLink2.Link`s, by MAVLink's
[routing rules](https://mavlink.io/en/guide/routing.html)

- Services
  - [MAVLink2.Command](MAVLink2.Command.md): MAVLink's command protocol: a `COMMAND_LONG` or `COMMAND_INT` to a
target, answered by `COMMAND_ACK`.
  - [MAVLink2.Mission](MAVLink2.Mission.md): MAVLink's mission protocol: upload, download and clear a mission, geofence
or rally point list.
  - [MAVLink2.Param](MAVLink2.Param.md): MAVLink's parameter protocol: read, set and list a component's
parameters.

- Transports
  - [MAVLink2.Transport](MAVLink2.Transport.md): The byte transport under a `MAVLink2.Link`: `MAVLink2.Transport.UART` for
a serial port, `MAVLink2.Transport.Loopback` for tests.
  - [MAVLink2.Transport.Loopback](MAVLink2.Transport.Loopback.md): 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.

  - [MAVLink2.Transport.UART](MAVLink2.Transport.UART.md): A serial port through `Circuits.UART`, 8N1 and no flow control.

