# `IEC60870.CS101.Transport.VirtualBus`
[🔗](https://github.com/Ultraluv/ex_iec60870/blob/main/lib/iec60870/cs101/transport.ex#L26)

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}`.

# `attach`

```elixir
@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`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
