Expand description
Rust implementation of the MAVLink UAV messaging protocol, with bindings for all dialects. This crate provides message set code generation, packet building, parsing and connection handling for blocking and asynchronous I/O.
§Feature flags
The mavlink
crate uses a number of feature flags to reduce the amount of compiled code by making certain functions and MAVLink message sets (dialects) optional.
These feature flags are available to control the provided functionalities:
std
: Enables the usage ofstd
inmavlink
, enabled by default, this can be disabled for embedded applications.direct-serial
: Enable serial MAVLink connections, enabled by default.udp
: Enables UDP based MAVLink connections, enabled by default.tcp
: Enables TCP based MAVLink connections, enabled by default.signing
: Enable support for MAVLink 2 message signingembedded
: Enables embedded support using the embedded-io crate, incompatible withembedded-hal-02
andtokio-1
.embedded-hal-02
: Enables embedded support using version 0.2 of the embedded-hal crate, incompatible withembedded
.tokio-1
: Enable support for asynchronous I/O using tokio, incompatible withembedded
.serde
: Enables serde support in generated message sets, enabled by default.format-generated-code
: Generated MAVLink message set code will be formatted.emit-description
: Generated MAVLink message set code will include documentation.emit-extensions
: Generated MAVLink message set code will include MAVLink 2 message extensions.arbitrary
: Enable support for the arbitrary crate.
Either std
, embedded
or embedded-hal-02
must be enabled.
Each MAVlink message set (dialect) can be enabled using its feature flag. The following message set feature flags are available:
ardupilotmega
, enabled by defaultcommon
, enabled by defaultall
, this includes all other sets in the same message setasluav
avssuas
cubepilot
csairlink
development
icarous
loweheiser
matrixpilot
minimal
paparazzi
python_array_test
slugs
standard
storm32
test
ualberta
uavionix
The all-dialects
feature enables all message sets except all
.
Modules§
- ardupilotmega
ardupilotmega
- MAVLink ardupilotmega dialect.
- asluav
asluav
- MAVLink ASLUAV dialect.
- async_
peek_ reader - This module implements a buffered/peekable reader using async I/O.
- avssuas
avssuas
- MAVLink AVSSUAS dialect.
- bytes
- bytes_
mut - common
common
- MAVLink common dialect.
- csairlink
csairlink
- MAVLink csAirLink dialect.
- cubepilot
cubepilot
- MAVLink cubepilot dialect.
- development
development
- MAVLink development dialect.
- error
- icarous
icarous
- MAVLink icarous dialect.
- loweheiser
loweheiser
- MAVLink loweheiser dialect.
- matrixpilot
matrixpilot
- MAVLink matrixpilot dialect.
- minimal
minimal
- MAVLink minimal dialect.
- paparazzi
paparazzi
- MAVLink paparazzi dialect.
- peek_
reader - This module implements a buffered/peekable reader.
- python_
array_ test python_array_test
- MAVLink python_array_test dialect.
- standard
standard
- MAVLink standard dialect.
- storm32
storm32
- MAVLink storm32 dialect.
- test
test
- MAVLink test dialect.
- ualberta
ualberta
- MAVLink ualberta dialect.
- uavionix
uavionix
- MAVLink uAvionix dialect.
- utils
- Utilities for processing MAVLink messages
Structs§
- File
Connectable - MAVLink connection address for a file input
- MAVLink
V1Message Raw - Byte buffer containing the raw representation of a MAVLink 1 message beginning with the STX marker.
- MAVLink
V2Message Raw - Byte buffer containing the raw representation of a MAVLink 2 message beginning with the STX marker.
- MavFrame
- Encapsulation of the MAVLink message and the header, important to preserve information about the sender system and component id.
- MavHeader
- Metadata from a MAVLink packet header
- Serial
Connectable - MAVLink address for a serial connection
- Signing
Config - Configuration used for MAVLink 2 messages signing as defined in https://mavlink.io/en/guide/message_signing.html.
- Signing
Data - MAVLink 2 message signing data
- TcpConnectable
- MAVLink connection address for a TCP server or client
- UdpConnectable
- MAVLink address for a UDP server client or broadcast connection
Enums§
- Connection
Address - A parsed MAVLink connection address
- MAVLink
Message Raw - Raw byte representation of a MAVLink message of either version
- Mavlink
Version - Versions of the MAVLink protocol that we support
- Read
Version - MAVLink Version selection when attempting to read
- UdpMode
- Type of UDP connection
Constants§
- MAV_STX
- Message framing marker for MAVLink 1
- MAV_
STX_ V2 - Message framing marker for MAVLink 2
- MAX_
FRAME_ SIZE - Maximum size of any MAVLink frame in bytes.
Traits§
- Async
Connectable - A MAVLink connection address that can be connected to, establishing an
AsyncMavConnection
- Async
MavConnection - An async MAVLink connection
- Connectable
- A MAVLink connection address that can be connected to, establishing a
MavConnection
- MavConnection
- A MAVLink connection
- Message
- A MAVLink message payload
- Message
Data
Functions§
- calculate_
crc - Calculates the CRC checksum of a messages header, payload and the CRC_EXTRA byte.
- connect
- Connect to a MAVLink node by address string.
- connect_
async - Connect asynchronously to a MAVLink node by address string.
- read_
any_ msg - Read and parse a MAVLink 1 or 2 message from a
PeekReader
. - read_
any_ msg_ async - Asynchronously read and parse a MAVLink 1 or 2 message from a
AsyncPeekReader
. - read_
any_ msg_ async_ signed - Asynchronously read and parse a MAVLink 1 or 2 message from a
AsyncPeekReader
with signing support. - read_
any_ msg_ signed - Read and parse a MAVLink 1 or 2 message from a
PeekReader
with signing support. - read_
any_ raw_ message - Read a raw MAVLink 1 or 2 message from a
PeekReader
. - read_
any_ raw_ message_ async - Asynchronously read a raw MAVLink 1 or 2 message from a
AsyncPeekReader
. - read_
any_ raw_ message_ async_ signed - Asynchronously read a raw MAVLink 1 or 2 message from a
AsyncPeekReader
with signing support. - read_
any_ raw_ message_ signed - Read a raw MAVLink 1 or 2 message from a
PeekReader
with signing support. - read_
v1_ msg - Read and parse a MAVLink 1 message from a
PeekReader
. - read_
v1_ msg_ async - Asynchronously read and parse a MAVLink 1 message from a
AsyncPeekReader
. - read_
v1_ raw_ message - Read a raw MAVLink 1 message from a
PeekReader
. - read_
v1_ raw_ message_ async - Asynchronously read a raw MAVLink 1 message from a
AsyncPeekReader
. - read_
v2_ msg - Read and parse a MAVLink 2 message from a
PeekReader
. - read_
v2_ msg_ async - Asynchronously read and parse a MAVLink 2 message from a
AsyncPeekReader
. - read_
v2_ msg_ async_ signed - Asynchronously read and parse a MAVLink 2 message from a
AsyncPeekReader
. - read_
v2_ msg_ signed - Read and parse a MAVLink 2 message from a
PeekReader
. - read_
v2_ raw_ message - Read a raw MAVLink 2 message from a
PeekReader
. - read_
v2_ raw_ message_ async - Asynchronously read a raw MAVLink 2 message from a
AsyncPeekReader
. - read_
v2_ raw_ message_ async_ signed - Asynchronously read a raw MAVLink 2 message with signing support from a
AsyncPeekReader
. - read_
v2_ raw_ message_ signed - Read a raw MAVLink 2 message with signing support from a
PeekReader
. - read_
versioned_ msg - Read and parse a MAVLink message of the specified version from a
PeekReader
. - read_
versioned_ msg_ async - Asynchronously read and parse a MAVLink message of the specified version from a
AsyncPeekReader
. - read_
versioned_ msg_ async_ signed - Asynchronously read and parse a MAVLink message of the specified version from a
AsyncPeekReader
with signing support. - read_
versioned_ msg_ signed - Read and parse a MAVLink message of the specified version from a
PeekReader
with signing support. - write_
v1_ msg - Write a MAVLink 1 message to a
Write
r. - write_
v1_ msg_ async - Asynchronously write a MAVLink 1 message to a
AsyncWrite
r. - write_
v2_ msg - Write a MAVLink 2 message to a
Write
r. - write_
v2_ msg_ async - Asynchronously write a MAVLink 2 message to a
AsyncWrite
r. - write_
v2_ msg_ async_ signed - Write a MAVLink 2 message to a
AsyncWrite
r with signing support. - write_
v2_ msg_ signed - Write a MAVLink 2 message to a
Write
r with signing support. - write_
versioned_ msg - Write a MAVLink message using the given mavlink version to a
Write
r. - write_
versioned_ msg_ async - Asynchronously write a MAVLink message using the given MAVLink version to a
AsyncWrite
r. - write_
versioned_ msg_ async_ signed - Asynchronously write a MAVLink message using the given MAVLink version to a
AsyncWrite
r with signing support. - write_
versioned_ msg_ signed - Write a MAVLink message using the given mavlink version to a
Write
r with signing support.