Skip to main content

Module dialect

Module dialect 

Source
Expand description

The typed message layer: a broad slice of the MAVLink common dialect, plus the seam that lets any message id be carried and checked.

A Frame moves opaque payload bytes; this module gives those bytes meaning. Each typed message knows its id, its CRC_EXTRA seed, and how its fields are laid out on the wire, so a sender fills named fields instead of hand-packing a buffer and a receiver reads them back. The set covers what a ground station and an autopilot actually exchange: the periodic Heartbeat, system status, the command, parameter, and mission protocols, and the core position and attitude telemetry.

Messages are declared from one source of truth and their byte layout is derived from it, including the field reordering MAVLink applies (largest field first). Each message carries the official CRC_EXTRA for its shape, and a test re-derives that seed from the field definitions, so a wrong field type, name, or order is caught against the published dialect rather than only by a round-trip.

A message this crate does not type is still reachable two ways: RawMessage carries it by id and raw payload, and a MessageDescriptor gives those bytes named fields, so a vendor’s dialect is usable at runtime without being compiled in.

Modules§

gps_fix_type
GPS_FIX_TYPE: the kind of fix a GpsRawInt reports.
mav_autopilot
MAV_AUTOPILOT: which autopilot stack a Heartbeat comes from.
mav_battery_charge_state
MAV_BATTERY_CHARGE_STATE: how much charge a BatteryStatus says is left, as the autopilot judges it.
mav_battery_fault
MAV_BATTERY_FAULT: bits of the fault field of a BatteryStatus.
mav_battery_function
MAV_BATTERY_FUNCTION: what the battery a BatteryStatus describes powers.
mav_battery_mode
MAV_BATTERY_MODE: whether the battery a BatteryStatus describes is in normal use, discharging for storage, or being swapped.
mav_battery_type
MAV_BATTERY_TYPE: the chemistry of the battery a BatteryStatus describes.
mav_cmd
MAV_CMD: command ids for CommandLong, CommandInt, and the items of a mission, MissionItemInt.
mav_frame
MAV_FRAME: the coordinate frame of a mission item or position target.
mav_landed_state
MAV_LANDED_STATE: whether the vehicle is on the ground, taking off, flying, or landing, in an ExtendedSysState.
mav_mission_result
MAV_MISSION_RESULT: the outcome a MissionAck reports.
mav_mission_type
MAV_MISSION_TYPE: which plan a mission transfer carries, in the mission_type field of the MISSION_* messages.
mav_mode_flag
MAV_MODE_FLAG: bits of the base mode field of a Heartbeat.
mav_param_type
MAV_PARAM_TYPE: the type of a parameter’s value, in a ParamValue or a ParamSet.
mav_protocol_capability
MAV_PROTOCOL_CAPABILITY: bits of the capabilities field of an AutopilotVersion, naming the protocol features the autopilot supports.
mav_result
MAV_RESULT: the outcome a CommandAck reports.
mav_severity
MAV_SEVERITY: how urgent a Statustext is, from emergency down to debug.
mav_state
MAV_STATE: the system status carried by a Heartbeat.
mav_sys_status_sensor
MAV_SYS_STATUS_SENSOR: bits of the three sensor fields of a SysStatus, which say what the vehicle has, what it has switched on, and what is healthy.
mav_sys_status_sensor_extended
MAV_SYS_STATUS_SENSOR_EXTENDED: bits of the three extended sensor fields of a SysStatus, for the sensors the first 32 bits have no room for.
mav_type
MAV_TYPE: the kind of vehicle or component a Heartbeat describes.
mav_vtol_state
MAV_VTOL_STATE: the flight phase of a VTOL vehicle, in an ExtendedSysState.
mission_state
MISSION_STATE: where a mission stands, in the state field of a MissionCurrent.
position_target_typemask
POSITION_TARGET_TYPEMASK: the bits of the type_mask field of SetPositionTargetLocalNed and SetPositionTargetGlobalInt.

Structs§

Attitude
ATTITUDE: the vehicle’s orientation and angular rates in radians.
AttitudeQuaternion
ATTITUDE_QUATERNION: orientation as a quaternion, with angular rates.
AutopilotVersion
AUTOPILOT_VERSION: the autopilot’s capability flags and firmware versions.
BatteryStatus
BATTERY_STATUS: a battery’s charge, current, temperature, and per-cell voltages.
CommandAck
COMMAND_ACK: the vehicle’s acknowledgment of a command, carrying the result.
CommandInt
COMMAND_INT: a command in a coordinate frame, with integer-encoded position.
CommandLong
COMMAND_LONG: a command for the vehicle to run, with up to seven float parameters.
DynamicMessage
A message read and written by field name against a MessageDescriptor.
EnumDescriptor
A dialect enumeration: its name, whether its values combine as bits, and every value it names, in the order the dialect lists them.
EnumEntry
One named value of a dialect enumeration.
ExtendedSysState
EXTENDED_SYS_STATE: the VTOL and landed state of the vehicle.
FieldDescriptor
One field of a message: its name, type, and place in the layout.
GlobalPositionInt
GLOBAL_POSITION_INT: the fused global position, altitude, and velocity.
GpsRawInt
GPS_RAW_INT: the raw GPS fix: position, accuracy, speed, and satellite count.
Heartbeat
HEARTBEAT: the periodic broadcast every MAVLink node sends to announce its type, autopilot, and status, and the frame a peer waits for before deciding a link is up.
HomePosition
HOME_POSITION: the vehicle’s home location and the approach vector to it.
LocalPositionNed
LOCAL_POSITION_NED: the vehicle’s local position and velocity in the NED frame.
ManualControl
MANUAL_CONTROL: a pilot’s stick and button input, normalized to a fixed range.
MessageDescriptor
The shape of one message: what a sender fills in and a receiver reads back.
MessageDescriptorBuilder
Builds a message shape from a definition written the way a dialect reads.
MissionAck
MISSION_ACK: acknowledges the end of a mission transfer with a result.
MissionClearAll
MISSION_CLEAR_ALL: asks the vehicle to erase a stored plan.
MissionCount
MISSION_COUNT: announces how many items a mission transfer will contain, and which plan (mission, geofence, or rally) the transfer carries.
MissionCurrent
MISSION_CURRENT: the sequence number of the mission item the vehicle is running.
MissionItemInt
MISSION_ITEM_INT: one mission item, with integer-encoded position.
MissionRequest
MISSION_REQUEST: requests one mission item by sequence number, the legacy request some autopilots still send in place of MissionRequestInt.
MissionRequestInt
MISSION_REQUEST_INT: requests one mission item by sequence number, with position returned integer-encoded.
MissionRequestList
MISSION_REQUEST_LIST: asks the vehicle to begin downloading a plan by reporting its MissionCount.
OwnedDialect
A dialect a caller owns: message shapes looked up by id or name.
OwnedFieldDescriptor
One field of an owned message shape.
OwnedMessageDescriptor
A message shape a caller owns, for a message from a dialect this crate does not type.
ParamRequestList
PARAM_REQUEST_LIST: asks the vehicle to stream all of its onboard parameters.
ParamRequestRead
PARAM_REQUEST_READ: asks the vehicle for one onboard parameter, by name or index.
ParamSet
PARAM_SET: sets one onboard parameter on the vehicle.
ParamValue
PARAM_VALUE: one onboard parameter’s value, type, and position in the set.
Ping
PING: a round-trip timing and reachability probe.
RawMessage
A message this crate does not type, carried by id and raw payload.
RcChannels
RC_CHANNELS: the raw values of up to eighteen RC input channels.
ServoOutputRaw
SERVO_OUTPUT_RAW: the raw PWM values driving the first eight servo outputs.
SetMode
SET_MODE: requests the vehicle switch base and custom flight modes.
SetPositionTargetGlobalInt
SET_POSITION_TARGET_GLOBAL_INT: an offboard setpoint in the global frame, with integer-encoded latitude and longitude.
SetPositionTargetLocalNed
SET_POSITION_TARGET_LOCAL_NED: an offboard position, velocity, or thrust setpoint in the local NED frame.
Statustext
STATUSTEXT: a human-readable status message with a severity.
SysStatus
SYS_STATUS: the vehicle’s onboard sensor health, load, and battery state.
SystemTime
SYSTEM_TIME: the vehicle’s Unix and boot time, used to align clocks across a link.
VfrHud
VFR_HUD: the heads-up flight summary: speeds, heading, throttle, altitude, climb.

Enums§

FieldType
The scalar type of a message field, as a dialect declares it.
FieldValue
A field’s value, whichever of the three kinds its type calls for.

Constants§

DESCRIPTORS
Every typed message’s shape, in message-id order.
ENUMS
Every enumeration a field of a typed message names, complete, in the order the dialect defines them.

Traits§

Message
A typed MAVLink message: its identity on the wire and how it serializes.

Functions§

crc_extra
Returns the CRC_EXTRA for a common-dialect message id, if known.
descriptor
Returns the shape of a common-dialect message, if this crate types it.
descriptor_by_name
Returns the shape of a common-dialect message by name.
encode_message
Builds a v2 frame carrying a typed message.
entry_value
Returns the value a dialect entry name stands for, whichever enumeration it belongs to.
enum_named
Returns a dialect enumeration by name.