This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The controlTransferIn()
method of the USBDevice
interface returns a promise
that resolves with a USBInTransferResult
when a command or status operation has been transmitted to the USB device.
var promise = USBDevice.controlTransferIn(setup, length)
requestType
: Must be one of three values specifying whether the tranfer is "standard"
(common to all USB devices) "class"
(common to an industry-standard class of devices) or "vendor"
.recipient
: Specifices the target of the transfer on the device, one of "device"
, "interface"
, "endpoint"
, or "other"
.request
: A vendor-specific command.value
: Vender-specific request parameters.index
: The interface number of the recipient.USBInTransferResult
in the resolved Promise.promise
that resolves with a USBInTransferResult
.
Specification | Status | Comment |
---|---|---|
WebUSB The definition of 'controlTransferIn()' in that specification. | Draft | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 61 | No | No | No | 48 | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | No | 61 | No | No | 48 | No | No |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferIn