From 27a22609a157c263a9f43e1f943312181b3626b6 Mon Sep 17 00:00:00 2001 From: phillipivan Date: Sat, 9 Dec 2023 16:44:24 +1100 Subject: [PATCH] minor changes --- src/processcmd.js | 4 ++-- src/tcp.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/processcmd.js b/src/processcmd.js index 6dc745a..f0345f8 100644 --- a/src/processcmd.js +++ b/src/processcmd.js @@ -8,7 +8,7 @@ module.exports = { reply = reply.slice(1) } reply = reply.split(addrSep) - let address = reply[1] === undefined ? 'NONE' : reply[1].toString() + let address = reply[1] === undefined ? addrCmd.none : reply[1].toString() reply = reply[0] let ctrl = reply[1].toString() let tag = reply[2] === undefined ? '' : reply[2].toString() @@ -19,7 +19,7 @@ module.exports = { let alarmIndex = dst let alarmState = src let alarmText = params[2] === undefined ? '' : params[2].toString() - this.log('debug', `control ${ctrl} tag ${tag} param 1 ${params[0]} param 2 ${params[1]} address ${address}`) + //this.log('debug', `control ${ctrl} tag ${tag} param 1 ${params[0]} param 2 ${params[1]} address ${address}`) switch (ctrl) { case control.ackSet: switch (tag) { diff --git a/src/tcp.js b/src/tcp.js index 423c1b3..07c7919 100644 --- a/src/tcp.js +++ b/src/tcp.js @@ -69,9 +69,9 @@ module.exports = { this.socket.destroy() delete this.socket } - if (this.config.hostPri) { + if (this.config.hostPri && this.config.portPri) { this.log('debug', 'Creating New Socket') - if (this.useSecondary && this.config.hostSec) { + if (this.useSecondary && this.config.hostSec && this.config.portSec) { this.updateStatus('Connecting to Secondary') this.socket = new TCPHelper(this.config.hostSec, this.config.portSec) } else {