ADB daemon transport connection for `@yume-chan/adb` using WebUSB ([MDN](https://developer.mozilla.org/en-US/docs/Web/API/USB), [Spec](https://wicg.github.io/webusb)) API.
ADB daemon transport device for `@yume-chan/adb` using WebUSB ([MDN](https://developer.mozilla.org/en-US/docs/Web/API/USB), [Spec](https://wicg.github.io/webusb)) API.
@@ -31,9 +31,9 @@ ADB daemon transport connection for `@yume-chan/adb` using WebUSB ([MDN](https:/
Node.js doesn't have native support for WebUSB API, but the [`usb`](https://www.npmjs.com/package/usb) NPM package provides a WebUSB compatible API.
To use a custom WebUSB API implementation, pass it to the constructor of `AdbDaemonWebUsbConnection`, `AdbDaemonWebUsbConnectionManager` and `AdbDaemonWebUsbConnectionWatcher` via the `usb` parameter.
To use a custom WebUSB API implementation, pass it to the constructor of `AdbDaemonWebUsbDevice`, `AdbDaemonWebUsbDeviceManager` and `AdbDaemonWebUsbConnectionWatcher` via the `usbManager` parameter.
## `AdbDaemonWebUsbConnection`
## `AdbDaemonWebUsbDevice`
### constructor
@@ -41,62 +41,62 @@ To use a custom WebUSB API implementation, pass it to the constructor of `AdbDae
Create a new instance of `AdbDaemonWebUsbConnection` using a specified `USBDevice` instance.
Create a new instance of `AdbDaemonWebUsbDevice` using a specified `USBDevice` instance.
`USBDevice` and `USB` types are from WebUSB API.
The `filters` parameter specifies the `classCode`, `subclassCode` and `protocolCode` to use when searching for ADB interface. The default value is `[{ classCode: 0xff, subclassCode: 0x42, protocolCode: 0x1 }]`, defined by Google.
### `device`
### `raw`
```ts
publicgetdevice():USBDevice;
publicgetraw():USBDevice;
```
Gets the `USBDevice` from the connection. Allow sending/receiving USB packets to other interfaces/endpoints. For example can be used with `@yume-chan/aoa` package.
Gets the raw `USBDevice` from the device. Allow sending/receiving USB packets to other interfaces/endpoints. For example can be used with `@yume-chan/aoa` package.
@@ -104,14 +104,14 @@ This is a convince method for `usb.requestDevice()`.
The `filters` parameter must have `classCode`, `subclassCode` and `protocolCode` fields for selecting the ADB interface. It can also have `vendorId`, `productId` or `serialNumber` fields to limit the displayed device list.
Returns an `AdbDaemonWebUsbConnection` instance, or `undefined` if the user cancelled the picker.
Returns an `AdbDaemonWebUsbDevice` instance, or `undefined` if the user cancelled the picker.