CoroutinesMavConnection

Properties

Link copied to clipboard
abstract val mavFrame: SharedFlow<MavFrame<out MavMessage<*>>>

A stream of MavFrames.

Link copied to clipboard
abstract val streamState: StateFlow<StreamState>

The current state of the connection stream.

Functions

Link copied to clipboard
abstract suspend fun close()

Closes the underlying MavConnection and stops the reading process.

Link copied to clipboard
abstract suspend fun connect(readerScope: CoroutineScope)

Connects the underlying MavConnection and start reading from it. This method will suspend till the connection is created and then the readerScope will be used to start the reading process in a new coroutine.

Link copied to clipboard
abstract suspend fun <T : MavMessage<T>> sendSignedV2(systemId: UByte, componentId: UByte, payload: T, linkId: UByte, timestamp: UInt, secretKey: ByteArray)

Sends the provided payload wrapped in a signed MAVLink v2 frame.

Link copied to clipboard
abstract suspend fun <T : MavMessage<T>> sendUnsignedV2(systemId: UByte, componentId: UByte, payload: T)

Sends the provided payload wrapped in an unsigned MAVLink v2 frame.

Link copied to clipboard
abstract suspend fun <T : MavMessage<T>> sendV1(systemId: UByte, componentId: UByte, payload: T)

Sends the provided payload wrapped in a Mavlink v1 frame.

Link copied to clipboard

A wrapper around CoroutinesMavConnection.close that returns true if no exception was thrown and false otherwise.

Link copied to clipboard
suspend fun CoroutinesMavConnection.tryConnect(readerScope: CoroutineScope): Boolean

A wrapper around CoroutinesMavConnection.connect that returns true if no exception was thrown and false otherwise.

Link copied to clipboard
suspend fun <T : MavMessage<T>> CoroutinesMavConnection.trySendSignedV2(systemId: UByte, componentId: UByte, payload: T, linkId: UByte, timestamp: UInt, secretKey: ByteArray): Boolean

A wrapper around CoroutinesMavConnection.sendSignedV2 that returns true if no exception was thrown and false otherwise.

Link copied to clipboard
suspend fun <T : MavMessage<T>> CoroutinesMavConnection.trySendUnsignedV2(systemId: UByte, componentId: UByte, payload: T): Boolean

A wrapper around CoroutinesMavConnection.sendUnsignedV2 that returns true if no exception was thrown and false otherwise.

Link copied to clipboard
suspend fun <T : MavMessage<T>> CoroutinesMavConnection.trySendV1(systemId: UByte, componentId: UByte, payload: T): Boolean

A wrapper around CoroutinesMavConnection.sendV1 that returns true if no exception was thrown and false otherwise.