serial transport 上で動作する Modbus RTU server process です。
1 本の UART を所有し、fragmented request の再構築、line noise の除去、unit filtering、
no-response の broadcast write を処理し、request semantics は AVModbus.Server に委譲します。
start_link/2 は configured AtomVM UART を開き、:serial option で instance ごとに設定を上書きできます。
start_link/4 は open 済み transport handle を受け取り、UART を application 側で管理する場合や
host-side tests に利用できます。
Summary
Functions
configured UART を開き、handler 用の RTU server を起動します。
open 済み transport handle 上で RTU server を起動します。
:connected または reopen 中の最新 transport error を返します。
server を停止し、自身で open した UART を close します。
Types
@type option() :: {:mode, :rtu | :ascii} | {:units, [1..247]} | {:echo, boolean()} | {:silence, pos_integer()} | {:gap, non_neg_integer()} | {:serial, keyword()} | {:handler_timeout, pos_integer() | :infinity} | {:backoff, {pos_integer(), pos_integer()}} | {:authorize, AVModbus.Server.authorize() | nil} | {:identification, AVModbus.Server.Identification.objects() | nil} | {:name, atom()}
Functions
@spec start_link(AVModbus.Server.handler(), [option()]) :: {:ok, pid()} | {:error, term()}
configured UART を開き、handler 用の RTU server を起動します。
@spec start_link(module(), term(), AVModbus.Server.handler(), [option()]) :: {:ok, pid()} | {:error, term()}
open 済み transport handle 上で RTU server を起動します。
:connected または reopen 中の最新 transport error を返します。
@spec stop(server()) :: :ok
server を停止し、自身で open した UART を close します。