IEC60870.CS101.Transport.VirtualBus (ExIEC60870 v0.1.0)

Copy Markdown View Source

In-memory virtual serial bus (RS-232 / RS-485 bus simulator) for CS101 Master & Slave.

Supports point-to-point (Balanced/Unbalanced) and multi-drop (Unbalanced Master with multiple Slaves). When a participant calls send_data/2, the bytes are broadcast to all other attached processes as {:cs101_transport_data, bus_pid, data}.

Summary

Functions

Attaches pid (defaults to self()) to the virtual bus and returns a transport tuple {IEC60870.CS101.Transport.VirtualBus, bus_pid} ready to pass to CS101.Master or CS101.Slave.

Returns a specification to start this module under a supervisor.

Functions

attach(bus_pid, pid \\ self())

@spec attach(pid(), pid()) :: {module(), pid()}

Attaches pid (defaults to self()) to the virtual bus and returns a transport tuple {IEC60870.CS101.Transport.VirtualBus, bus_pid} ready to pass to CS101.Master or CS101.Slave.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])