web api interface
USBDevice
Limited availabilitySecure contextAvailable in workers
The USBDevice interface of the WebUSB API provides access to metadata about a paired USB device and methods for controlling it.
Instance properties
configurationRead only Experimental- : A
USBConfigurationobject for the currently selected interface for a paired USB device.
- : A
configurationsRead only Experimental- : An
Arrayof device-specific interfaces for controlling a paired USB device.
- : An
deviceClassRead only Experimental- : One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are
USBDevice.deviceSubclassandUSBDevice.deviceProtocol.
- : One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are
deviceProtocolRead only Experimental- : One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are
USBDevice.deviceClassandUSBDevice.deviceSubclass.
- : One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are
deviceSubclassRead only Experimental- : One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are
USBDevice.deviceClassandUSBDevice.deviceProtocol.
- : One of three properties that identify USB devices for the purpose of loading a USB driver that will work with that device. The other two properties are
deviceVersionMajorRead only Experimental- : The major version number of the device in a semantic versioning scheme.
deviceVersionMinorRead only Experimental- : The minor version number of the device in a semantic versioning scheme.
deviceVersionSubminorRead only Experimental- : The patch version number of the device in a semantic versioning scheme.
manufacturerNameRead only Experimental- : The name of the organization that manufactured the USB device.
openedRead only Experimental- : Indicates whether a session has been started with a paired USB device.
productIdRead only Experimental- : The manufacturer-defined code that identifies a USB device.
productNameRead only Experimental- : The manufacturer-defined name that identifies a USB device.
serialNumberRead only Experimental- : The manufacturer-defined serial number for the specific USB device.
usbVersionMajorRead only Experimental- : One of three properties that declare the USB protocol version supported by the device. The other two properties are
USBDevice.usbVersionMinorandUSBDevice.usbVersionSubminor.
- : One of three properties that declare the USB protocol version supported by the device. The other two properties are
usbVersionMinorRead only Experimental- : One of three properties that declare the USB protocol version supported by the device. The other two properties are
USBDevice.usbVersionMajorandUSBDevice.usbVersionSubminor.
- : One of three properties that declare the USB protocol version supported by the device. The other two properties are
usbVersionSubminorRead only Experimental- : One of three properties that declare the USB protocol version supported by the device. The other two properties are
USBDevice.usbVersionMajorandUSBDevice.usbVersionMinor.
- : One of three properties that declare the USB protocol version supported by the device. The other two properties are
vendorIdRead only Experimental- : The official usb.org-assigned vendor ID.
Instance methods
claimInterface()Experimental- : Returns a
Promisethat resolves when the requested interface is claimed for exclusive access.
- : Returns a
clearHalt()Experimental- : Returns a
Promisethat resolves when a halt condition is cleared.
- : Returns a
controlTransferIn()Experimental- : Returns a
Promisethat resolves with aUSBInTransferResultwhen a command or status operation has been transmitted to the USB device.
- : Returns a
controlTransferOut()Experimental- : Returns a
Promisethat resolves with aUSBOutTransferResultwhen a command or status operation has been transmitted from the USB device.
- : Returns a
close()Experimental- : Returns a
Promisethat resolves when all open interfaces are released and the device session has ended.
- : Returns a
forget()Experimental- : Returns a
Promisethat resolves after all open interfaces are released, the device session has ended, and the permission is reset.
- : Returns a
isochronousTransferIn()Experimental- : Returns a
Promisethat resolves with aUSBIsochronousInTransferResultwhen time sensitive information has been transmitted to the USB device.
- : Returns a
isochronousTransferOut()Experimental- : Returns a
Promisethat resolves with aUSBIsochronousOutTransferResultwhen time sensitive information has been transmitted from the USB device.
- : Returns a
open()Experimental- : Returns a
Promisethat resolves when a device session has started.
- : Returns a
releaseInterface()Experimental- : Returns a
Promisethat resolves when a claimed interface is released from exclusive access.
- : Returns a
reset()Experimental- : Returns a
Promisethat resolves when the device is reset and all app operations canceled and their promises rejected.
- : Returns a
selectAlternateInterface()Experimental- : Returns a
Promisethat resolves when the specified alternative endpoint is selected.
- : Returns a
selectConfiguration()Experimental- : Returns a
Promisethat resolves when the specified configuration is selected.
- : Returns a
transferIn()Experimental- : Returns a
Promisethat resolves with aUSBInTransferResultwhen bulk or interrupt data is received from the USB device.
- : Returns a
transferOut()Experimental- : Returns a
Promisethat resolves with aUSBOutTransferResultwhen bulk or interrupt data is sent to the USB device.
- : Returns a
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.