Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-sia-ultimate

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-sia-ultimate - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

4

CHANGELOG.md

@@ -11,2 +11,6 @@ # node-red-contrib-sia-ultimate

<p>
<b>Version 1.0.6</b> - January 2022<br/>
- FIX: fixed an issue preventing the TCP server to start.<br/>
</p>
<p>
<b>Version 1.0.5</b> - December 2021<br/>

@@ -13,0 +17,0 @@ - FIX: fix a possible crash if you have more than 1 server node with the same port.<br/>

@@ -401,6 +401,57 @@

try {
servertcp = net.createServer(onClientConnectedTCP(servertcp));
servertcp = net.createServer(function (sock) {
let ack = null;
// RED.log.info('siaendpointConfig: New client connected: ' + remoteAddress);
var remoteAddress = sock.address().address + ':' + sock.address().port;
sock.on('data', (data) => {
// data = Buffer.from(data,'binary');
// data = new Buffer(data);
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);
if (sia) {
ack = ackSIA(sia);
if (ack) {
// set states only if ACK okay
setStatesSIA(sia);
node.nodeClients.forEach(oClient => {
oClient.sendPayload({ connection: "TCP", decoded: sia });
})
node.errorDescription = ""; // Reset the error
startHeartBeat();
} else {
let crcformat = getcrcFormat(data);
ack = nackSIA(crcformat);
}
} else {
let crcformat = getcrcFormat(data);
ack = nackSIA(crcformat);
}
try {
//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 VIA TCP to ' + remoteAddress + ' following message: ' + ack.toString().trim() + " Error:" + e.message);
} catch (error) { }
}
});
sock.on('close', () => {
RED.log.info('siaendpointConfig: TCP connection from ' + remoteAddress + ' closed');
});
sock.on('error', (err) => {
RED.log.error('siaendpointConfig: TCP Connection ' + remoteAddress + ' error: ' + err.message);
});
});
servertcp.listen(node.port, () => {
try {
let text = 'siaendpointConfig: SIA Server listening on IP-Adress (TCP): ' + servertcp.address().address || "" + ':' + servertcp.address().port;
let text = 'siaendpointConfig: SIA Server listening on IP-Adress (TCP): ' + servertcp.address().address + ':' + servertcp.address().port;
RED.log.info(text);

@@ -619,6 +670,6 @@ } catch (error) {

// delete sock._readableState.decoder;
let remoteAddress = sock.remoteAddress + ':' + sock.remotePort;
let ack = null;
// RED.log.info('siaendpointConfig: New client connected: ' + remoteAddress);
sock.on('data', (data) => {
var remoteAddress = sock.address().address + ':' + sock.address().port;
// data = Buffer.from(data,'binary');

@@ -836,8 +887,11 @@ // data = new Buffer(data);

serverStartTCP();
} catch (error) {
node.setAllClientsStatus({ fill: "red", shape: "dot", text: "Error instantiating server TCP " + error.message });
}
try {
serverStartUDP();
} catch (error) {
node.setAllClientsStatus({ fill: "red", shape: "dot", text: "Error instantiating server " + error.message });
return;
node.setAllClientsStatus({ fill: "red", shape: "dot", text: "Error instantiating server UDP " + error.message });
}
startHeartBeat();

@@ -844,0 +898,0 @@

2

package.json
{
"name": "node-red-contrib-sia-ultimate",
"version": "1.0.5",
"version": "1.0.6",
"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)",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc