You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it a bit easier to have platform specific open options. I'm in love with the solution but it doesn't seem possible to filter the generic via a typecheck and have it apply to the open options. So casting the open options is the only recouse I've figured out.
* Retrieves a list of available serial ports with metadata. Only the `path` is guaranteed. If unavailable the other fields will be undefined. The `path` is either the path or an identifier (eg `COM1`) used to open the SerialPort.
11
11
*
@@ -57,10 +57,11 @@ export class SerialPort extends SerialPortStream<AutoDetectTypes> {
* The hardware access binding. `Bindings` are how Node-Serialport talks to the underlying system. By default we auto detect Windows (`WindowsBinding`), Linux (`LinuxBinding`) and OS X (`DarwinBinding`) and load the appropriate module for your system.
52
+
* The hardware access binding. `Bindings` are how Node-Serialport talks to the underlying system. If you're using the `serialport` package, this defaults to `'@serialport/bindings-cpp'` which auto detects Windows (`WindowsBinding`), Linux (`LinuxBinding`) and OS X (`DarwinBinding`) and load the appropriate module for your system.
* Create a new serial port object for the `path`. In the case of invalid arguments or invalid options, when constructing a new SerialPort it will throw an error. The port will open automatically by default, which is the equivalent of calling `port.open(openCallback)` in the next tick. You can disable this by setting the option `autoOpen` to `false`.
77
-
* @param {OpenOptions=} options - Port configuration options
78
-
* @param {ErrorCallback=} openCallback - If `autoOpen` is true (the default) it will be provided to `port.open()` and run after the port is opened. The callback will be ignored if `autoOpen` is set to `false`.
79
-
* @property {number} baudRate The port's baudRate. Use `.update` to change it. Read-only.
80
-
* @property {string} path The system path or name of the serial port. Read-only.
81
-
* @property {boolean} isOpen `true` if the port is open, `false` otherwise. Read-only.
82
-
* @property {InternalSettings} settings The current settings of the port
83
-
* @throws {TypeError} When given invalid arguments, a `TypeError` will be thrown.
0 commit comments