All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.divpundir.mavlink.api.MavMessage.kt Maven / Gradle / Ivy

There is a newer version: 1.2.8
Show newest version
package com.divpundir.mavlink.api

/**
 * A high level MAVLink message.
 *
 * MAVLink messages are defined in XML files and represented as data classes in mavlink-kotlin.
 */
public interface MavMessage> {

    /**
     * The instance property which returns [MavCompanion] of this class.
     */
    public val instanceCompanion: MavCompanion

    /**
     * Serializes the message to a [ByteArray] according to MAVLink v1 scheme. Extensions are not serialized.
     */
    public fun serializeV1(): ByteArray

    /**
     * Serializes the message to a [ByteArray] according to MAVLink v2 scheme. Extensions are also serialized and
     * payload truncation is applied.
     */
    public fun serializeV2(): ByteArray

    /**
     * The companion object for a [MavMessage], which contains the MAVLink metadata and the [MavDeserializer]
     * implementation for the message.
     */
    public interface MavCompanion> : MavDeserializer {
        public val id: UInt
        public val crcExtra: Byte
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy