InfiniTime
InfiniTime copied to clipboard
Bluetooth interface to control heart rate measurement
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.
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 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).