knxultimate
Advanced tools
Comparing version 1.0.23 to 1.0.24
@@ -10,2 +10,6 @@ ![Sample Node](img/logo.png) | ||
<p> | ||
<b>Version 1.0.24</b> - August 2022<br/> | ||
- Fixed old "new Buffer" syntax, due to future unsupported call.<br/> | ||
</p> | ||
<p> | ||
<b>Version 1.0.23</b> - Juli 2022<br/> | ||
@@ -12,0 +16,0 @@ -NEW: Added datapoint 1.024 for Day/Night<br/> |
{ | ||
"name": "knxultimate", | ||
"description": "KNX IP protocol implementation for Node. This is the ENGINE of Node-Red KNX-Ultimate node.", | ||
"version": "1.0.23", | ||
"version": "1.0.24", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": ">=14" |
@@ -12,6 +12,6 @@ /** | ||
// numeric values (in native and string form) are truthy if NOT zero | ||
return new Buffer.from([Boolean(f) ? 1 : 0]); | ||
return Buffer.from([Boolean(f) ? 1 : 0]); | ||
} else { | ||
// non-numeric value truthiness is Boolean true or the string 'true'. | ||
return new Buffer.from([(value == true || value == 'true') ? 1 : 0]); | ||
return Buffer.from([(value == true || value == 'true') ? 1 : 0]); | ||
} | ||
@@ -18,0 +18,0 @@ } |
@@ -18,3 +18,3 @@ /** | ||
exports.formatAPDU = function (value) { | ||
var apdu_data = new Buffer.alloc(3); | ||
var apdu_data = Buffer.alloc(3); | ||
var dow, hour, minute, second; | ||
@@ -21,0 +21,0 @@ // day of week. NOTE: JS Sunday = 0 |
@@ -15,3 +15,3 @@ /** | ||
else { | ||
var apdu_data = new Buffer.alloc(3); | ||
var apdu_data = Buffer.alloc(3); | ||
@@ -18,0 +18,0 @@ switch (typeof value) { |
@@ -16,3 +16,3 @@ /** | ||
knxLog.get().error('DPT12: Must supply a number value'); | ||
var apdu_data = new Buffer.alloc(4); | ||
var apdu_data = Buffer.alloc(4); | ||
apdu_data.writeUIntBE(value, 0, 4); | ||
@@ -19,0 +19,0 @@ return apdu_data; |
@@ -22,3 +22,3 @@ /** | ||
var apdu_data = new Buffer.alloc(4); | ||
var apdu_data = Buffer.alloc(4); | ||
apdu_data.writeFloatBE(value, 0); | ||
@@ -25,0 +25,0 @@ return apdu_data; |
@@ -24,3 +24,3 @@ /** | ||
var buf = new Buffer.alloc(14); | ||
var buf = Buffer.alloc(14); | ||
if (this.subtypeid === "001") buf.write(value, 'latin1'); | ||
@@ -27,0 +27,0 @@ if (this.subtypeid === "000") buf.write(value, 'ascii'); |
@@ -30,3 +30,3 @@ /** | ||
else { | ||
var apdu_data = new Buffer.alloc(1); | ||
var apdu_data = Buffer.alloc(1); | ||
if (typeof value == 'object' && | ||
@@ -33,0 +33,0 @@ value.hasOwnProperty("save_recall") && |
@@ -21,3 +21,3 @@ /** | ||
var day = (value.getDay() === 0) ? 7 : value.getDay(); | ||
var apdu_data = new Buffer.alloc(8); | ||
var apdu_data = Buffer.alloc(8); | ||
apdu_data[0] = value.getFullYear() - 1900; | ||
@@ -24,0 +24,0 @@ apdu_data[1] = value.getMonth() + 1; |
@@ -22,3 +22,3 @@ /** | ||
} | ||
return new Buffer.from([apdu_data]); | ||
return Buffer.from([apdu_data]); | ||
} | ||
@@ -25,0 +25,0 @@ } |
@@ -13,3 +13,3 @@ /** | ||
exports.formatAPDU = function (value) { | ||
var apdu_data = new Buffer.alloc(1); | ||
var apdu_data = Buffer.alloc(1); | ||
apdu_data[0] = value; | ||
@@ -16,0 +16,0 @@ knxLog.get().debug('./knx/src/dpt20.js : input value = ' + value + ' apdu_data = ' + apdu_data); |
@@ -72,3 +72,3 @@ /** | ||
exports.formatAPDU = function (value) { | ||
var apdu_data = new Buffer.alloc(8); // 4 x 2 bytes | ||
var apdu_data = Buffer.alloc(8); // 4 x 2 bytes | ||
@@ -75,0 +75,0 @@ if (typeof value == 'object' && |
@@ -22,3 +22,3 @@ /** | ||
// Send to BUS | ||
var apdu_data = new Buffer.alloc(2); | ||
var apdu_data = Buffer.alloc(2); | ||
if (!value) { | ||
@@ -25,0 +25,0 @@ knxLog.get().error("DPT232: cannot write null value"); |
@@ -84,3 +84,3 @@ /** | ||
exports.formatAPDU = function (value) { | ||
var apdu_data = new Buffer.alloc(6); // 3 x 2 bytes | ||
var apdu_data = Buffer.alloc(6); // 3 x 2 bytes | ||
@@ -87,0 +87,0 @@ if (typeof value == 'object' && |
@@ -24,3 +24,3 @@ /** | ||
} | ||
return new Buffer.from([ | ||
return Buffer.from([ | ||
Math.floor(value.red), | ||
@@ -27,0 +27,0 @@ Math.floor(value.green), |
@@ -38,3 +38,3 @@ /** | ||
var bufferTotal = new Buffer.alloc(2) | ||
var bufferTotal = Buffer.alloc(2) | ||
bufferTotal[0] = parseInt(MSB, 2); | ||
@@ -41,0 +41,0 @@ bufferTotal[1] = parseInt(LSB, 2); |
@@ -13,3 +13,3 @@ /** | ||
exports.formatAPDU = function(value) { | ||
var apdu_data = new Buffer.alloc(1); | ||
var apdu_data = Buffer.alloc(1); | ||
apdu_data[0] = value; | ||
@@ -16,0 +16,0 @@ knxLog.get().trace('dpt238.js : input value = ' + value + ' apdu_data = ' + apdu_data); |
@@ -37,3 +37,3 @@ /** | ||
return new Buffer.from([ | ||
return Buffer.from([ | ||
Math.floor(value.red), | ||
@@ -40,0 +40,0 @@ Math.floor(value.green), |
@@ -14,3 +14,3 @@ /** | ||
else { | ||
var apdu_data = new Buffer.alloc(1); | ||
var apdu_data = Buffer.alloc(1); | ||
if (typeof value == 'object' && | ||
@@ -17,0 +17,0 @@ value.hasOwnProperty('decr_incr') && |
@@ -18,3 +18,3 @@ /** | ||
if (apdu_data > 255) knxLog.get().warn("DPT4: must supply an ASCII character"); | ||
return new Buffer.from([apdu_data]); | ||
return Buffer.from([apdu_data]); | ||
} | ||
@@ -21,0 +21,0 @@ else knxLog.get().warn("DPT4: Must supply a character or string"); |
@@ -15,3 +15,3 @@ /** | ||
exports.formatAPDU = function (value) { | ||
var apdu_data = new Buffer.alloc(2); | ||
var apdu_data = Buffer.alloc(2); | ||
if (!isFinite(value)) { | ||
@@ -18,0 +18,0 @@ knxLog.get().warn("DPT7: cannot write non-numeric or undefined value"); |
@@ -37,3 +37,3 @@ /** | ||
exports.formatAPDU = function (value) { | ||
var apdu_data = new Buffer.alloc(2); | ||
var apdu_data = Buffer.alloc(2); | ||
if (!isFinite(value)) { | ||
@@ -40,0 +40,0 @@ knxLog.get().warn("DPT9: cannot write non-numeric or undefined value"); |
@@ -25,3 +25,3 @@ /** | ||
value = value.toUpperCase().replace(/\$/g, "").replace(/0X/g, "").replace(/ /g, ""); // Remove the $ and 0x | ||
var apdu_data = new Buffer.alloc(10); | ||
var apdu_data = Buffer.alloc(10); | ||
var i = 0; | ||
@@ -28,0 +28,0 @@ var iSlice = 2; |
@@ -58,3 +58,3 @@ /** | ||
//apdu.data = new Buffer(nbytes); // 14/09/2020 Supregiovane: Deprecated. Replaced with below. | ||
apdu.data = new Buffer.alloc(nbytes); | ||
apdu.data = Buffer.alloc(nbytes); | ||
apdu.bitlength = dpt.basetype && dpt.basetype.bitlength || 1; | ||
@@ -61,0 +61,0 @@ var tgtvalue = value; |
969099