node-red-contrib-sia-ultimate
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -11,2 +11,6 @@ # node-red-contrib-sia-ultimate | ||
<p> | ||
<b>Version 1.0.2</b> - December 2021<br/> | ||
- FIX: fixed an issue with Ajax Hub 2. In some circumstances, the ACK wasn't read by Ajax due to the too speedy disconnection after senind the ACK telegram.<br/> | ||
</p> | ||
<p> | ||
<b>Version 1.0.1</b> - December 2021<br/> | ||
@@ -13,0 +17,0 @@ - Added some try..catch.<br/> |
@@ -397,3 +397,3 @@ | ||
/** | ||
* start socket server for listining for SIA | ||
* start socket server for listening for SIA | ||
*/ | ||
@@ -602,4 +602,4 @@ function serverStartTCP() { | ||
// data = new Buffer(data); | ||
RED.log.debug('siaendpointConfig: received from ' + remoteAddress + ' following data: ' + JSON.stringify(data)); | ||
RED.log.debug('siaendpointConfig: received from ' + remoteAddress + ' following message: ' + data.toString().trim()); | ||
RED.log.debug('siaendpointConfig: TCP received from ' + remoteAddress + ' following data: ' + JSON.stringify(data)); | ||
RED.log.debug('siaendpointConfig: TCP received from ' + remoteAddress + ' following message: ' + data.toString().trim()); | ||
let sia = parseSIA(data); | ||
@@ -625,8 +625,13 @@ if (sia) { | ||
try { | ||
sock.end(ack); | ||
RED.log.info('siaendpointConfig: sending ACK to ' + remoteAddress + ' following message: ' + ack.toString().trim()); | ||
//sock.end(ack); | ||
// 23/12/2021 Fix for issue https://github.com/Supergiovane/node-red-contrib-sia-ultimate/issues/2 | ||
sock.write(ack); | ||
setTimeout(() => { | ||
sock.end(); | ||
}, 700); | ||
RED.log.info('siaendpointConfig: sending ACK VIA TCP to ' + remoteAddress + ' following message: ' + ack.toString().trim()); | ||
} catch (e) { | ||
// Error Message | ||
try { | ||
RED.log.error('siaendpointConfig: sending ACK to ' + remoteAddress + ' following message: ' + ack.toString().trim() + " Error:" + e.message); | ||
RED.log.error('siaendpointConfig: sending ACK VIA TCP to ' + remoteAddress + ' following message: ' + ack.toString().trim() + " Error:" + e.message); | ||
} catch (error) { } | ||
@@ -637,6 +642,6 @@ | ||
sock.on('close', () => { | ||
RED.log.info('siaendpointConfig: connection from ' + remoteAddress + ' closed'); | ||
RED.log.info('siaendpointConfig: TCP connection from ' + remoteAddress + ' closed'); | ||
}); | ||
sock.on('error', (err) => { | ||
RED.log.error('siaendpointConfig: Connection ' + remoteAddress + ' error: ' + err.message); | ||
RED.log.error('siaendpointConfig: TCP Connection ' + remoteAddress + ' error: ' + err.message); | ||
}); | ||
@@ -649,3 +654,4 @@ } | ||
*/ | ||
function onClientConnectedUDP(sock) { | ||
function | ||
onClientConnectedUDP(sock) { | ||
// See https://nodejs.org/api/stream.html#stream_readable_setencoding_encoding | ||
@@ -660,4 +666,4 @@ // sock.setEncoding(null); | ||
// data = new Buffer(data); | ||
RED.log.debug('siaendpointConfig: received from ' + remote.address + ' following data: ' + JSON.stringify(data)); | ||
RED.log.info('siaendpointConfig: received from ' + remote.address + ' following message: ' + data.toString().trim()); | ||
RED.log.debug('siaendpointConfig: UDP received from ' + remote.address + ' following data: ' + JSON.stringify(data)); | ||
RED.log.info('siaendpointConfig: UDP received from ' + remote.address + ' following message: ' + data.toString().trim()); | ||
let sia = parseSIA(data); | ||
@@ -684,3 +690,3 @@ if (sia) { | ||
try { | ||
RED.log.info('siaendpointConfig: sending to ' + remote.address + ' following message: ' + ack.toString().trim()); | ||
RED.log.info('siaendpointConfig: sending ACK via UDP to ' + remote.address + ' following message: ' + ack.toString().trim()); | ||
sock.send(ack, 0, ack.length, remote.port, remote.address, (err, bytes) => { | ||
@@ -690,3 +696,3 @@ }); | ||
// Error Message | ||
RED.log.error('siaendpointConfig: Error'); | ||
RED.log.error('siaendpointConfig: UDP Error sending ACK ' + e.message); | ||
} | ||
@@ -693,0 +699,0 @@ }); |
{ | ||
"name": "node-red-contrib-sia-ultimate", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Connect your SIA-DCS compatible alarm system to node-red. It works with Ajax System too.", | ||
@@ -5,0 +5,0 @@ "author": "Supergiovane (https://github.com/Supergiovane)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117846
940