Core Bluetooth Tutorial for iOS: Heart Rate Monitor

Hello,
I have a problem with central.state
After build and run appears the message ā€œcentral.state is .unsupportedā€.
I tried to reopen bluetooth but it didnā€™t work.
How I can solve it?

Thanks.

Hi @giorgio - Can you tell me more about at what point in the tutorial you are seeing this message? Also can you try to run the final project (link at the end of tutorial) and see if it works with that version?

Hi @kgaurav37 - Iā€™m not aware of a heart rate monitor that has a vibrating feature, so Iā€™m not sure if this is something that would be possible. If you know of a heart rate monitor that has this feature let me know of the model number and I can try to see if I can find that info.

First of all , thank you for provided great tutorial of core bluetooth
And , i have a few of questions like as below.
As i knew that , bluetooth moduleā€™s characteristic can send data by 157 per times.
And if i set timer as that receive all data from peripheral per 1/4 seconds , could i express about 600 data per seconds?
Iā€™m really wondering if it is available.
But as i tried to do this tutorial , i did confirm only 2 data per seconds with print method as bpm.

Is there any different things that i have to set for that ?

Thank you

Really appreciate it

Hi @jawwad,

I stumbled over an issue regarding the interpretation of the RR value, and therefore the UInt16 heart rate value as well.
In the tutorial code the first byte of the 2-byte value is multiplied by 256 but it should be the second byte that gets multiplied, as the transmitted values in the Bluetooth GATT context are little endian.

Tutorial Code:
// Heart Rate Value Format is in the 2nd and 3rd bytes
return (Int(byteArray[1]) << 8) + Int(byteArray[2])

Should be:
// Heart Rate Value Format is in the 2nd and 3rd bytes
return Int(byteArray[1]) + (Int(byteArray[2]) << 8)

Using the original conversion from the tutorial produced worrying RR intervals of ~32000ms, and I wondered if I should call for a doctor immediatelyā€¦ :wink: So I switched the byte order and got a more reasonable result within the 1000ms range.

And thanks for the nice tutorial!

@jawwad Can you please help with this when you get a chance? Thank you - much appreciated! :]

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you! :]