mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
also added connect/disconnect in Request node
This commit is contained in:
parent
b1855ab26e
commit
69cc1b5a09
@ -143,6 +143,14 @@ module.exports = function(RED) {
|
|||||||
node.port = serialPool.get(this.serialConfig);
|
node.port = serialPool.get(this.serialConfig);
|
||||||
// Serial Out
|
// Serial Out
|
||||||
node.on("input",function(msg) {
|
node.on("input",function(msg) {
|
||||||
|
if (msg.hasOwnProperty("disconnect") && this.serialConfig) {
|
||||||
|
serialPool.disconnect(this.serialConfig.serialport);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (msg.hasOwnProperty("connect") && this.serialConfig) {
|
||||||
|
serialPool.connect(this.serialConfig.serialport);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (msg.hasOwnProperty("baudrate")) {
|
if (msg.hasOwnProperty("baudrate")) {
|
||||||
var baud = parseInt(msg.baudrate);
|
var baud = parseInt(msg.baudrate);
|
||||||
if (isNaN(baud)) {
|
if (isNaN(baud)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user