mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Serial port only report close error once
This commit is contained in:
parent
876c9a014e
commit
a266d372b2
@ -328,7 +328,10 @@ module.exports = function(RED) {
|
|||||||
});
|
});
|
||||||
obj.serial.on('close', function() {
|
obj.serial.on('close', function() {
|
||||||
if (!obj._closing) {
|
if (!obj._closing) {
|
||||||
RED.log.error(RED._("serial.errors.unexpected-close",{port:port}));
|
if (olderr !== "unexpected") {
|
||||||
|
olderr = "unexpected";
|
||||||
|
RED.log.error(RED._("serial.errors.unexpected-close",{port:port}));
|
||||||
|
}
|
||||||
obj._emitter.emit('closed');
|
obj._emitter.emit('closed');
|
||||||
if (obj.tout) { clearTimeout(obj.tout); }
|
if (obj.tout) { clearTimeout(obj.tout); }
|
||||||
obj.tout = setTimeout(function() {
|
obj.tout = setTimeout(function() {
|
||||||
|
@ -6,7 +6,7 @@ hardware serial ports.
|
|||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
To install the stable version use the `Menu - Manage palette` option and search for node-red-node-serialport, or run the following command in your Node-RED user directory, typically `~/.node-red`
|
To install the stable version use the `Menu - Manage palette - Install` option and search for node-red-node-serialport, or run the following command in your Node-RED user directory, typically `~/.node-red`
|
||||||
|
|
||||||
npm i node-red-node-serialport
|
npm i node-red-node-serialport
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-serialport",
|
"name" : "node-red-node-serialport",
|
||||||
"version" : "0.8.6",
|
"version" : "0.8.7",
|
||||||
"description" : "Node-RED nodes to talk to serial ports",
|
"description" : "Node-RED nodes to talk to serial ports",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"serialport" : "^7.1.5"
|
"serialport" : "^7.1.5"
|
||||||
|
Loading…
Reference in New Issue
Block a user