InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

Bluetooth interface to control heart rate measurement

Open apilat opened this issue 3 years ago • 1 comments
trafficstars

Adds a bluetooth characteristic (00050001-78fc-48fe-8e23-433b3a1942d0) to read the state of the heart rate sensor and turn it on/off. This will be useful for companion apps that want to take periodic heart rate measurements. It might be worth requiring that the watch is paired before being able to use this, but I'm not experienced enough with Bluetooth to do that.

I'm not sure what HeartRateController::States::NoTouch represents, but I've assumed the sensor is not running at this point.

apilat avatar Jul 01 '22 10:07 apilat

interesting , with which app did you have tested it @apilat ? i would like to test it since it would allow heart rate without the need to make it on all the time , if i understand right.

lman0 avatar Aug 14 '22 00:08 lman0

@lman0 I used the gather.py script in https://github.com/apilat/pinetime-sensor-data. Beware it's a work in progress and doesn't work perfectly yet

I've now fixed the bug where the heart rate would always be reported as 0 during sleep (even though the sensor was on and collecting data). HeartRateTask now has two distinct modes - one where it only collects data only when the watch is awake (used by the app) and another where is always collects data (used by the bluetooth interface).

apilat avatar Mar 17 '23 12:03 apilat