SoilSensorService class
High-level USB serial sensor service.
Abstracts over platform differences (Android: usb_serial / Windows: flutter_libserialport). Implements Modbus RTU FC03 to read soil sensor registers.
Constructors
- SoilSensorService({int baudRate = 9600, int slaveAddress = 1})
Properties
- baudRate ↔ int
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slaveAddress ↔ int
-
getter/setter pair
Methods
-
connect(
String deviceId) → Future< void> -
Open connection to
deviceId(as returned by listDevices). -
disconnect(
) → Future< void> - Close the active connection and release all resources.
-
dispose(
) → Future< void> - Disconnect and permanently close the service.
-
listDevices(
) → Future< List< String> > - Returns displayable / connectable device identifiers.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readSensor(
{int maxRetries = 3}) → Future< SensorReading> -
Read sensor data, retrying up to
maxRetriestimes on failure. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited