node-red-contrib-buffer-parser
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -30,3 +30,3 @@ | ||
"bcd", "bcdle", "bcdbe", | ||
"string", "ascii", "utf8", "utf16le", "ucs2", "latin1", "binary" | ||
"string", "ascii", "utf8", "utf16le", "ucs2", "latin1", "binary", "buffer" | ||
]; | ||
@@ -231,3 +231,4 @@ function bufferParserNode(config) { | ||
var buf; | ||
/** @type Buffer */ var buf; | ||
let isArray = Array.isArray(data); | ||
@@ -626,2 +627,9 @@ let isBuffer = Buffer.isBuffer(data); | ||
break; | ||
case "buffer": | ||
item.value = buf.slice(offset,offset+length); | ||
result.objectResults[item.name] = item; | ||
result.keyvalues[item.name] = item.value; | ||
result.arrayResults.push(item); | ||
result.values.push(item.value); | ||
break; | ||
default: | ||
@@ -628,0 +636,0 @@ let errmsg = `type '${item.type}' is not a recognised parse specification`; |
{ | ||
"name": "node-red-contrib-buffer-parser", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "A dynamic node to convert values in a buffer or integer array into the many different data type(s). Supports Big/Little Endian, BCD, byte swapping and much more", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -28,3 +28,3 @@ node-red-contrib-buffer-parser | ||
* bcd, bcdle, bcdbe, | ||
* string, ascii, utf8, utf16le, ucs2, latin1, binary | ||
* string, ascii, utf8, utf16le, ucs2, latin1, binary, buffer | ||
* Specification is either configured by the built in UI or can be set by a msg/flow/global property - permitting fully dynamic setup (e.g. via a dashboard) | ||
@@ -31,0 +31,0 @@ * The specification format permits random access (e.g. no need for any skips when accessing only first and last elements) |
Sorry, the diff of this file is not supported yet
421140
744