Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. USBDevice

USBDevice

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is available inWeb Workers.

TheUSBDevice interface of theWebUSB API provides access to metadata about a paired USB device and methods for controlling it.

Instance properties

USBDevice.configurationRead onlyExperimental

AUSBConfiguration object for the currently selected interface for a paired USB device.

USBDevice.configurationsRead onlyExperimental

Anarray of device-specific interfaces for controlling a paired USB device.

USBDevice.deviceClassRead onlyExperimental

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 areUSBDevice.deviceSubclass andUSBDevice.deviceProtocol.

USBDevice.deviceProtocolRead onlyExperimental

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 areUSBDevice.deviceClass andUSBDevice.deviceSubclass.

USBDevice.deviceSubclassRead onlyExperimental

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 areUSBDevice.deviceClass andUSBDevice.deviceProtocol.

USBDevice.deviceVersionMajorRead onlyExperimental

The major version number of the device in a semantic versioning scheme.

USBDevice.deviceVersionMinorRead onlyExperimental

The minor version number of the device in a semantic versioning scheme.

USBDevice.deviceVersionSubminorRead onlyExperimental

The patch version number of the device in a semantic versioning scheme.

USBDevice.manufacturerNameRead onlyExperimental

The name of the organization that manufactured the USB device.

USBDevice.openedRead onlyExperimental

Indicates whether a session has been started with a paired USB device.

USBDevice.productIdRead onlyExperimental

The manufacturer-defined code that identifies a USB device.

USBDevice.productNameRead onlyExperimental

The manufacturer-defined name that identifies a USB device.

USBDevice.serialNumberRead onlyExperimental

The manufacturer-defined serial number for the specific USB device.

USBDevice.usbVersionMajorRead onlyExperimental

One of three properties that declare the USB protocol version supported by the device. The other two properties areUSBDevice.usbVersionMinor andUSBDevice.usbVersionSubminor.

USBDevice.usbVersionMinorRead onlyExperimental

One of three properties that declare the USB protocol version supported by the device. The other two properties areUSBDevice.usbVersionMajor andUSBDevice.usbVersionSubminor.

USBDevice.usbVersionSubminorRead onlyExperimental

One of three properties that declare the USB protocol version supported by the device. The other two properties areUSBDevice.usbVersionMajor andUSBDevice.usbVersionMinor.

USBDevice.vendorIdRead onlyExperimental

The official usb.org-assigned vendor ID.

Instance methods

USBDevice.claimInterface()Experimental

Returns aPromise that resolves when the requested interface is claimed for exclusive access.

USBDevice.clearHalt()Experimental

Returns aPromise that resolves when a halt condition is cleared.

USBDevice.controlTransferIn()Experimental

Returns aPromise that resolves with aUSBInTransferResult when a command or status operation has been transmitted to the USB device.

USBDevice.controlTransferOut()Experimental

Returns aPromise that resolves with aUSBOutTransferResult when a command or status operation has been transmitted from the USB device.

USBDevice.close()Experimental

Returns aPromise that resolves when all open interfaces are released and the device session has ended.

USBDevice.forget()Experimental

Returns aPromise that resolves after all open interfaces are released, the device session has ended, and the permission is reset.

USBDevice.isochronousTransferIn()Experimental

Returns aPromise that resolves with aUSBIsochronousInTransferResult when time sensitive information has been transmitted to the USB device.

USBDevice.isochronousTransferOut()Experimental

Returns aPromise that resolves with aUSBIsochronousOutTransferResult when time sensitive information has been transmitted from the USB device.

USBDevice.open()Experimental

Returns aPromise that resolves when a device session has started.

USBDevice.releaseInterface()Experimental

Returns aPromise that resolves when a claimed interface is released from exclusive access.

USBDevice.reset()Experimental

Returns aPromise that resolves when the device is reset and all app operations canceled and their promises rejected.

USBDevice.selectAlternateInterface()Experimental

Returns aPromise that resolves when the specified alternative endpoint is selected.

USBDevice.selectConfiguration()Experimental

Returns aPromise that resolves when the specified configuration is selected.

USBDevice.transferIn()Experimental

Returns aPromise that resolves with aUSBInTransferResult when bulk or interrupt data is received from the USB device.

USBDevice.transferOut()Experimental

Returns aPromise that resolves with aUSBOutTransferResult when bulk or interrupt data is sent to the USB device.

Specifications

Specification
WebUSB API
# device-usage

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp