# `ExCEP.Gateway.Handler`

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)

# `state`

```elixir
@type state() :: term()
```

# `handle_asdu`

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

# `init`

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

---

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