WebBluetoothCG / demos

Demo applications showing off Web Bluetooth
https://webbluetoothcg.github.io/demos/
Apache License 2.0
624 stars 188 forks source link

fix sensor location issue #80

Closed danielmihalcea closed 3 years ago

danielmihalcea commented 3 years ago

fix issue when the heart rate monitor doesn't provide sensor location as on my Polar Sense

danielmihalcea commented 3 years ago

When I try your script with my Polar Sense heart rate sensor I get the following error : " NotFoundError: No Characteristics matching UUID 00002a38-0000-1000-8000-00805f9b34fb found in Service with UUID 0000180d-0000-1000-8000-00805f9b34fb. " and hence I get no heart rate at all.

I noticed by checking the source code carefully that the body sensor location isn't used anywhere, so the simplest is to not query it. With that little change the script works perfectly with all my heart rate devices.

scheib commented 3 years ago

Thank you. I agree with removing body sensor location from the sample. Please remove all code referencing it instead of just commenting it out. Remove the commented out line, and delete the getBodySensorLocation function.

danielmihalcea commented 3 years ago

I've removed all code referencing body sensor location

beaufortfrancois commented 3 years ago

I've removed unnecessary Promise.all in https://github.com/WebBluetoothCG/demos/pull/80/commits/87e83d2768efe06fa183bcd41ffc921e2bca63e9. Let me know if that works for you as well.

danielmihalcea commented 3 years ago

Yes @beaufortfrancois that's cleaner. I've tried it and it works for me as well.