node-red-contrib-knx-ultimate 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <br/>
6
6
  <p>
7
- <b>Version 1.3.7</b> - December 2021<br/>
7
+ <b>Version 1.3.8</b> - December 2021<br/>
8
8
  - FIX: fixed a stupid "Disconnected by Message length mismatch 8/16" error due to a dumb find/replace error in the code.<br/>
9
9
  - Added some more log to help resolving issues.<br/>
10
10
  </p>
@@ -698,6 +698,17 @@ class KNXClient extends EventEmitter {
698
698
  _processInboundMessage(msg, rinfo) {
699
699
 
700
700
  try {
701
+
702
+ // Composing debug string
703
+ var sProcessInboundLog = "???";
704
+ try {
705
+ sProcessInboundLog = "Data received: " + msg.toString("hex");
706
+ sProcessInboundLog += " srcAddress: " + JSON.stringify(rinfo);
707
+ } catch (error) { }
708
+ try {
709
+ if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.trace("Received KNX packet: _processInboundMessage, " + sProcessInboundLog + " ChannelID:" + this._channelID || "??" + " Host:" + this._options.ipAddr + ":" + this._options.ipPort);
710
+ } catch (error) { }
711
+
701
712
  const { knxHeader, knxMessage } = KNXProtocol.KNXProtocol.parseMessage(msg);
702
713
 
703
714
  if (knxHeader.service_type === KNXConstants.KNX_CONSTANTS.SEARCH_RESPONSE) {
@@ -899,6 +910,9 @@ class KNXClient extends EventEmitter {
899
910
  }
900
911
  }
901
912
  catch (e) {
913
+ try {
914
+ if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.error("Received KNX packet: Error processing inbound message: " + e.message + " " + sProcessInboundLog + " ChannelID:" + this._channelID + " Host:" + this._options.ipAddr + ":" + this._options.ipPort);
915
+ } catch (error) { }
902
916
  try {
903
917
  this.emit(KNXClientEvents.error, e);
904
918
  } catch (error) { }
@@ -33,7 +33,7 @@ class KNXHeader {
33
33
  offset += 2;
34
34
  const length = buffer.readUInt16BE(offset);
35
35
  if (length !== buffer.length) {
36
- throw new Error(`Message length mismatch ${length}/${buffer.length}`);
36
+ throw new Error(`Message length mismatch ${length}/${buffer.length} Data processed: ${buffer.toString("hex") || "??"}`);
37
37
  }
38
38
  return new KNXHeader(type, length - header_length);
39
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-knx-ultimate",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Control your KNX intallation via Node-Red! Single Node KNX IN/OUT with optional ETS group address importer. Easy to use and highly configurable.",
5
5
  "dependencies": {
6
6
  "fs": "0.0.1-security",