Go Down

Topic: Need support on bluetooth protocol question related to the speed unit (km/h) (Read 794 times) previous topic - next topic

gledev

Hi,

I'm working on transmitting treadmill data from a Genuino 101.

I got my info on treadmill service and characteristics here
https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.treadmill_data.xml

It states (instanious) speed to be passed as a 2bytes with a decimal exponent of -2.

I'm passing both speed and a heartrate as follows :

    const unsigned char CharArray[5] = {1, 1 , 1 , 0, 80};
    FIT_Char.setValue(CharArray, 5);

The first 1 is indicating speed will follow after the flags (2 bytes)
The second 1 is the second byte of the flag indicating a heartrate to follow (the 80 at the end)
The third 1 is speed and the fourth byte is the MSbyte of the 2byte speed.

The software on laptop detects and connects nicely but speed is shown as 100km/h, so seems to apply an exponent of 2 instead of -2. I can't imagine the software is the problem because it correctly supports plenty of commercial treadmills. So I'm wondering, should I somewhere pass the exponent information, in another characteristic ? Hope someone here has some experience with this, thanks.

Go Up