NervesGateSDK.Backend behaviour (nerves_gate_sdk v0.1.0)

Copy Markdown

Implemented by device firmware and the host simulator.

call/2 runs in the caller's process. Implementations must preserve caller ownership when forwarding subscriptions or RS485 claims to another process. Backends return SDK-owned structs and never expose private domain state.

Summary

Types

operation()

@type operation() ::
  :system_info
  | :network_interfaces
  | :events_subscribe
  | :events_unsubscribe
  | :storage_status
  | :storage_data_dir
  | :can_interfaces
  | :can_send
  | :can_subscribe
  | :can_unsubscribe
  | :rs485_ports
  | :rs485_claim
  | :rs485_write
  | :rs485_release
  | :equipment_list

Callbacks

call(operation, list)

@callback call(operation(), list()) :: :ok | {:ok, term()} | {:error, term()}