Steve-Mcl / node-red-contrib-buffer-parser

A node-red node to convert values in a buffer, integer array or hex string into many different data type(s). Supports Big/Little Endian, BCD, byte swapping and much more.
MIT License
26 stars 9 forks source link

Feature Request: support of signed integers #24

Open ramtorio opened 8 hours ago

ramtorio commented 8 hours ago

I recently came across the difference between signed and unsinged integers and twos complement. To be more specific, I suddenly got a Temperature reading several 10k degrees too hot because I apparently forgot that the data source supplies it's temperature reading as sint16, but silly me thought that it wouldn't matter and used the unit16 type... Which worked until the outside temperatures dropped below zero.

I'm currently trying to wrap my head around the concept to build an alternative, but it would of course be much simpler if the buffer parser could do this on its own.

Do you think it would be possible to add sint as supported data type?

Steve-Mcl commented 7 hours ago

The buffer parser already supports signed integers.

Perhaps if you provide a reproducible flow (using injects to simulate data) and include your expectations I might better understand.