Description of a serial proxy instance exposed by an Espex.SerialProxy
adapter.
Adapters return a list of these from Espex.SerialProxy.list_instances/0.
The :instance integer is the stable identifier used by the ESPHome client
in SerialProxyConfigureRequest, SerialProxyWriteRequest, etc. — the
adapter chooses the numbering and must keep it stable for the lifetime of
the device.
Summary
Types
A modem control line the port can drive via set_modem_pins/3. Since 0.10.0.
Functions
Encode a list of modem lines as the configured_line_states bitmask
(:rts → bit 0, :dtr → bit 1).
Build an %Info{} from keyword options.
Convert to the protobuf SerialProxyInfo message used inside
DeviceInfoResponse.serial_proxies.
Types
@type line() :: :rts | :dtr
A modem control line the port can drive via set_modem_pins/3. Since 0.10.0.
@type port_type() :: :ttl | :rs232 | :rs485
@type t() :: %Espex.SerialProxy.Info{ configured_line_states: [line()], instance: non_neg_integer(), name: String.t(), port_type: port_type() }
Functions
@spec line_states_to_bits([line()]) :: non_neg_integer()
Encode a list of modem lines as the configured_line_states bitmask
(:rts → bit 0, :dtr → bit 1).
Build an %Info{} from keyword options.
@spec to_proto(t()) :: Espex.Proto.SerialProxyInfo.t()
Convert to the protobuf SerialProxyInfo message used inside
DeviceInfoResponse.serial_proxies.