SerialPort
The SerialPort interface of the Web Serial API provides access to a serial port on the host device. Available only in secure contexts.
Properties
The readable read-only property of the SerialPort interface returns a ReadableStream for receiving data from the device connected to the port. Chunks read from this stream are instances of Uint8Array. This property is non-null as long as the port is open and has not encountered a fatal error.
The writable read-only property of the SerialPort interface returns a WritableStream for sending data to the device connected to the port. Chunks written to this stream must be instances of ArrayBuffer, TypedArray, or DataView. This property is non-null as long as the port is open and has not encountered a fatal error.
Functions
The SerialPort.close() method of the SerialPort interface returns a Promise that resolves when the port closes.
The SerialPort.close() method of the SerialPort interface returns a Promise that resolves when the port closes.
The SerialPort.forget() method of the SerialPort interface returns a Promise that resolves when access to the serial port is revoked.
The SerialPort.forget() method of the SerialPort interface returns a Promise that resolves when access to the serial port is revoked.
The getInfo() method of the SerialPort interface returns an object containing identifying information for the device available via the port.
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.
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.
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.
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.
The setSignals() method of the SerialPort interface sets control signals on the port and returns a Promise that resolves when they are set.
The setSignals() method of the SerialPort interface sets control signals on the port and returns a Promise that resolves when they are set.