baud v0.5.1 Modbus.Rtu.Master

RTU module.

Summary

Functions

exec(pid, cmd, timeout \\ 800)
start_link(params, opts \\ [])

Starts the RTU server.

params must contain a keyword list to be merged with the following defaults:

[
  device: nil,         #serial port name: "COM1", "ttyUSB0", "cu.usbserial-FTYHQD9MA"
  speed: 115200,       #either 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
                       #win32 adds 14400, 128000, 256000
  config: "8N1",       #either "8N1", "7E1", "7O1"
]

opts is optional and is passed verbatim to GenServer.

Returns {:ok, pid}.

Example

  Rtu.start_link([device: "COM8"])
stop(pid)

Stops the RTU server.

Returns :ok.