Dart Documentationchrome.usbConnectionHandle

ConnectionHandle class

Returned by openDevice to be used for USB communication. Every time a device is opened, a new connection handle is created.

A connection handle represents the underlying data structure that contains all the data we need to communicate with a USB device, including the status of interfaces, the pending transfers, the descriptors, and etc. A connectin handle id is different from a USB device id.

All connection handles can work together if the device allows it. The connection handle will be automatically closed when the app is reloaded or suspended.

When a connection handle is closed, all the interfaces it claimed will be released and all the transfers in progress will be canceled immediately.

class ConnectionHandle extends ChromeObject {
 ConnectionHandle({int handle, int vendorId, int productId}) {
   if (handle != null) this.handle = handle;
   if (vendorId != null) this.vendorId = vendorId;
   if (productId != null) this.productId = productId;
 }
 ConnectionHandle.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 int get handle => jsProxy['handle'];
 set handle(int value) => jsProxy['handle'] = value;

 int get vendorId => jsProxy['vendorId'];
 set vendorId(int value) => jsProxy['vendorId'] = value;

 int get productId => jsProxy['productId'];
 set productId(int value) => jsProxy['productId'] = value;
}

Extends

ChromeObject > ConnectionHandle

Constructors

new ConnectionHandle({int handle, int vendorId, int productId}) #

Create a new instance of a ChromeObject, which creates and delegates to a JsObject proxy.

docs inherited from ChromeObject
ConnectionHandle({int handle, int vendorId, int productId}) {
 if (handle != null) this.handle = handle;
 if (vendorId != null) this.vendorId = vendorId;
 if (productId != null) this.productId = productId;
}

new ConnectionHandle.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
ConnectionHandle.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

Properties

int handle #

int get handle => jsProxy['handle'];
set handle(int value) => jsProxy['handle'] = value;

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

int productId #

int get productId => jsProxy['productId'];
set productId(int value) => jsProxy['productId'] = value;

int vendorId #

int get vendorId => jsProxy['vendorId'];
set vendorId(int value) => jsProxy['vendorId'] = value;

Methods

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

inherited from ChromeObject

Returns a string representation of this object.

docs inherited from Object
String toString() => jsProxy.toString();