Modbus TCP ADU framing: MBAP header plus the Codec PDU.
Summary
Functions
Encodes a Modbus exception response into a TCP ADU for the given slave, function code, reason, and transaction ID.
Packs a Modbus TCP request ADU (MBAP header + PDU). transid is the transaction identifier (0–65535).
Encodes a frame tuple and its response values into a Modbus TCP response ADU using the given transaction ID.
Parses a Modbus TCP request ADU binary using the given fc_map. Returns {:ok, frame, transid} on success or {:error, reason, fc} on failure.
Functions
Encodes a Modbus exception response into a TCP ADU for the given slave, function code, reason, and transaction ID.
Packs a Modbus TCP request ADU (MBAP header + PDU). transid is the transaction identifier (0–65535).
Encodes a frame tuple and its response values into a Modbus TCP response ADU using the given transaction ID.
Parses a Modbus TCP request ADU binary using the given fc_map. Returns {:ok, frame, transid} on success or {:error, reason, fc} on failure.