FlutterUsbSerialManager class
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serialDataStream
→ Stream<
String> -
Raw bytes pushed by native while onReadInterval is active.
no setter
-
soilDataStream
→ Stream<
Map< String, double> > -
Soil-sensor samples pushed by native while onReadSoilDataInterval is active.
no setter
Methods
-
connect(
UsbDevice device, {int baudRate = 9600}) → Future< bool> -
Opens a serial connection to
deviceatbaudRate. -
disconnect(
) → Future< void> - Closes the current serial connection.
-
getConnectedDevice(
) → Future< UsbDevice?> - Returns the currently connected device, or null if none.
-
getDeviceList(
) → Future< List< UsbDevice> > - Lists USB devices currently attached to the host.
-
hasPermission(
UsbDevice device) → Future< bool> -
Whether the app already has permission to access
device. -
isConnected(
) → Future< bool> - Whether a device is currently connected.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
offReadInterval(
) → Future< void> - Stops the raw-read interval started by onReadInterval.
-
offReadSoilDataInterval(
) → Future< void> - Stops the soil-read interval started by onReadSoilDataInterval.
-
onReadInterval(
{RawReadConfig config = const RawReadConfig(), int intervalMs = 1000}) → Future< void> -
Starts periodic raw reads (using
configper read); results arrive on serialDataStream. -
onReadSoilDataInterval(
{SoilSensorConfig config = const SoilSensorConfig(), int intervalMs = 1000}) → Future< void> -
Starts periodic soil-sensor reads (using
configper read); results arrive on soilDataStream. -
read(
{RawReadConfig config = const RawReadConfig()}) → Future< String> -
Reads raw bytes according to
config. -
readSoilData(
{SoilSensorConfig config = const SoilSensorConfig()}) → Future< Map< String, double> ?> -
Reads one Modbus soil-sensor sample according to
config. -
requestUsbPermission(
UsbDevice device) → Future< bool> -
Shows the Android USB-permission dialog for
device. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String data) → Future< void> -
Writes
datato the currently connected device.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited