Table of Contents

Class MavlinkSchemaBuilder

Namespace
Pamoja.Mavlink
Assembly
Pamoja.Mavlink.dll

Describes a message this build does not type, one field at a time.

public sealed class MavlinkSchemaBuilder : IDisposable
Inheritance
MavlinkSchemaBuilder
Implements
Inherited Members

Fields are added in the order the message definition lists them; Build() puts them in wire order and derives the CRC_EXTRA seed from the result, so a caller transcribes a definition as it reads.

Constructors

Starts describing a message.

public MavlinkSchemaBuilder(uint msgid, string name)

Parameters

msgid uint

The message id on the wire.

name string

The message name, which the seed derivation folds in, so it must match the dialect exactly.

Methods

Puts the declared fields in wire order and finishes the shape.

public MavlinkSchema Build()

Returns

MavlinkSchema

The finished schema.

Exceptions

PamojaException

Two fields share a name, the fields do not fit a MAVLink payload, or the shape has already been built.

Releases a builder that was never built.

public void Dispose()

Adds a MAVLink 2 extension field, in declared order.

public MavlinkSchemaBuilder Extension(string name, MavlinkFieldType fieldType, byte arrayLen = 0)

Parameters

name string

The field name.

fieldType MavlinkFieldType

The field's type.

arrayLen byte

The element count for an array, or 0 for a scalar.

Returns

MavlinkSchemaBuilder

This builder, so calls chain.

Extensions keep their declared order, stay out of the seed, and read as zero from a frame sent by a peer that predates them.

Exceptions

PamojaException

The shape has already been built.

Adds a base field, in the order the definition declares it.

public MavlinkSchemaBuilder Field(string name, MavlinkFieldType fieldType, byte arrayLen = 0)

Parameters

name string

The field name.

fieldType MavlinkFieldType

The field's type.

arrayLen byte

The element count for an array, or 0 for a scalar.

Returns

MavlinkSchemaBuilder

This builder, so calls chain.

Exceptions

PamojaException

The shape has already been built.