Behaviour for DL/T 645 communication transport layers.
Decouples ExDlt645.Master and ExDlt645.Slave from hardware serial drivers,
allowing seamless switching between real serial ports (Circuits.UART),
in-memory virtual buses (ExDlt645.Transport.Virtual), and TCP connections
(ExDlt645.Transport.Tcp).
Summary
Callbacks
Closes the transport connection.
Reconfigures the transport.
Flushes input/output buffers in the transport.
Opens the transport connection for the given target / tty.
Reads data from the transport with a timeout.
Starts the transport process.
Stops the transport process.
Writes raw binary data over the transport.
Functions
Resolves the transport module based on options and target identifier.
Checks if options or identifier represent a TCP connection.
Checks if the identifier represents a virtual in-memory bus.
Types
Callbacks
@callback close(transport_ref()) :: :ok | {:error, term()}
Closes the transport connection.
@callback configure(transport_ref(), opts()) :: :ok | {:error, term()}
Reconfigures the transport.
@callback flush(transport_ref(), :receive | :transmit | :both) :: :ok | {:error, term()}
Flushes input/output buffers in the transport.
@callback open(transport_ref(), tty(), opts()) :: :ok | {:error, term()}
Opens the transport connection for the given target / tty.
@callback read(transport_ref(), timeout()) :: {:ok, binary()} | {:ok, {:partial, binary()}} | {:ok, {:error, term(), term()}} | {:error, term()}
Reads data from the transport with a timeout.
@callback start_link(opts()) :: {:ok, transport_ref()} | {:error, term()}
Starts the transport process.
@callback stop(transport_ref()) :: :ok
Stops the transport process.
@callback write(transport_ref(), binary()) :: :ok | {:error, term()}
Writes raw binary data over the transport.
Functions
Resolves the transport module based on options and target identifier.
Checks if options or identifier represent a TCP connection.
Checks if the identifier represents a virtual in-memory bus.