Wafer.DLL.Rx (wafer v1.1.1)

View Source

Bytewise reception buffer for our data link layer.

Summary

Functions

Has the reception completed successfully?

Was there an error during reception?

Initialize a new empty buffer reading for receiving.

Receive a byte into the buffer.

Attempt to retrieve the received value from the buffer.

Types

t()

@type t() :: %Wafer.DLL.Rx{buffer: binary(), state: any()}

Functions

complete?(rx)

@spec complete?(t()) :: boolean()

Has the reception completed successfully?

error?(rx)

@spec error?(t()) :: boolean()

Was there an error during reception?

init()

Initialize a new empty buffer reading for receiving.

rx(rx, byte)

@spec rx(t(), byte()) :: t()

Receive a byte into the buffer.

value(rx)

@spec value(t()) :: {:ok, any()} | {:error, any()}

Attempt to retrieve the received value from the buffer.