Private SLIP_Private SLIP_Private SLIP_Private SLIP_Private bufferPrivate lastPrivate onPrivate readerPrivate traceChange the host-side baud rate, preferring an in-place capability when the serial-port implementation provides one.
New baud rate.
Options to preserve when a reopen is required.
True when the port had to be closed and reopened.
Connect to serial device using the Webserial open method.
Number baud rate for serial connection. Default is 115200.
Serial Options for WebUSB SerialPort class.
Private detectActively drain the input buffer: wait for in-flight bytes to arrive (the ROM repeats an unsupported command response 8 times) and discard them. Flushing alone only drops the bytes already buffered.
Time without new bytes before considering the stream drained
Upper bound on the total wait
Read from serial device without SLIP formatting. Calls onData for each chunk. Stops when isClosed() returns true, the stream ends/errors, or disconnect() is called.
The reader is stored on the instance so that disconnect() can cancel a pending read: isClosed() is only evaluated after each chunk arrives, so on an idle device a function-local reader would keep the stream locked forever and make disconnect() block in waitForUnlock().
Callback for each chunk of data read
Function that returns true when reading should stop (e.g. when console is closed)
Send the dataTerminalReady (DTS) signal to given state
Boolean state to set the signal
Send the RequestToSend (RTS) signal to given state
Boolean state to set the signal
Wrapper class around Webserial API to communicate with the serial device.
Param: device
Requested device prompted by the browser.