Table of Contents

Class MavlinkEnum

Namespace
Pamoja.Mavlink
Assembly
Pamoja.Mavlink.dll

The MAVLink dialect's named values.

public static class MavlinkEnum
Inheritance
MavlinkEnum
Inherited Members

An enum field rides on the wire as a plain integer, so setting type on a heartbeat or reading result off an acknowledgment works in numbers. These calls turn the names the dialect writes, such as MAV_TYPE_QUADROTOR, into those numbers and back, for every enumeration a field of a typed message names.

Methods

Returns every entry of an enumeration, in dialect order.

public static IReadOnlyList<MavlinkEnumEntry> Entries(string enumeration)

Parameters

enumeration string

The enumeration's name.

Returns

IReadOnlyList<MavlinkEnumEntry>

Each entry's name and value.

Exceptions

PamojaException

The enumeration is unknown.

Entry(string, ulong)

Names the entry of an enumeration that stands for a value.

public static string? Entry(string enumeration, ulong value)

Parameters

enumeration string

The enumeration's name, such as MAV_STATE.

value ulong

The value a field carried.

Returns

string

The entry's name, or null if no entry names the value.

Exceptions

PamojaException

The enumeration is unknown.

Reports whether an enumeration's values combine as bits.

public static bool IsBitmask(string enumeration)

Parameters

enumeration string

The enumeration's name.

Returns

bool

true for a bitmask such as MAV_MODE_FLAG.

Exceptions

PamojaException

The enumeration is unknown.

Returns the names of every enumeration this build names values for.

public static IReadOnlyList<string> Known()

Returns

IReadOnlyList<string>

Each enumeration a field of a typed message names, in the order the dialect defines them.

Names the entries a value is made of.

public static IReadOnlyList<string> Names(string enumeration, ulong value)

Parameters

enumeration string

The enumeration's name, such as MAV_MODE_FLAG.

value ulong

The value a field carried.

Returns

IReadOnlyList<string>

For a bitmask, each entry whose bits are set in the value, in dialect order; otherwise the one entry that names it. Empty when none applies.

Exceptions

PamojaException

The enumeration is unknown.

Returns the value a dialect entry name stands for.

public static ulong Value(string entry)

Parameters

entry string

The entry's name, such as MAV_CMD_COMPONENT_ARM_DISARM.

Returns

ulong

The value, ready to set on a field.

MAVLink writes each value's name with its enumeration in front, and the names are unique across the dialect, so the name alone is enough.

Exceptions

PamojaException

No entry of any dialect enumeration has that name.