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 ofstdinmavlink, enabled by default, this can be disabled for embedded applications.transport-direct-serial: Enable serial MAVLink connections, enabled by default.transport-udp: Enables UDP based MAVLink connections, enabled by default.transport-tcp: Enables TCP based MAVLink connections, enabled by default.mav2-message-signing: Enable support for MAVLink 2 message signingembedded: Enables embedded support using the embedded-io crate, incompatible withtokio.tokio: 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, requiresrustfmtto be installed, enabled by default.mav2-message-extensions: Generated MAVLink message set code will include MAVLink 2 message extensions.arbitrary: Enable support for the arbitrary crate.ts-rs: Enable TypeScript code generation via ts-rs.
Either std or embedded must be enabled.
Each MAVlink message set (dialect) can be enabled using its feature flag. The following message set feature flags are available:
dialect-alldialect-ardupilotmega, enabled by defaultdialect-common, enabled by defaultdialect-asluavdialect-avssuasdialect-cubepilotdialect-csairlinkdialect-developmentdialect-icarousdialect-loweheiserdialect-marshdialect-matrixpilotdialect-minimaldialect-paparazzidialect-python_array_testdialect-standarddialect-stemstudiosdialect-storm32dialect-testdialect-ualbertadialect-uavionix
Modules§
- async_
peek_ reader tokio - This module implements a buffered/peekable reader using async I/O.
- dialects
- MAVLink dialect Rust bindings generated by mavlink-bindgen.
- error
- peek_
reader - This module implements a buffered/peekable reader.
- types
- utils
- Utilities for processing MAVLink messages
Structs§
- Connection
- Concrete MAVLink connection returned by
connect. - File
Config - 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
Config - 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
- TcpConfig
- MAVLink connection address for a TCP server or client
- UdpConfig
- 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
- TcpMode
- Type of TCP connection
- 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 tokio - Asynchronously read and parse a MAVLink 1 or 2 message from a
AsyncPeekReader. - read_
any_ msg_ async_ signed tokioandmav2-message-signing - Asynchronously read and parse a MAVLink 1 or 2 message from a
AsyncPeekReaderwith signing support. - read_
any_ msg_ signed mav2-message-signing - Read and parse a MAVLink 1 or 2 message from a
PeekReaderwith signing support. - read_
any_ raw_ message - Read a raw MAVLink 1 or 2 message from a
PeekReader. - read_
any_ raw_ message_ async tokio - Asynchronously read a raw MAVLink 1 or 2 message from a
AsyncPeekReader. - read_
any_ raw_ message_ async_ signed tokioandmav2-message-signing - Asynchronously read a raw MAVLink 1 or 2 message from a
AsyncPeekReaderwith signing support. - read_
any_ raw_ message_ signed mav2-message-signing - Read a raw MAVLink 1 or 2 message from a
PeekReaderwith signing support. - read_
raw_ versioned_ msg Deprecated - read_
raw_ versioned_ msg_ async Deprecated tokio - read_
raw_ versioned_ msg_ async_ signed Deprecated tokioandmav2-message-signing - read_
raw_ versioned_ msg_ signed Deprecated mav2-message-signing - read_
v1_ msg - Read and parse a MAVLink 1 message from a
PeekReader. - read_
v1_ msg_ async tokio - 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 tokio - 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 tokio - Asynchronously read and parse a MAVLink 2 message from a
AsyncPeekReader. - read_
v2_ msg_ async_ signed tokioandmav2-message-signing - Asynchronously read and parse a MAVLink 2 message with signing support from a
AsyncPeekReader. - read_
v2_ msg_ signed mav2-message-signing - 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 tokio - Asynchronously read a raw MAVLink 2 message from a
AsyncPeekReader. - read_
v2_ raw_ message_ async_ signed tokioandmav2-message-signing - Asynchronously read a raw MAVLink 2 message with signing support from a
AsyncPeekReader - read_
v2_ raw_ message_ signed mav2-message-signing - 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 tokio - Asynchronously read and parse a MAVLink message of the specified version from a
AsyncPeekReader. - read_
versioned_ msg_ async_ signed tokioandmav2-message-signing - Asynchronously read and parse a MAVLink message of the specified version from a
AsyncPeekReaderwith signing support. - read_
versioned_ msg_ signed mav2-message-signing - Read and parse a MAVLink message of the specified version from a
PeekReaderwith signing support. - read_
versioned_ raw_ message - Read and parse a MAVLink message of the specified version from a
PeekReader. - read_
versioned_ raw_ message_ async tokio - Asynchronously read and parse a MAVLinkMessageRaw of the specified version from a
AsyncPeekReader. - read_
versioned_ raw_ message_ async_ signed tokioandmav2-message-signing - Asynchronously read and parse a MAVLinkMessageRaw of the specified version from a
AsyncPeekReaderwith signing support. - read_
versioned_ raw_ message_ signed mav2-message-signing - Read and parse a MAVLinkMessageRaw of the specified version from a
PeekReaderwith signing support. - write_
v1_ msg - Write a MAVLink 1 message to a
Writer. - write_
v1_ msg_ async tokio - Asynchronously write a MAVLink 1 message to a [
AsyncWrite]r. - write_
v2_ msg - Write a MAVLink 2 message to a
Writer. - write_
v2_ msg_ async tokio - Asynchronously write a MAVLink 2 message to a [
AsyncWrite]r. - write_
v2_ msg_ async_ signed mav2-message-signingandtokio - Write a MAVLink 2 message to a [
AsyncWrite]r with signing support. - write_
v2_ msg_ signed mav2-message-signing - Write a MAVLink 2 message to a
Writer with signing support. - write_
versioned_ msg - Write a MAVLink message using the given mavlink version to a
Writer. - write_
versioned_ msg_ async tokio - Asynchronously write a MAVLink message using the given MAVLink version to a [
AsyncWrite]r. - write_
versioned_ msg_ async_ signed tokioandmav2-message-signing - Asynchronously write a MAVLink message using the given MAVLink version to a [
AsyncWrite]r with signing support. - write_
versioned_ msg_ signed mav2-message-signing - Write a MAVLink message using the given mavlink version to a
Writer with signing support.