Modbuv.Rtu (modbuv v0.1.0)

Copy Markdown View Source

Modbus RTU ADU framing: <<slave, pdu, crc::little-16>>.

Summary

Functions

pack_exception(slave, fc, reason)

@spec pack_exception(0..255, 1..127, atom()) :: binary()

pack_req(frame)

@spec pack_req(tuple()) :: binary()

pack_res(frame, values)

@spec pack_res(tuple(), list() | nil) :: binary()

parse_req(adu, fc_map)

@spec parse_req(binary(), map()) :: {:ok, tuple()} | {:error, atom(), integer() | nil}

parse_res(frame, adu)

@spec parse_res(tuple(), binary()) :: list() | nil | {:error, term()}

response_fits?(arg1)

@spec response_fits?(tuple()) :: boolean()

response_length(arg, received)

@spec response_length(tuple(), binary()) ::
  {:ok, pos_integer()} | :more | {:error, term()}