XMAVLink.Transport behaviour (xmavlink v0.14.1)

Copy Markdown View Source

Behaviour for connection transport delegates used by router connection workers.

Transport modules own external resources such as sockets or UART handles and expose pure-ish frame handling helpers to the router.

Summary

Types

connection()

@type connection() :: struct()

connection_key()

@type connection_key() :: term()

tokens()

@type tokens() :: [term()]

Callbacks

close(connection)

@callback close(connection()) :: term()

forward(connection, t)

@callback forward(connection(), XMAVLink.Frame.t()) :: term()

open(tokens, pid)

@callback open(tokens(), pid()) ::
  {:ok, connection_key() | nil, connection()} | {:error, term()}