Skip to main content

Module mavlink_protocol

Module mavlink_protocol 

Source
Expand description

The C ABI for the MAVLink service protocols: mission transfer, commands, and offboard setpoints.

A frame carries one message; a real exchange with an autopilot is a sequence of them with rules about order, matching, and retransmission. The machines here hold those rules and nothing else: no IO, no timers, no allocation beyond the handle. A caller feeds each one the frames off its link and sends back what the machine hands it, applying its own timing policy for timeouts and retransmission.

Every machine takes a whole frame and answers with a whole frame, so the payload decoding, message-id dispatch, and reply encoding happen once, here, rather than in each caller. A frame a machine does not handle is reported as ignored rather than as an error, so one link’s traffic can be routed through several machines in turn.

Structs§

PamojaMavlinkCommand
Tracks one command awaiting its acknowledgment.
PamojaMavlinkMissionReceiver
Requests a plan’s items in order and collects them, ending with an acknowledgment.
PamojaMavlinkMissionSender
Holds a plan and answers a receiver’s requests for its items.

Constants§

PAMOJA_MAVLINK_ACK_FINAL
The command finished; the value is its MAV_RESULT.
PAMOJA_MAVLINK_ACK_IN_PROGRESS
The command is still running; the value is the reported progress percent, or 255 when the autopilot does not report one.
PAMOJA_MAVLINK_ACK_UNRELATED
An acknowledgment was for a different command; keep waiting.
PAMOJA_MAVLINK_MAX_RETRIES
The number of times a request is retransmitted before a transfer is abandoned, as the mission protocol recommends.
PAMOJA_MAVLINK_RECEIVER_ACK
A mission receiver answered with the acknowledgment that ends the transfer.
PAMOJA_MAVLINK_RECEIVER_REQUEST
A mission receiver answered with a request for the next item.
PAMOJA_MAVLINK_SENDER_FINISHED
A mission sender saw the receiver’s acknowledgment; the transfer is over.
PAMOJA_MAVLINK_SENDER_REPLY
A mission sender answered with a frame to send.
PAMOJA_MAVLINK_STEP_IGNORED
The frame was not one this machine handles; nothing was produced.
PAMOJA_MAVLINK_TYPEMASK_ACCELERATION
Use the acceleration fields of a setpoint.
PAMOJA_MAVLINK_TYPEMASK_FORCE
Treat the acceleration fields as a force.
PAMOJA_MAVLINK_TYPEMASK_POSITION
Use the position fields of a setpoint.
PAMOJA_MAVLINK_TYPEMASK_VELOCITY
Use the velocity fields of a setpoint.
PAMOJA_MAVLINK_TYPEMASK_YAW
Use the yaw field of a setpoint.
PAMOJA_MAVLINK_TYPEMASK_YAW_RATE
Use the yaw rate field of a setpoint.

Functions§

pamoja_mavlink_command_confirmation⚠
Returns the confirmation count to stamp on the command being sent.
pamoja_mavlink_command_free⚠
Releases a command tracker.
pamoja_mavlink_command_id⚠
Returns the command id being tracked.
pamoja_mavlink_command_new
Starts tracking a command.
pamoja_mavlink_command_on_frame⚠
Classifies an incoming frame against the command in flight.
pamoja_mavlink_command_on_timeout⚠
Records a timeout and reports whether the command may be resent.
pamoja_mavlink_mission_receiver_expected⚠
Returns the next sequence number the receiver expects.
pamoja_mavlink_mission_receiver_free⚠
Releases a receiver.
pamoja_mavlink_mission_receiver_is_complete⚠
Reports whether the transfer has finished.
pamoja_mavlink_mission_receiver_new
Creates a receiver for a plan from a target vehicle.
pamoja_mavlink_mission_receiver_on_frame⚠
Handles an incoming frame, if it is one this transfer is waiting for.
pamoja_mavlink_mission_receiver_request_list⚠
Builds the frame that starts a download.
pamoja_mavlink_mission_sender_add_item⚠
Appends an item to the plan.
pamoja_mavlink_mission_sender_count⚠
Builds the frame that opens an upload.
pamoja_mavlink_mission_sender_free⚠
Releases a sender.
pamoja_mavlink_mission_sender_len⚠
Returns the number of items in the plan.
pamoja_mavlink_mission_sender_new
Creates a sender for a plan bound for a target vehicle, with no items yet.
pamoja_mavlink_mission_sender_on_frame⚠
Handles an incoming frame, if it is one this transfer answers.
pamoja_mavlink_offboard_global_position⚠
Builds a global-frame position setpoint frame.
pamoja_mavlink_offboard_local_position⚠
Builds a local-frame position setpoint frame.
pamoja_mavlink_offboard_local_velocity⚠
Builds a local-frame velocity setpoint frame.
pamoja_mavlink_offboard_type_mask
Builds a setpoint type_mask from the fields to use.