Table of Contents

Class MavlinkMissionSender

Namespace
Pamoja.Mavlink
Assembly
Pamoja.Mavlink.dll

Holds a plan and answers a receiver's requests for its items.

public sealed class MavlinkMissionSender : IDisposable
Inheritance
MavlinkMissionSender
Implements
Inherited Members

Constructors

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

targetSystem byte

The receiving system's id.

targetComponent byte

The receiving component's id.

missionType byte

The MAV_MISSION_TYPE of the plan.

Properties

The number of items in the plan.

public int Count { get; }

Property Value

int

Methods

Appends an item to the plan.

public void AddItem(MavlinkMessage item)

Parameters

item MavlinkMessage

A MISSION_ITEM_INT message.

Appends an item to the plan.

public void AddItem(ReadOnlySpan<byte> item)

Parameters

item ReadOnlySpan<byte>

A MISSION_ITEM_INT payload.

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.

Builds the frame that opens an upload.

public MavlinkFrame CountFrame(MavlinkHeader header)

Parameters

header MavlinkHeader

The addressing fields to stamp on the frame.

Returns

MavlinkFrame

The MISSION_COUNT frame.

Releases the sender.

public void Dispose()

Handles an incoming frame, if it is one this transfer answers.

public MavlinkSenderStep? OnFrame(MavlinkFrame frame, MavlinkHeader header)

Parameters

frame MavlinkFrame

The frame off the link.

header MavlinkHeader

The addressing fields to stamp on the reply.

Returns

MavlinkSenderStep?

The step taken, or null if the frame carries a message this transfer does not handle.

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.