I am currently trying to parse the raw hex Data advertised by the Telemetry Package. I can get the raw data and write it to a file that is no problem.
I managed to parse everything except for the pressure Data which is encoded in byte 16 to 19. Maybe some one can help me to understand the example given by estimote:
%% ***** ATMOSPHERIC PRESSURE % added in protocol version "2" % bytes 16, 17, 18, 19 => atmospheric pressure RAW_VALUE % RAW_VALUE is an unsigned 32-bit integer, little-endian encoding, % i.e., least-significant byte comes first % e.g., if bytes are 16th = 0x12, 17th = 0x34, 18th = 0x56, 19th = 0x78 % then the value is 0x78563412 % RAW_VALUE / 256.0 = atmospheric pressure in pascals (Pa) % note that unlike what you see on the weather forecast, this value is % not normalized to the sea level!
For me it comes down to this:
16th = 0x12 = 0b00010010
17th = 0x34 = 0b00110100
18th = 0x56 = 0b01010110
19th = 0x78 = 0b01111000
So 0x78563412 should be:
0b 01111000 01010110 00110100 00010010 in binary which is
2018915346 in dec
But 2018915346/256 = 7886388,07 Pa which is 78,8638807 bar and that is way to much even if its not normalized to see level
I assume that my mistake lies somewhere with the little-endian encoding. Would be nice if you could help me out.