FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

4167 questions

4739 answers

3460 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
294 views
in Vehicle tracking by anonymous


Documentation states (image above), that Engine Coolant Temperature is sent in 1 byte, unsigned, value from -40 to 210.
One byte integer value is from 0 to 255 unsigned or from -127 to 128 signed. How to parse the value? Should we first assume that value is unsigned and then subtract 40? Because if we parse this as a simple signed 1 byte integer it can go out of bounds of a valid value.

1 Answer

–1 vote
by anonymous

Hello.

As I can see on attached screen it is signed value.

For example if you receive D8 Hex value as AVL 127, it would be -40 (Decimal from signed 2's complement)

You could use rapid tables for convering hex to dec from signed 2's complement:

https://www.rapidtables.com/convert/number/hex-to-decimal.html

Regards

by anonymous
I understand that, but if it's 1 byte size then the maximum value of this parameter should be 127, and it documentation it states that maximum value is 210. I am not sure if this is mistake in documentation or parameter needs to be parsed differently than usual.