Class USB
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalUSB interface of the WebUSB API provides attributes and methods for finding and connecting USB devices from a web page.
[Value("USB")]
public class USB : EventTarget
- Inheritance
-
USB
- Inherited Members
Remarks
Use Usb to get access to the USB object.
The USB interface inherits from EventTarget.
Constructors
USB()
public USB()
Properties
Onconnect
[Value("onconnect")]
public EventHandlerNonNull Onconnect { get; set; }
Property Value
Ondisconnect
[Value("ondisconnect")]
public EventHandlerNonNull Ondisconnect { get; set; }
Property Value
Methods
GetDevices()
NOTE
ExperimentalgetDevices method of the USB interfacereturns a {{JSxRef("Promise")}} that resolves with an array of USBDevice
objects for paired attached devices. For information on pairing devices, see
RequestDevice(USBDeviceRequestOptions).
[Value("getDevices")]
public Task<List<USBDevice>> GetDevices()
Returns
Remarks
RequestDevice(USBDeviceRequestOptions)
NOTE
ExperimentalrequestDevice() method of the USBinterface returns a Promise that resolves with an instance of
USBDevice if the specified device is found. Calling this function
triggers the user agent's pairing flow.
[Value("requestDevice")]
public Task<USBDevice> RequestDevice(USBDeviceRequestOptions options)
Parameters
optionsUSBDeviceRequestOptions