MatterEx.IM.Router (matter_ex v0.4.0)

Copy Markdown View Source

Routes IM messages to cluster GenServers.

Bridges the IM codec layer (Phase 5) to the cluster runtime (Phase 6). All functions are pure — the router itself has no state.

Summary

Functions

handle(device, opcode, request, context \\ %{auth_mode: :pase})

@spec handle(module(), atom(), struct(), map()) :: struct()

Dispatch an IM message to the appropriate cluster(s) and return the response.

The optional context parameter carries session identity for ACL enforcement. Defaults to PASE context (implicit admin, bypasses ACL).

handle_read(device, req, context \\ %{auth_mode: :pase})

@spec handle_read(module(), MatterEx.IM.ReadRequest.t(), map()) ::
  MatterEx.IM.ReportData.t()