Class MavlinkEnum
The MAVLink dialect's named values.
public static class MavlinkEnum
- Inheritance
-
MavlinkEnum
- Inherited Members
Remarks
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
Entries(string)
Returns every entry of an enumeration, in dialect order.
public static IReadOnlyList<MavlinkEnumEntry> Entries(string enumeration)
Parameters
enumerationstringThe 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
enumerationstringThe enumeration's name, such as
MAV_STATE.valueulongThe value a field carried.
Returns
- string
The entry's name, or
nullif no entry names the value.
Exceptions
- PamojaException
The enumeration is unknown.
IsBitmask(string)
Reports whether an enumeration's values combine as bits.
public static bool IsBitmask(string enumeration)
Parameters
enumerationstringThe enumeration's name.
Returns
- bool
truefor a bitmask such asMAV_MODE_FLAG.
Exceptions
- PamojaException
The enumeration is unknown.
Known()
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(string, ulong)
Names the entries a value is made of.
public static IReadOnlyList<string> Names(string enumeration, ulong value)
Parameters
enumerationstringThe enumeration's name, such as
MAV_MODE_FLAG.valueulongThe 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.
Value(string)
Returns the value a dialect entry name stands for.
public static ulong Value(string entry)
Parameters
entrystringThe entry's name, such as
MAV_CMD_COMPONENT_ARM_DISARM.
Returns
- ulong
The value, ready to set on a field.
Remarks
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.