ChromeUsb class

Properties

hashCode int
The hash code for this object.
no setterinherited
isAvailable bool
no setter
onDeviceAdded EventStream<Device>
Event generated when a device is added to the system. Events are only broadcast to apps and extensions that have permission to access the device. Permission may have been granted at install time, when the user accepted an optional permission (see permissions.request), or through getUserSelectedDevices.
no setter
onDeviceRemoved EventStream<Device>
Event generated when a device is removed from the system. See onDeviceAdded for which events are delivered.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bulkTransfer(ConnectionHandle handle, GenericTransferInfo transferInfo) Future<TransferResultInfo>
Performs a bulk transfer on the specified device. |handle|: An open connection to the device. |transferInfo|: The transfer parameters.
claimInterface(ConnectionHandle handle, int interfaceNumber) Future<void>
Claims an interface on a USB device. Before data can be transfered to an interface or associated endpoints the interface must be claimed. Only one connection handle can claim an interface at any given time. If the interface is already claimed, this call will fail.
closeDevice(ConnectionHandle handle) Future<void>
Closes a connection handle. Invoking operations on a handle after it has been closed is a safe operation but causes no action to be taken. |handle|: The ConnectionHandle to close.
controlTransfer(ConnectionHandle handle, ControlTransferInfo transferInfo) Future<TransferResultInfo>
Performs a control transfer on the specified device.
findDevices(EnumerateDevicesAndRequestAccessOptions options) Future<List<ConnectionHandle>>
Finds USB devices specified by the vendor, product and (optionally) interface IDs and if permissions allow opens them for use.
getConfiguration(ConnectionHandle handle) Future<ConfigDescriptor>
Gets the configuration descriptor for the currently selected configuration. |handle|: An open connection to the device.
getConfigurations(Device device) Future<List<ConfigDescriptor>>
Returns the full set of device configuration descriptors. |device|: The Device to fetch descriptors from.
getDevices(EnumerateDevicesOptions options) Future<List<Device>>
Enumerates connected USB devices. |options|: The properties to search for on target devices.
getUserSelectedDevices(DevicePromptOptions options) Future<List<Device>>
Presents a device picker to the user and returns the Devices selected. If the user cancels the picker devices will be empty. A user gesture is required for the dialog to display. Without a user gesture, the callback will run as though the user cancelled. |options|: Configuration of the device picker dialog box. |callback|: Invoked with a list of chosen Devices.
interruptTransfer(ConnectionHandle handle, GenericTransferInfo transferInfo) Future<TransferResultInfo>
Performs an interrupt transfer on the specified device. |handle|: An open connection to the device. |transferInfo|: The transfer parameters.
isochronousTransfer(ConnectionHandle handle, IsochronousTransferInfo transferInfo) Future<TransferResultInfo>
Performs an isochronous transfer on the specific device. |handle|: An open connection to the device.
listInterfaces(ConnectionHandle handle) Future<List<InterfaceDescriptor>>
Lists all interfaces on a USB device. |handle|: An open connection to the device.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openDevice(Device device) Future<ConnectionHandle>
Opens a USB device returned by getDevices. |device|: The Device to open.
releaseInterface(ConnectionHandle handle, int interfaceNumber) Future<void>
Releases a claimed interface. |handle|: An open connection to the device. |interfaceNumber|: The interface to be released.
requestAccess(Device device, int interfaceId) Future<bool>
Requests access from the permission broker to a device claimed by Chrome OS if the given interface on the device is not claimed.
resetDevice(ConnectionHandle handle) Future<bool>
Tries to reset the USB device. If the reset fails, the given connection handle will be closed and the USB device will appear to be disconnected then reconnected. In this case getDevices or findDevices must be called again to acquire the device.
setConfiguration(ConnectionHandle handle, int configurationValue) Future<void>
Select a device configuration.
setInterfaceAlternateSetting(ConnectionHandle handle, int interfaceNumber, int alternateSetting) Future<void>
Selects an alternate setting on a previously claimed interface. |handle|: An open connection to the device where this interface has been claimed. |interfaceNumber|: The interface to configure. |alternateSetting|: The alternate setting to configure.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited