Modbux v0.3.9 Modbux.Tcp View Source

Tcp message helper, functions that handles TCP responses/requests messages.

Link to this section Summary

Link to this section Functions

Link to this function

pack_req(cmd, transid)

View Source
pack_req(
  {:fc | :phr | :rc | :rhr | :ri | :rir, integer(), integer(),
   maybe_improper_list() | integer()},
  integer()
) :: <<_::48, _::_*8>>
Link to this function

pack_res(cmd, values, transid)

View Source
pack_res(
  {:fc | :phr | :rc | :rhr | :ri | :rir, integer(), any(),
   maybe_improper_list() | integer()},
  any(),
  integer()
) :: <<_::48, _::_*8>>
Link to this function

parse_req(wraped)

View Source
parse_req(<<_::48, _::_*8>>) ::
  {{:einval | :error | :fc | :phr | :rc | :rhr | :ri | :rir, byte(), char(),
    [any()] | char()}, char()}
Link to this function

parse_res(cmd, wraped, transid)

View Source
parse_res(any(), <<_::48, _::_*8>>, char()) ::
  nil | [any()] | {:error, any()} | {:error, byte(), <<_::104>>}
Link to this function

req_len(cmd)

View Source
req_len({:fc | :phr | :rc | :rhr | :ri | :rir, any(), any(), any()}) ::
  integer()
Link to this function

res_len(cmd)

View Source
res_len({:fc | :phr | :rc | :rhr | :ri | :rir, any(), any(), any()}) ::
  number()
Link to this function

unwrap(inv_data)

View Source
unwrap(<<_::48, _::_*8>>) :: {binary(), char()}
Link to this function

unwrap(msg, transid)

View Source
unwrap(<<_::48, _::_*8>>, char()) :: nil | binary()
Link to this function

wrap(payload, transid)

View Source
wrap(binary(), integer()) :: <<_::48, _::_*8>>