Packages

An elixir library for MAVLink, an application that enables communication with other systems using the MAVLink protocol over serial, UDP and TCP connections, and utility modules for performing common MAVLink commands and tasks with one or more remote vehicles.

Current section

Files

Jump to
xmavlink lib mavlink transport.ex
Raw

lib/mavlink/transport.ex

defmodule XMAVLink.Transport do
@moduledoc """
Behaviour for connection transport delegates used by `XMAVLink.ConnectionWorker`.
Transport modules own external resources such as sockets or UART handles and
expose pure-ish frame handling helpers to the router.
"""
@type tokens :: [term]
@type connection_key :: term
@type connection :: struct
@callback open(tokens, pid) ::
{:ok, connection_key | nil, connection} | {:error, term}
@callback close(connection) :: term
@callback forward(connection, XMAVLink.Frame.t()) :: term
end