I'm trying to convert the speed sensor value into a readable format.
...
Below is the data bytes obtained from the wahoo speed sensor
Output obtained using ble programmatically: Bytes : [2,196,0,94,7]
Channels The above data byte1 seems like a wheel rev and I'm trying to decode the last wheel event time.
.....
The output obtained using nrfconnect app Image:
Crank rev:3 Last crank event time:37932ms
I found that byte1 represents the crank rev count value, it's difficult for me to find the Last crank event time from bytes output
If you look at GATT Specification Supplement 5 it describes how to intepret the bytes:
Looking at the data: [2, 4, 0, 94, 23]
the 2
is in the flag
position and represents Crank Revolution Data Present
.
The 4, 0
are Cumulative Crank Revolutions
. As the data is in little endian
the value is 4
.
The 94, 23
are Last Crank Event Time
which is this case is a timestamp at 5982
(5.84 seconds)