An optional part of the store, such as the heart rate graph. More...
#include <health_store.h>
Data Fields | |
| void(*) | start (const struct HealthConfig *cfg, const struct HealthSeed *seed) |
| void(*) | heart_rate (int hr, bool from_event) |
| void(*) | steps (int steps) |
| void(*) | poll (void) |
| uint32_t(*) | sum (void) |
An optional part of the store, such as the heart rate graph.
A face turns a part on by naming it in its HealthConfig, as HEALTH_HR_HISTORY, HEALTH_STEP_HISTORY, or HEALTH_HR_DAY. The store only calls a part through the pointer the face hands it, so a face that never names one leaves nothing pointing at its code or its data, and the linker drops the lot. A setting the store checked while running could not do that, since the linker cannot see which way it goes. The store skips any hook a part leaves NULL.
| void(*) HealthPart::heart_rate(int hr, bool from_event) |
The heart rate was read, -1 for none. from_event is true when a heart rate event brought it rather than a peek.
| void(*) HealthPart::poll(void) |
The face's cadence turn, on a live store only.
| void(*) HealthPart::start(const struct HealthConfig *cfg, const struct HealthSeed *seed) |
Empties the part, then takes its seed, or restores and queues its launch read for a live store.
| void(*) HealthPart::steps(int steps) |
The day's step count was read again, at most once a minute, -1 for none.
| uint32_t(*) HealthPart::sum(void) |
The part's state summed, so the store redraws the face only when it moved.