Class MavlinkMissionSender
Holds a plan and answers a receiver's requests for its items.
public sealed class MavlinkMissionSender : IDisposable
- Inheritance
-
MavlinkMissionSender
- Implements
- Inherited Members
Constructors
MavlinkMissionSender(byte, byte, byte)
Creates a sender for a plan bound for a target vehicle, with no items yet.
public MavlinkMissionSender(byte targetSystem, byte targetComponent, byte missionType = 0)
Parameters
targetSystembyteThe receiving system's id.
targetComponentbyteThe receiving component's id.
missionTypebyteThe
MAV_MISSION_TYPEof the plan.
Properties
Count
The number of items in the plan.
public int Count { get; }
Property Value
Methods
AddItem(MavlinkMessage)
Appends an item to the plan.
public void AddItem(MavlinkMessage item)
Parameters
itemMavlinkMessageA
MISSION_ITEM_INTmessage.
AddItem(ReadOnlySpan<byte>)
Appends an item to the plan.
public void AddItem(ReadOnlySpan<byte> item)
Parameters
itemReadOnlySpan<byte>A
MISSION_ITEM_INTpayload.
Remarks
The sender stamps the sequence number, target ids, and mission type onto each item as
it is handed out, so the payload need only carry the item's content: command, frame,
position, and parameters. Build one by field name with the MISSION_ITEM_INT
schema and pass its Payload.
CountFrame(MavlinkHeader)
Builds the frame that opens an upload.
public MavlinkFrame CountFrame(MavlinkHeader header)
Parameters
headerMavlinkHeaderThe addressing fields to stamp on the frame.
Returns
- MavlinkFrame
The
MISSION_COUNTframe.
Dispose()
Releases the sender.
public void Dispose()
OnFrame(MavlinkFrame, MavlinkHeader)
Handles an incoming frame, if it is one this transfer answers.
public MavlinkSenderStep? OnFrame(MavlinkFrame frame, MavlinkHeader header)
Parameters
frameMavlinkFrameThe frame off the link.
headerMavlinkHeaderThe addressing fields to stamp on the reply.
Returns
- MavlinkSenderStep?
The step taken, or
nullif the frame carries a message this transfer does not handle.
Remarks
A MISSION_REQUEST_LIST is answered with the count, a MISSION_REQUEST_INT
(or the older MISSION_REQUEST) with the item asked for, and a request past the
end of the plan with a MISSION_ACK reporting an invalid sequence. A
MISSION_ACK from the receiver ends the transfer.