InfiniTimeOrg / InfiniTimeOrg/InfiniTime

Zero out HRM when stopped

Open
#682 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C
Stars
3.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I'm working on graph data persistence for HRM and Battery for https://github.com/xan-m/Infini-iOS and I noticed last night that if the HRM is stopped on InfiniTime (i.e. if it was running, but you press the stop button), it retains the last heart rate value and continues to report it over the BLE HRM characteristic as the "current" heart rate on every connection/reconnection.

In my case last night, I had the watch just barely out of range of my phone with my iOS app open with the HRM stopped on the watch, so it was disconnecting and reconnecting pretty frequently. Every time the watch and phone were able to establish a connection, the watch reported the HRM value that it had been stopped at, and it was saved to the graph. I ended up with close to 30 reports of the heart rate value that I had stopped the HRM at.

I've got a kludgy workaround in place in my app to keep these values from being reported, but it potentially sacrifices the occasional real data point to reduce saturation of false data points. If InfiniTime zeroed this value out instead, it would be much easier to filter out (hopefully nobody's heart rate is 0...)

I realize this is an edge case, but I don't see much utility in retaining the last heart rate value after stopping the HRM. If it is useful to others, perhaps a "pause" and a "stop" button could be implemented so that users have the option to retain or clear the value at their discretion.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace the InfiniTime HRM stop handling and the BLE HRM characteristic reporting path. Reproduce stopping the HRM followed by a reconnect, then verify that the stopped state reports zero rather than the last heart rate and no longer creates repeated stale readings.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.