ExCEP. Cluster. Server
(ex_cep v0.1.1)
Copy Markdown
Edge Cluster (Master) TCP/TLS server and Gateway session registry.
Listens on a CEP channel port (9901 for :management or 9902 for :business,
or port 0 for OS-assigned ephemeral ports in tests), spawns an ExCEP.Cluster.Session
per connected Edge Gateway, and routes Cluster -> Gateway commands by gateway_id.
Summary
Functions
Returns a specification to start this module under a supervisor.
Looks up the active ExCEP.Cluster.Session pid for gateway_id.
Returns the list of currently connected and authenticated gateway_ids.
Returns the bound TCP listening port.
Pulls a file from a connected Gateway using Section 6.2.1 (FileGet + FileDataTrans).
Pushes a binary file to a connected Gateway using Section 6.2.2 (FileSend + FileDataTrans).
Sends a %DataAsdu{} request to gateway_id and awaits its correlated response.
Sends a one-way %DataAsdu{} to the connected gateway_id.
Stops the Cluster server and closes all active sessions.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_session(GenServer.server(), String.t()) :: {:ok, pid()} | {:error, :not_connected}
Looks up the active ExCEP.Cluster.Session pid for gateway_id.
@spec list_gateways(GenServer.server()) :: [String.t()]
Returns the list of currently connected and authenticated gateway_ids.
@spec port(GenServer.server()) :: :inet.port_number()
Returns the bound TCP listening port.
@spec pull_file(GenServer.server(), String.t(), String.t(), keyword()) :: {:ok, binary()} | {:error, term()}
Pulls a file from a connected Gateway using Section 6.2.1 (FileGet + FileDataTrans).
@spec push_file(GenServer.server(), String.t(), String.t(), binary(), keyword()) :: :ok | {:error, term()}
Pushes a binary file to a connected Gateway using Section 6.2.2 (FileSend + FileDataTrans).
@spec request(GenServer.server(), String.t(), ExCEP.Codec.DataAsdu.t(), keyword()) :: {:ok, ExCEP.Codec.DataAsdu.t()} | {:error, term()}
Sends a %DataAsdu{} request to gateway_id and awaits its correlated response.
@spec send_asdu(GenServer.server(), String.t(), ExCEP.Codec.DataAsdu.t(), keyword()) :: :ok | {:error, term()}
Sends a one-way %DataAsdu{} to the connected gateway_id.
@spec start_link(keyword()) :: GenServer.on_start()
@spec stop(GenServer.server()) :: :ok
Stops the Cluster server and closes all active sessions.