UsbSerial class
UsbSerial is the main entry point into this class and can create UsbPorts or list devices.
Constructors
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited
Static Properties
-
usbEventStream
→ Stream<
String> -
Use this stream to detect if a USB device is plugged in or removed. [...]
read-only
Static Methods
-
create(
int vid, int pid, [ String type = "", int interface = -1 ]) → Future< UsbPort> - Creates a UsbPort from vid, pid and optionally type and interface. throws an error on failure. This function will pop up a permission request if needed. [...]
-
createFromDeviceId(
int deviceId, [ String type = "", int interface = -1 ]) → Future< UsbPort> - Creates a UsbPort from deviceId optionally type and interface. throws an error on failure. This function will pop up a permission request if needed. Note deviceId is only valid for the duration of a device being plugged in. Once unplugged and replugged this id changes. [...]
-
listDevices(
) → Future< List< UsbDevice> > - Returns a list of UsbDevices currently plugged in.
Constants
- CDC → const String
-
CDC class constant. Very common USB to UART bridge type. Used by create
"cdc"
- CH34x → const String
-
CH34X hardware type. Used by create
"ch34x"
- CP210x → const String
-
CP210x hardware type. Used by create
"cp210x"
- FTDI → const String
-
FTDI Hardware USB to Uart bridge. (Very common) Used by create
"ftdi"
- PL2303 → const String
-
PL2303 Hardware USB to Uart bridge. (Fairly common) Used by create
"pl2303"