How to interpret hex values from the sensor?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support。We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
mfn
Offline
Last seen:4 years 6 days ago
加入:2017-04-18 21:29
How to interpret hex values from the sensor?

I am trying to read some sensor data from the DA14583 I just got. For that, I am using a Raspberry Pi 3 Model B which will establish a connection with the sensor.

Using gatttool on the Pi, I was able to connect to the device via bluetooth and I got some values from the temparature sensor (where 0x20 is the handler address of the respective sensor):

> handle: 0x0020, char properties: 0x10, char value handle: 0x0021, uuid: [omitted here]
$ char-read-hnd 0x20
> 10 21 00 06 24 40 3f 18 26 97 b0 bb 44 44 7d 70 89 a7 2e

The problem is, I don't know how to get a human readable temperature value from this.

Over at IBM's I found somecode snippet to convert hex into °C and °F。这是Python,但它可以很容易地converted to, for instance, JavaScript.

But that's for a different sensor and it only takes 4 hex blocks. I've tried it with any sequence from the above 19 hex blocks, but none gave me a reasonable value.

So, does anyone know how to convert these 19 hex blocks into a temparature between 20°C and 25°C (which it assumingly represents)? I'd be really grateful!

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi mfn,

Hi mfn,

You will have to convert from hexadecimal values to decimal values or ascii depending on what you send from your device. You will have to be aware what the device sends (in what format, how many values etc) in order to be able to properly interpret that.

Thanks MT_dialog