piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 51 forks source link

Enable realtime HRM from Device Settings Page #306

Closed jmlich closed 2 months ago

jmlich commented 10 months ago

Right now I am not sure how to do this properly.

With https://github.com/piggz/harbour-amazfish/pull/303 the sampled data are stored the realtime data are stored into database, but the notification of heart rate monitor must be enabled explicitly https://github.com/piggz/harbour-amazfish/blob/dc0aa13db6dbb8d5ffa7a89c16f847032e431fa9/daemon/src/deviceinterface.cpp#L741

There is enableRealtimeHRMeasurement and enableManualHRMeasurement https://github.com/piggz/harbour-amazfish/blob/dc0aa13db6dbb8d5ffa7a89c16f847032e431fa9/daemon/src/services/hrmservice.cpp#L37

both methods subscribes for messages. They are sending also some sending messages upon to infinitime.

It can be probably some option in settings, which automatically subscribes to HRM upon connecting to device. In combination with lousy connection stability it doesn't measure very few data without that.

piggz commented 8 months ago

Enable realtimeMeasurement tells the watch to enable its on-board periodic measurement (must be supported) ... enableManualMeasurement tells the watch to "take a measurement now please"

For the pinetime, i think the only current options is periodic manual measurement, as there is no feature for having the watch log measurements automatically.

jmlich commented 7 months ago

Yes, the issue is, that without enableNotification() it doesn't receive any value. On the FirstPage, the btnHR (with icon: styler.iconRefresh) must be pressed to turn it on.

If I understand correctly the right method is enableRealtimeHRMeasurement which is currently used in combination with Laufhelden app (or other app connected via dbus daemon). I guess, I want to introduce some TextSwitchPL on DeviceSettings page and enable this automatically according to it.

jmlich commented 6 months ago

This should allow realtime HRM measurement (i.e. notifications in BT profile). As far as PineTime doesn't provide interface to download hrm logs, this should allow at least sampling of current values.

Dark side is that it is necessary to allow it in Settings. The user can be confused that data aren't actually there. On the other hand user can be surprised that it drains device battery (haven't measured that actually) and doesn't bring much changes (mostly for huami device).

Although I see the pull request as an improvement.