Package-level declarations

Types

Link copied to clipboard
sealed interface FlowControlType
Link copied to clipboard
sealed interface ParityType
Link copied to clipboard
open class Serial : EventTarget

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.

Link copied to clipboard
Link copied to clipboard
interface SerialOptions
Link copied to clipboard
Link copied to clipboard
open class SerialPort : EventTarget

The SerialPort interface of the Web Serial API provides access to a serial port on the host device. Available only in secure contexts.

Link copied to clipboard
Link copied to clipboard
interface SerialPortInfo
Link copied to clipboard

Functions

Link copied to clipboard
inline suspend fun SerialPort.close()

The SerialPort.close() method of the SerialPort interface returns a Promise that resolves when the port closes.

Link copied to clipboard
inline suspend fun SerialPort.forget()

The SerialPort.forget() method of the SerialPort interface returns a Promise that resolves when access to the serial port is revoked.

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 SerialPort.getSignals() method of the SerialPort interface returns a Promise that resolves with an object containing the current state of the port's control signals.

Link copied to clipboard
inline suspend fun SerialPort.open(options: SerialOptions)

The open() method of the SerialPort interface returns a Promise that resolves when the port is opened. By default the port is opened with 8 data bits, 1 stop bit and no parity checking. The baudRate parameter is required.

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
inline suspend fun SerialPort.setSignals()
inline suspend fun SerialPort.setSignals(signals: SerialOutputSignals)

The setSignals() method of the SerialPort interface sets control signals on the port and returns a Promise that resolves when they are set.