NervesGateSDK.RS485 (nerves_gate_sdk v0.1.0)

Copy Markdown

Exclusive, process-owned RS485 sessions. Claims are released on owner exit. Receive data arrives as Events.Event with topic {:rs485, port} and binary value. The platform owns serial settings; applications cannot open Linux devices.

Summary

Functions

claim(port)

@spec claim(String.t()) :: {:ok, reference()} | {:error, term()}

ports()

@spec ports() :: {:ok, [NervesGateSDK.RS485.Port.t()]} | {:error, term()}

release(claim)

@spec release(reference()) :: :ok | {:error, term()}

write(claim, data)

@spec write(reference(), binary()) :: :ok | {:error, term()}