Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable realtime HRM from Device Settings Page #306

Merged
merged 6 commits into from
Jun 6, 2024
Merged

Conversation

jmlich
Copy link
Contributor

@jmlich jmlich commented Oct 29, 2023

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

With #303 the sampled data are stored the realtime data are stored into database, but the notification of heart rate monitor must be enabled explicitly

hrmService()->enableManualHRMeasurement(true);

There is enableRealtimeHRMeasurement and enableManualHRMeasurement

enableNotification(UUID_CHARACTERISTIC_HRM_MEASUREMENT);

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
Copy link
Owner

piggz commented Dec 21, 2023

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
Copy link
Contributor Author

jmlich commented Jan 14, 2024

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 jmlich changed the title WIP: automatically enable hrm Enable realtime HRM Mar 1, 2024
@jmlich
Copy link
Contributor Author

jmlich commented Mar 1, 2024

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.

@jmlich jmlich changed the title Enable realtime HRM Enable realtime HRM from Device Settings Page May 7, 2024
@@ -121,6 +130,7 @@ PagePL {
DaemonInterfaceInstance.applyDeviceSetting(Amazfish.SETTING_DEVICE_TIME);
DaemonInterfaceInstance.applyDeviceSetting(Amazfish.SETTING_DEVICE_UNIT);
DaemonInterfaceInstance.applyDeviceSetting(Amazfish.SETTING_DISCONNECT_NOTIFICATION);
DaemonInterfaceInstance.applyDeviceSetting(SETTING_DEVICE_REALTIME_HRM_MEASUREMENT);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax here is different

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@piggz piggz merged commit 7aaddd6 into piggz:master Jun 6, 2024
3 checks passed
@jmlich jmlich deleted the hrm-enable branch June 9, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants