Table of Contents

Class Serial

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The Serial 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

EventHandlerNonNull

Ondisconnect

[Value("ondisconnect")]
public EventHandlerNonNull Ondisconnect { get; set; }

Property Value

EventHandlerNonNull

Methods

GetPorts()

NOTE
Experimental
The getPorts() 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
Experimental
The Serial.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

options SerialPortRequestOptions

Returns

Task<SerialPort>

A {{jsxref("Promise")}} that resolves with an instance of SerialPort.

Remarks