Class Serial
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalSerial interface of the Web Serial API provides attributes and methods for finding and connecting to serial ports from a web page.
[Value("Serial")]
public class Serial : EventTarget
- Inheritance
-
Serial
- Inherited Members
Remarks
Constructors
Serial()
public Serial()
Properties
Onconnect
[Value("onconnect")]
public EventHandlerNonNull Onconnect { get; set; }
Property Value
Ondisconnect
[Value("ondisconnect")]
public EventHandlerNonNull Ondisconnect { get; set; }
Property Value
Methods
GetPorts()
NOTE
ExperimentalgetPorts() method of the Serial interface returns a {{jsxref("Promise")}} that resolves with an array of SerialPort objects representing serial ports connected to the host which the origin has permission to access.
[Value("getPorts")]
public Task<List<SerialPort>> GetPorts()
Returns
- Task<List<SerialPort>>
A {{jsxref("Promise")}} that resolves with an array of SerialPort objects.
Remarks
RequestPort(SerialPortRequestOptions)
NOTE
ExperimentalSerial.requestPort() method of the Serial interface presents the user with a dialog asking them to select a serial device to connect to. It returns a {{jsxref("Promise")}} that resolves with an instance of SerialPort representing the device chosen by the user.
[Value("requestPort")]
public Task<SerialPort> RequestPort(SerialPortRequestOptions options = null)
Parameters
optionsSerialPortRequestOptions
Returns
- Task<SerialPort>
A {{jsxref("Promise")}} that resolves with an instance of SerialPort.