USBDevice: controlTransferIn() メソッド

Limited availability

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

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

USBDevice インターフェイスの controlTransferIn() メソッドは、コマンドまたは状態の操作の要求の USB デバイスへの送信 (USB デバイスでの受信) が完了したら USBInTransferResult で解決する Promise を返します。

構文

js
controlTransferIn(setup, length)

引数

setup

オプションを設定するオブジェクトです。以下のオプションが使用可能です。

requestType

転送の性質を示します。"standard" (すべての USB デバイスに共通)、"class" (業界標準のクラスまたはデバイスに共通)、"vendor" のいずれかの値でなければなりません。

recipient

デバイス上の転送の対象を指定します。"device""interface""endpoint""other" のいずれかです。

request

ベンダー固有のコマンドです。

value

ベンダー固有のリクエストパラメーターです。

index

宛先のインターフェイス番号です。

length

デバイスから読み取る最大のバイト数です。実際のデータは、解決したプロミス内の USBInTransferResult に格納されます。

返値

USBInTransferResult で解決する promise です。

仕様書

Specification
WebUSB API
# ref-for-dom-usbdevice-controltransferin

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
controlTransferIn
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.