ExDlt645.VirtualBus (ex_dlt645 v0.1.0)

Copy Markdown View Source

In-memory virtual serial bus for DL/T 645 communications.

Simulates an RS-485 multi-drop serial bus in memory without requiring physical serial hardware or operating-system pseudo-terminals (pty).

Summary

Functions

Attaches a transport peer to the virtual bus.

Broadcasts binary data to all peers on the bus except the sender.

Returns a specification to start this module under a supervisor.

Returns the default registered name for the shared virtual bus.

Detaches a transport peer from the virtual bus.

Retrieves the virtual bus process or starts one if not already running.

Returns the list of currently attached peer PIDs on the bus.

Starts a virtual bus GenServer with the given options.

Functions

attach(bus \\ ExDlt645.VirtualBus.Default, uart_pid)

Attaches a transport peer to the virtual bus.

broadcast(bus \\ ExDlt645.VirtualBus.Default, sender_pid, data)

Broadcasts binary data to all peers on the bus except the sender.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

default_name()

Returns the default registered name for the shared virtual bus.

detach(bus \\ ExDlt645.VirtualBus.Default, uart_pid)

Detaches a transport peer from the virtual bus.

get_or_start(bus \\ ExDlt645.VirtualBus.Default)

Retrieves the virtual bus process or starts one if not already running.

peers(bus \\ ExDlt645.VirtualBus.Default)

Returns the list of currently attached peer PIDs on the bus.

start_link(opts \\ [])

Starts a virtual bus GenServer with the given options.