Table of Contents

Class MavlinkSigner

Namespace
Pamoja.Mavlink
Assembly
Pamoja.Mavlink.dll

A signing key and the monotonic timestamp that goes with it.

public sealed class MavlinkSigner : IDisposable
Inheritance
MavlinkSigner
Implements
Inherited Members

Constructors

Creates a signer.

public MavlinkSigner(ReadOnlySpan<byte> key, byte linkId = 0, ulong timestamp = 0)

Parameters

key ReadOnlySpan<byte>

The shared signing key, KeyLength bytes.

linkId byte

Which link this sender signs on.

timestamp ulong

The timestamp to start from.

The link id separates two links from one system, so traffic on one does not look like a replay of the other.

Exceptions

ArgumentException

The key is the wrong length.

Properties

Which link this signer signs on.

public byte LinkId { get; }

Property Value

byte

Methods

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Signs a message into a v2 frame.

public MavlinkFrame Sign(MavlinkHeader header, uint msgid, ReadOnlySpan<byte> payload, byte crcExtra)

Parameters

header MavlinkHeader

The addressing fields to stamp on the frame.

msgid uint

The message id.

payload ReadOnlySpan<byte>

The message payload.

crcExtra byte

The seed for this message id.

Returns

MavlinkFrame

The signed frame.

Each call advances the timestamp, which is what makes a replayed frame detectable.

Exceptions

PamojaException

The payload does not fit a frame.