ModbusTypedClient class abstract
Type-safe Modbus client for creating easy-to-use Modbus calls.
This class aims to abstract away client creation / management, type conversion, and register addresses from the users of the modbus call.
Consumers can easily call read or write without having to deal with the connection to the underlying ModbusClient. The client also uses the given TypeConverters to automatically convert data from the Modbus registers to Dart types and vice versa.
Consumer can also define Modbus API calls based on a device's Modbus spec. These calls can then be used like functions / methods to read / write to the device by end-users of the API.
Constructors
-
ModbusTypedClient({required ModbusClient sourceClient, required Iterable<
TypeConverter> typeConverters}) -
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createReadCall<
T> (Register registerType, int address) → ModbusClientReader< T> -
createWriteCall<
T> (int address) → ModbusClientWriter< T> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read<
T> (Register registerType, int address, {Duration updateInterval = defaultModbusUpdateInterval, bool distinct = true, AreEqual< T> ? areEqual}) → Stream<T> -
toString(
) → String -
A string representation of this object.
inherited
-
write<
T> (int address, T value) → Future< void>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited