I am trying to read data transferred by heart rate monitors over bluetooth , but I really don't know how to read the bytes returned by the heart rate monitors.
It may be possible that each vendor has their own way of wrapping data into bytes. But how can I convert those bytes into some readable format, so that I can analyze the change in it?
Like ASCII values or some hexadecimal values.
I tried code of MyTrack application, but that didnt work for me.
MyTrack Parse Heart Rate Data
I am trying to read the bytes in Android, as of now I am getting these data but don't know which field represents what.
55 04 00 38 00 15 af
14 b0 00 38 00 13 b1
55 04 00 38 00 13 b1
55 04 00 38 00 12 b2
Hopefully, your heart rate monitor follows the data specification defined here:
Heart Rate Measurement at Bluetooth.org
As far as I can tell, here's how to apply the info in that document:
In my case, with a Wahoo Blue HR, data is coming back like this:
14 46 59 03 58 03
Converting 14 to binary (00010100) and looking at bit 0 (0) tells me that the heart rate is 8-bit, so I just need the second hex byte (46). Converting that to decimal gives me 70.
Unfortunately, I don't know how to interpret your second sample. The first hex byte, 14, indicates an 8-bit value, but that would make the heart rate value B0, or 176 -- not a likely value for someone sitting at their computer. I also wouldn't expect a single device to switch between transmitting 8-bit and 16-bit values, but I guess it's possible.
This SO question includes code for doing these conversions, and it's working for me. I just wanted to try and understand the documentation before implementing it.
Unless you can find some documentation for the heart rate monitor transfer specs, you are going to need to analyze the data and decipher the format. One way to do this is to create controlled variations in the data being sent from the heart rate monitor (such as swapping between a person at rest and a person who is jogging), and then look for the differences and patterns in the data.
At the minimum, I would expect the data to consist of time and heart rate values, but there most certainly will be other fields as well such as a header, packet identifier and length, and checksum values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With