Hi All,
I've got no answer for this behavior of the buffer-parser:
I've got some bytes pushing through the buffer-parser. As long as I do all the settings within the buffer-parser node itselve, all is like expected. But as soon as I start using the specification it does not give me the exponent. It gives me zero and not -1 or -2 like expected. I built an example flow for demonstration:
[{"id":"77035d12c456286b","type":"tab","label":"Flow 7","disabled":false,"info":"","env":[]},{"id":"d04905d94adb39d0","type":"debug","z":"77035d12c456286b","name":"debug 318","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":160,"wires":[]},{"id":"08e9bee652ad3412","type":"inject","z":"77035d12c456286b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[65024,5008,65280,2283]","payloadType":"json","x":230,"y":160,"wires":[["84b9ee52e5cdcf3f","d64e7654502d18a2"]]},{"id":"84b9ee52e5cdcf3f","type":"function","z":"77035d12c456286b","name":"dynamically set spec","func":"msg.spec = {\n \"options\":\n {\n \"byteSwap\":false,\n \"resultType\": \"keyvalue\",\n \"setTopic\": true,\n \"multipleResult\": false\n },\n \"items\":[\n \n {\n \"name\": \"F\",\n \"type\": \"uint32be\",\n \"offset\": 0,\n \"mask\": 0x00FFFFF\n },\n {\n \"name\": \"F2\",\n \"type\": \"int8\",\n \"offset\": 0\n },\n {\n \"name\": \"Ua\",\n \"type\": \"uint32be\",\n \"offset\": 4,\n \"mask\": \"0x00fffff\"\n },\n {\n \"name\": \"Ua_exp\",\n \"type\": \"int8\",\n \"offset\": 4\n }\n ]\n}\n\nreturn msg;\n\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":120,"wires":[["01aa41b430f4a104"]]},{"id":"01aa41b430f4a104","type":"buffer-parser","z":"77035d12c456286b","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"msg","items":[{"type":"uint32be","name":"item1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"0x00fffff"},{"type":"int8","name":"item2","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":120,"wires":[["d04905d94adb39d0"]]},{"id":"d64e7654502d18a2","type":"buffer-parser","z":"77035d12c456286b","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"F","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"0x00fffff"},{"type":"int8","name":"F2","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint32be","name":"Ua","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":"0x00fffff"},{"type":"int8","name":"Ua_exp","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":610,"y":180,"wires":[["d04905d94adb39d0"]]}]
Can you see the difference between the settings inside the buffer-parser and the variation with specification?
Thank you very much!
BR
Chris