Expand description
The C ABI for MAVLink message shapes: reading and writing a message by field name.
mavlink carries any message’s bytes, which is enough to move traffic
but leaves the caller hand-packing payloads against a message definition. This is the
layer above: a schema states a message’s fields, and a message reads and writes them by
name, so a caller works in custom_mode and lat rather than byte offsets.
Two sources of shape are supported and behave identically. Every message the engine
types is published, so pamoja_mavlink_schema_for_id resolves the common dialect with
nothing to declare. A message from ArduPilot’s dialect, PX4’s, or a vendor’s private one
is described through PamojaMavlinkSchemaBuilder, which puts the fields in wire order
and derives the CRC_EXTRA seed, so a caller transcribes a definition as it reads.
Structs§
- Pamoja
Mavlink Field Info - One field of a message shape, as read back from a schema.
- Pamoja
Mavlink Message - A message being written or read field by field against a schema.
- Pamoja
Mavlink Schema - The shape of one message: its id, name, seed, and fields.
- Pamoja
Mavlink Schema Builder - Describes a message this build does not type, one field at a time.
Constants§
- PAMOJA_
MAVLINK_ FIELD_ CHAR - A
charfield; an array of these carries text. - PAMOJA_
MAVLINK_ FIELD_ DOUBLE - A
doublefield. - PAMOJA_
MAVLINK_ FIELD_ FLOAT - A
floatfield. - PAMOJA_
MAVLINK_ FIELD_ INT8 - An
int8_tfield. - PAMOJA_
MAVLINK_ FIELD_ INT16 - An
int16_tfield. - PAMOJA_
MAVLINK_ FIELD_ INT32 - An
int32_tfield. - PAMOJA_
MAVLINK_ FIELD_ INT64 - An
int64_tfield. - PAMOJA_
MAVLINK_ FIELD_ UINT8 - A
uint8_tfield. - PAMOJA_
MAVLINK_ FIELD_ UINT16 - A
uint16_tfield. - PAMOJA_
MAVLINK_ FIELD_ UINT32 - A
uint32_tfield. - PAMOJA_
MAVLINK_ FIELD_ UINT64 - A
uint64_tfield.
Functions§
- pamoja_
mavlink_ ⚠dialect_ add_ schema - Adds a schema’s message to a dialect table, so frames carrying it check.
- pamoja_
mavlink_ ⚠message_ decode - Reads a message out of a frame payload.
- pamoja_
mavlink_ ⚠message_ free - Releases a message.
- pamoja_
mavlink_ ⚠message_ get_ bytes - Copies the raw bytes of a byte-wide array field out.
- pamoja_
mavlink_ ⚠message_ get_ float - Reads a floating-point field.
- pamoja_
mavlink_ ⚠message_ get_ int - Reads a field as a signed integer.
- pamoja_
mavlink_ ⚠message_ get_ number - Reads a field as a double, whatever its type.
- pamoja_
mavlink_ ⚠message_ get_ uint - Reads a field as an unsigned integer.
- pamoja_
mavlink_ ⚠message_ new - Creates a message with every field zero.
- pamoja_
mavlink_ ⚠message_ payload - Returns a pointer to a message’s payload bytes.
- pamoja_
mavlink_ ⚠message_ set_ bytes - Writes the raw bytes of a byte-wide array field, zero-padding the rest.
- pamoja_
mavlink_ ⚠message_ set_ float - Writes a floating-point field.
- pamoja_
mavlink_ ⚠message_ set_ int - Writes a signed integer into a field.
- pamoja_
mavlink_ ⚠message_ set_ number - Writes a double into a field, converting it to the field’s type.
- pamoja_
mavlink_ ⚠message_ set_ uint - Writes an unsigned integer into a field.
- pamoja_
mavlink_ ⚠message_ to_ frame - Builds a v2 frame carrying a message.
- pamoja_
mavlink_ ⚠schema_ at - Returns the shape of the message at a position in the built-in registry.
- pamoja_
mavlink_ ⚠schema_ builder_ build - Puts the declared fields in wire order and finishes the shape.
- pamoja_
mavlink_ ⚠schema_ builder_ extension - Adds a MAVLink 2 extension field, in the order the definition declares it.
- pamoja_
mavlink_ ⚠schema_ builder_ field - Adds a base field, in the order the definition declares it.
- pamoja_
mavlink_ ⚠schema_ builder_ free - Releases a builder that was never built.
- pamoja_
mavlink_ ⚠schema_ builder_ new - Starts describing a message.
- pamoja_
mavlink_ schema_ count - Returns how many messages this build types.
- pamoja_
mavlink_ ⚠schema_ crc_ extra - Returns the
CRC_EXTRAseed a schema implies. - pamoja_
mavlink_ ⚠schema_ field - Describes one field of a message.
- pamoja_
mavlink_ ⚠schema_ field_ count - Returns how many fields a message has.
- pamoja_
mavlink_ ⚠schema_ for_ id - Returns the shape of a message the engine types, by id.
- pamoja_
mavlink_ ⚠schema_ for_ name - Returns the shape of a message the engine types, by name.
- pamoja_
mavlink_ ⚠schema_ free - Releases a schema.
- pamoja_
mavlink_ ⚠schema_ id - Returns the id of the message a schema describes.
- pamoja_
mavlink_ ⚠schema_ name - Returns the name of the message a schema describes.
- pamoja_
mavlink_ ⚠schema_ wire_ len - Returns the length of the message on the wire, extensions included.