Serial

open class Serial : EventTarget(source)

The Serial interface of the Web Serial API provides attributes and methods for finding and connecting to serial ports from a web page. Available only in secure contexts.

MDN Reference

Functions

Link copied to clipboard
open fun dispatchEvent(event: Event): Boolean
Link copied to clipboard
inline suspend fun Serial.getPorts(): ReadonlyArray<SerialPort>

The getPorts() method of the Serial interface returns a Promise that resolves with an array of SerialPort objects representing serial ports connected to the host which the origin has permission to access.

Link copied to clipboard

The getPorts() method of the Serial interface returns a Promise that resolves with an array of SerialPort objects representing serial ports connected to the host which the origin has permission to access.

Link copied to clipboard
inline suspend fun Serial.requestPort(): SerialPort

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 Promise that resolves with an instance of SerialPort representing the device chosen by the user.

Link copied to clipboard
fun requestPortAsync(options: SerialPortRequestOptions = definedExternally): Promise<SerialPort>

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 Promise that resolves with an instance of SerialPort representing the device chosen by the user.

Link copied to clipboard