Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/477.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 节点serialport新serialport选项的文档在哪里?_Javascript_Serial Port_Node Serialport - Fatal编程技术网

Javascript 节点serialport新serialport选项的文档在哪里?

Javascript 节点serialport新serialport选项的文档在哪里?,javascript,serial-port,node-serialport,Javascript,Serial Port,Node Serialport,仔细搜索后,我找不到这样的文档 告诉我第二个参数的选项和作用 对于新的SerialPort()节点,SerialPort文档非常糟糕,因为缺少更好的描述。它以一种非常荒谬的方式展示,并将关键信息隐藏在奇怪或相切的主题标题下 我想我明白你在追求什么;创建新的Serialport对象时可以在路径后传递的openOptions,对吗?那么应该是这样的: /** * @typedef {Object} openOptions * @property {boolean} [autoOpen=true]

仔细搜索后,我找不到这样的文档 告诉我第二个参数的选项和作用
对于新的SerialPort()

节点,SerialPort文档非常糟糕,因为缺少更好的描述。它以一种非常荒谬的方式展示,并将关键信息隐藏在奇怪或相切的主题标题下

我想我明白你在追求什么;创建新的Serialport对象时可以在路径后传递的openOptions,对吗?那么应该是这样的:

/**
 * @typedef {Object} openOptions
 * @property {boolean} [autoOpen=true] Automatically opens the port on `nextTick`.
 * @property {number=} [baudRate=9600] The baud rate of the port to be opened. This should match one of the commonly available baud rates, such as 110, 300, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, or 115200. Custom rates are supported best effort per platform. The device connected to the serial port is not guaranteed to support the requested baud rate, even if the port itself supports that baud rate.
 * @property {number} [dataBits=8] Must be one of these: 8, 7, 6, or 5.
 * @property {number} [highWaterMark=65536] The size of the read and write buffers defaults to 64k.
 * @property {boolean} [lock=true] Prevent other processes from opening the port. Windows does not currently support `false`.
 * @property {number} [stopBits=1] Must be one of these: 1 or 2.
 * @property {string} [parity=none] Must be one of these: 'none', 'even', 'mark', 'odd', 'space'.
 * @property {boolean} [rtscts=false] flow control setting
 * @property {boolean} [xon=false] flow control setting
 * @property {boolean} [xoff=false] flow control setting
 * @property {boolean} [xany=false] flow control setting
 * @property {object=} bindingOptions sets binding-specific options
 * @property {Binding=} Binding The hardware access binding. `Bindings` are how Node-Serialport talks to the underlying system. Will default to the static property `Serialport.Binding`.
 * @property {number} [bindingOptions.vmin=1] see [`man termios`](http://linux.die.net/man/3/termios) LinuxBinding and DarwinBinding
 * @property {number} [bindingOptions.vtime=0] see [`man termios`](http://linux.die.net/man/3/termios) LinuxBinding and DarwinBinding
 */
例如,要创建波特率为9600且无奇偶校验的新SerialPort对象:

var newPort = ("OS-appropriate comName here", { baudRate:9600, parity:"none"});

出于某种原因,这被隐藏在文档中,而不是放在前面和中心:

节点Serialport文档非常糟糕,因为缺少更好的描述。它以一种非常荒谬的方式展示,并将关键信息隐藏在奇怪或相切的主题标题下

我想我明白你在追求什么;创建新的Serialport对象时可以在路径后传递的openOptions,对吗?那么应该是这样的:

/**
 * @typedef {Object} openOptions
 * @property {boolean} [autoOpen=true] Automatically opens the port on `nextTick`.
 * @property {number=} [baudRate=9600] The baud rate of the port to be opened. This should match one of the commonly available baud rates, such as 110, 300, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, or 115200. Custom rates are supported best effort per platform. The device connected to the serial port is not guaranteed to support the requested baud rate, even if the port itself supports that baud rate.
 * @property {number} [dataBits=8] Must be one of these: 8, 7, 6, or 5.
 * @property {number} [highWaterMark=65536] The size of the read and write buffers defaults to 64k.
 * @property {boolean} [lock=true] Prevent other processes from opening the port. Windows does not currently support `false`.
 * @property {number} [stopBits=1] Must be one of these: 1 or 2.
 * @property {string} [parity=none] Must be one of these: 'none', 'even', 'mark', 'odd', 'space'.
 * @property {boolean} [rtscts=false] flow control setting
 * @property {boolean} [xon=false] flow control setting
 * @property {boolean} [xoff=false] flow control setting
 * @property {boolean} [xany=false] flow control setting
 * @property {object=} bindingOptions sets binding-specific options
 * @property {Binding=} Binding The hardware access binding. `Bindings` are how Node-Serialport talks to the underlying system. Will default to the static property `Serialport.Binding`.
 * @property {number} [bindingOptions.vmin=1] see [`man termios`](http://linux.die.net/man/3/termios) LinuxBinding and DarwinBinding
 * @property {number} [bindingOptions.vtime=0] see [`man termios`](http://linux.die.net/man/3/termios) LinuxBinding and DarwinBinding
 */
例如,要创建波特率为9600且无奇偶校验的新SerialPort对象:

var newPort = ("OS-appropriate comName here", { baudRate:9600, parity:"none"});
出于某种原因,这一点被隐藏在文档中,而不是放在前面和中间: