ExCEP.Gateway.Handler behaviour (ex_cep v0.1.1)

Copy Markdown

Callback behaviour for handling incoming Cluster (Master) commands on an Edge Gateway.

A handler receives decoded %ExCEP.Codec.DataAsdu{} requests and returns:

  • {:reply, %DataAsdu{}, new_state} to send a response back to the Cluster
  • {:noreply, new_state} when no response is required (e.g. confirmations)

Summary

Types

state()

@type state() :: term()

Callbacks

handle_asdu(asdu, channel, state)

@callback handle_asdu(
  asdu :: ExCEP.Codec.DataAsdu.t(),
  channel :: :management | :business,
  state :: state()
) :: {:reply, ExCEP.Codec.DataAsdu.t(), state()} | {:noreply, state()}

init(opts)

@callback init(opts :: term()) :: {:ok, state()}