SerialPort: getSignals() method
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Dedicated Web Workers.
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.
Syntax
getSignals()
Parameters
None.
Return value
Returns a Promise that resolves with an object containing the following members:
clearToSend-
A boolean indicating to the other end of a serial connection that is clear to send data.
dataCarrierDetect-
A boolean that toggles the control signal needed to communicate over a serial connection.
dataSetReady-
A boolean indicating whether the device is ready to send and receive data.
ringIndicator-
A boolean indicating whether a ring signal should be sent down the serial connection.
Exceptions
InvalidStateErrorDOMException-
Returned if the port is not open. Call
SerialPort.open()to avoid this error. NetworkErrorDOMException-
Returned if the signals on the device could not be read.
Specifications
| Specification |
|---|
| Web Serial API # dom-serialport-getsignals |
Browser compatibility
| desktop | mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
getSignals
|
|
|
|
|
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- In development. Supported in a pre-release version.
- In development. Supported in a pre-release version.
- No support
- No support
- See implementation notes.