The heart rate variability half of the health store. It asks the watch for beat gaps now and then, holds the sensor on while a burst is measured, and keeps the latest reading. More...
Go to the source code of this file.
Data Structures | |
| struct | HealthHrvConfig |
| The HRV rules the health store passes on from its own config. More... | |
Functions | |
| void | health_hrv_start (const HealthHrvConfig *cfg, int seed_ms, const HrvLog *seed_log, void(*changed)(void)) |
| Starts HRV with the health store's rules, or starts it again with new ones. | |
| void | health_hrv_set_period (uint16_t period_sec) |
| Changes how often the watch takes a burst. A period of 0 stops the sampling and puts the reading back to none on a live store, and a seeded store keeps its seed. | |
| void | health_hrv_set_rules (uint16_t still_mg, uint16_t walk_steps, uint16_t settle_gaps, HrvCount count, bool keep_all, bool live_redraw) |
| Changes the rules for which bursts count and how they are measured, such as when the wearer changes a setting or places a panel. | |
| void | health_hrv_on_gap (void) |
| Reads one beat gap from the watch. The health store calls it for each HRV event. | |
| void | health_hrv_poll (void) |
| The HRV turn on the face's cadence, which the health store passes on while it is live. | |
| void | health_hrv_stop (void) |
| Stops the sampling, since the watch keeps an app's request going for an hour after it closes. | |
| int | health_hrv_ms (void) |
| The latest reading as RMSSD in ms, or -1 if there is none or it went stale. | |
| bool | health_hrv_sampling (void) |
| Whether the watch took the last request for beat gaps. | |
| bool | health_hrv_measuring (void) |
| Whether a burst is being measured right now, with the sensor held on. | |
| const HrvLog * | health_hrv_log (void) |
| The readings kept for the face's panels. Never NULL. | |
| bool | health_hrv_recent (int back, HrvBurst *out) |
| One of the latest bursts, dropped ones included, newest first. | |
| bool | health_hrv_live (int *score, int *steps, int *held_sec) |
| The burst being held right now. | |
| uint16_t | health_hrv_still_mg (void) |
| The still limit in use, in milli-g a sample. | |
| uint16_t | health_hrv_walk_steps (void) |
| The steps through a burst that make it a walk. | |
| uint16_t | health_hrv_settle_gaps (void) |
| The gaps left out at the start of each burst. | |
The heart rate variability half of the health store. It asks the watch for beat gaps now and then, holds the sensor on while a burst is measured, and keeps the latest reading.
Only the health store calls these. A face turns HRV on with HEALTH_HRV in its appinfo's defines and the HRV fields of HealthConfig, and reads it back through the health store.