USBDevice: controlTransferOut() メソッド

Limited availability

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

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

USBDevice インターフェイスの controlTransferOut() メソッドは、コマンドまたは状態の操作の USB デバイスからの転送が完了したら USBOutTransferResult で解決する Promise を返します。

構文

js
controlTransferOut(setup, data)

引数

setup

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

requestType

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

recipient

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

request

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

value

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

index

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

data

デバイスに転送されるデータが格納された TypedArray です。すべてのコマンドで data が必要なわけではありません。引数 value だけでデータを送ることができるコマンドもあります。特定の要求に何が必要かは、デバイスを確認してください。

返値

USBOutTransferResult で解決する Promise です。

仕様書

Specification
WebUSB API
# ref-for-dom-usbdevice-controltransferout①

ブラウザーの互換性

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
controlTransferOut
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.