hasRight(deviceName: string): boolean
|
Checks whether the user, for example, the application or system, has the device access permissions. The value true is returned if the user has the device access permissions; the value false is returned otherwise.
|
requestRight(deviceName: string): Promise<boolean>
|
Requests the temporary permission for a given application to access the USB device.
|
connectDevice(device: USBDevice): Readonly<USBDevicePipe>
|
Connects to the USB device based on the device information returned by getDevices().
|
getDevices(): Array<Readonly<USBDevice>>
|
Obtains the USB device list.
|
setConfiguration(pipe: USBDevicePipe, config: USBConfig): number
|
Sets the USB device configuration.
|
setInterface(pipe: USBDevicePipe, iface: USBInterface): number
|
Sets a USB interface.
|
claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number
|
Claims a USB interface
|
function bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise<number>
|
Performs bulk transfer.
|
closePipe(pipe: USBDevicePipe): number
|
Closes a USB device pipe.
|
releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number
|
Releases a USB interface.
|
getFileDescriptor(pipe: USBDevicePipe): number
|
Obtains the file descriptor.
|
getRawDescriptor(pipe: USBDevicePipe): Uint8Array
|
Obtains the raw USB descriptor.
|
controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise<number>
|
Performs control transfer.
|