Modbus RTU slave. The UART runs with Modbuv.Rtu.Framer in active mode;
complete frames are decoded, applied to the shared DB, and answered.
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns the raw DB map currently held by the slave's shared model.
Sends raw bytes directly over the UART without any framing or encoding. Useful for injecting pre-built RTU frames or test data.
Applies a frame tuple to the slave's local DB, similar to Tcp.Server.update/2. Validates the frame against the fc_map and returns the result.
Starts the RTU slave GenServer. params must include :tty and :model, and may include :active, :timeout, :uart_opts, and :fc_map.
Returns the current internal state struct of the RTU slave.
Stops the RTU slave GenServer process.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Returns the raw DB map currently held by the slave's shared model.
Sends raw bytes directly over the UART without any framing or encoding. Useful for injecting pre-built RTU frames or test data.
Applies a frame tuple to the slave's local DB, similar to Tcp.Server.update/2. Validates the frame against the fc_map and returns the result.
Starts the RTU slave GenServer. params must include :tty and :model, and may include :active, :timeout, :uart_opts, and :fc_map.
@spec state(pid()) :: %Modbuv.Rtu.Slave{ fc_map: term(), model_pid: term(), parent_pid: term(), status: term(), tty: term(), uart_opts: term(), uart_pid: term() }
Returns the current internal state struct of the RTU slave.
@spec stop(pid()) :: :ok
Stops the RTU slave GenServer process.