Expand description
The MAVLink message set.
§Message sets and the Message
trait
Each message set has its own module with corresponding data types, including a MavMessage
enum
that represents all possible messages in that message set. The Message
trait is used to
represent messages in an abstract way, and each MavMessage
enum implements this trait (for
example, [ardupilotmega::MavMessage
]). This is then monomorphized to the specific message
set you are using in your application at compile-time via type parameters. If you expect
ArduPilotMega-flavored messages, then you will need a MavConnection<ardupilotmega::MavMessage>
and you will receive ardupilotmega::MavMessage
s from it.
Some message sets include others. For example, all message sets except common
include the
common message set. This is represented with extra values in the MavMessage
enum: a message
in the common message set received on an ArduPilotMega connection will be an
ardupilotmega::MavMessage::common(common::MavMessage)
.
Please note that if you want to enable a given message set, you must also enable the
feature for the message sets that it includes. For example, you cannot use the ardupilotmega
feature without also using the uavionix
and icarous
features.
Modules§
- bytes
- bytes_
mut - error
- peek_
reader - This module implements a buffered/peekable reader.
- utils
Structs§
- MAVLink
V1Message Raw - MAVLink
V2Message Raw - 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
Enums§
- Mavlink
Version - Versions of the Mavlink protocol that we support
Constants§
- MAV_STX
- Message framing marker for mavlink v1
- MAV_
STX_ V2 - Message framing marker for mavlink v2
- MAX_
FRAME_ SIZE
Traits§
- MavConnection
- A MAVLink connection
- Message
- Message
Data
Functions§
- calculate_
crc - connect
- Connect to a MAVLink node by address string.
- read_
v1_ msg - Read a MAVLink v1 message from a Read stream.
- read_
v1_ raw_ message - Return a raw buffer with the mavlink message
V1 maximum size is 263 bytes:
<https://mavlink.io/en/guide/serialization.html>
- read_
v2_ msg - Read a MAVLink v2 message from a Read stream.
- read_
v2_ raw_ message - Return a raw buffer with the mavlink message
V2 maximum size is 280 bytes:
<https://mavlink.io/en/guide/serialization.html>
- read_
versioned_ msg - write_
v1_ msg - Write a MAVLink v1 message to a Write stream.
- write_
v2_ msg - Write a MAVLink v2 message to a Write stream.
- write_
versioned_ msg - Write a message using the given mavlink version