Modbux.Rtu (Modbux v0.3.10) View Source

RTU message helper, functions that handles RTU responses/requests messages.

Link to this section Summary

Link to this section Functions

Specs

pack_req(
  {:fc | :phr | :rc | :rhr | :ri | :rir, integer(), integer(),
   maybe_improper_list() | integer()}
) :: <<_::16, _::_*8>>

Specs

pack_res({any(), integer(), integer(), integer()}) :: <<_::16, _::_*8>>

Specs

pack_res(
  <<_::16, _::_*8>>
  | {:fc | :phr | :rc | :rhr | :ri | :rir, integer(), any(),
     maybe_improper_list() | integer()},
  any()
) :: <<_::16, _::_*8>>

Specs

parse_req(<<_::16, _::_*8>>) ::
  {:einval | :error | :fc | :phr | :rc | :rhr | :ri | :rir, byte(), char(),
   [any()] | char()}

Specs

parse_res(any(), <<_::16, _::_*8>>) ::
  nil | [any()] | {:error, any()} | {:error, byte(), <<_::104>>}

Specs

req_len({:fc | :phr | :rc | :rhr | :ri | :rir, any(), any(), any()}) ::
  integer()

Specs

res_len({:fc | :phr | :rc | :rhr | :ri | :rir, any(), any(), any()}) :: number()

Specs

unwrap(<<_::16, _::_*8>>) :: binary()

Specs

wrap(binary()) :: <<_::16, _::_*8>>