View Source Modbuzz.PDU protocol (Modbuzz v0.1.0)

MODBUS Protocol Data Unit.

Each PDU is documented, for example, in Modbuzz.PDU.ReadCoils.

Summary

Types

t()

All the types that implement this protocol.

Functions

Decodes the PDU binary into tuple

Encodes the request into a PDU binary

Types

@type t() :: term()

All the types that implement this protocol.

Functions

@spec decode(request :: t(), binary()) ::
  {:ok, response :: term()} | {:error, reason :: term()}

Decodes the PDU binary into tuple

@spec encode(request :: t()) :: binary()

Encodes the request into a PDU binary