MAVLink2.Transport.Loopback (mavlink2 v0.1.0)

Copy Markdown View Source

An in-memory transport for tests. With echo: true everything written comes back to the owner; with peer: a pid or registered name (another link), everything written goes to it, or nowhere while it is not running. inject/2 delivers bytes as though the peer had sent them, and written/1 returns what was written.

Summary

Functions

Returns a specification to start this module under a supervisor.

Deliver bytes to the owner as though the peer had sent them.

Everything written so far, oldest first.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

inject(pid, bytes)

@spec inject(pid(), binary()) :: :ok

Deliver bytes to the owner as though the peer had sent them.

written(pid)

@spec written(pid()) :: binary()

Everything written so far, oldest first.