Device and signal-level API for simulated EtherCAT slaves.
Use this module to hydrate simulated devices from real
EtherCAT.Driver modules and to inspect or override named signal
values on a running simulator.
from_driver/2 can hydrate a simulated device from a real
EtherCAT.Driver and a simulator-side companion such as MyDriver.Simulator.
The companion is optional for real hardware drivers, but required for this
hydration path; signal mappings alone do not define simulated behavior.
See EtherCAT.Simulator for a complete UDP walkthrough.
Summary
Functions
Build an authored simulator definition from a driver and its adapter.
Types
Functions
@spec connect(signal_ref(), signal_ref()) :: :ok | {:error, :not_found | :unknown_signal | :invalid_value}
@spec connections() :: {:ok, [map()]} | {:error, :not_found | :timeout}
@spec disconnect(signal_ref(), signal_ref()) :: :ok | {:error, :not_found}
Build an authored simulator definition from a driver and its adapter.
Options:
:config— driver configuration map, default%{}:name— override the simulated device name:simulator— explicitEtherCAT.Simulator.Adaptermodule; otherwise resolvesMyDriver.SimulatorforMyDriver
Raises ArgumentError when no adapter is available or its options are invalid.
This builds a definition only; start it with EtherCAT.Simulator.start/1.
@spec subscribe(atom()) :: :ok | {:error, :not_found}
@spec unsubscribe(atom()) :: :ok | {:error, :not_found}