int health_store_active_min(void)
The active minutes so far today, or -1 if we have not got one yet.
Definition health_store.c:776
uint8_t * health_store_hr_history(void)
The last hour of heart rate readings, one per minute (a 60 slot buffer). The store fills it on each u...
Definition health_store.c:767
const uint16_t * health_store_step_hourly(void)
Today's steps split into per-hour buckets, one slot per hour from midnight (24 slots)....
Definition health_store.c:769
int health_store_steps(void)
The steps taken so far today, or -1 if we have not got one yet.
Definition health_store.c:773
void health_store_subscribe(void(*cb)(void))
Hand it the function to call when the numbers change (the screen redraw).
Definition health_store.c:654
int health_store_step_hours(void)
How many of the hourly step buckets hold a real value (0 to 24). Steps count 0 as a real reading (a q...
Definition health_store.c:770
int health_store_distance_m(void)
Today's walked distance in meters, or 0 if we cannot read it.
Definition health_store.c:777
int health_store_sleep_min(void)
The minutes of sleep, or -1 if we have not got one yet.
Definition health_store.c:775
int health_store_calories(void)
The active calories so far today, or -1 if we have not got one yet.
Definition health_store.c:774
void health_store_init(HealthConfig cfg, const HealthSeed *seed)
Start the store with its rules. Pass seed = NULL for normal use.
Definition health_store.c:659
int health_store_hr(void)
The heart rate in beats per minute, or -1 if we have not got one yet.
Definition health_store.c:772
The rules a face hands the store.
Definition health_store.h:21
bool live
True subscribes the health service and false just keeps the fake data for screenshots.
Definition health_store.h:22
uint32_t persist_key
Slot for the saved history so the face owns the key instead of the store.
Definition health_store.h:32
bool active
Read the active minutes total.
Definition health_store.h:29
bool step_history
Keep the hour by hour step buckets, for a face that graphs them.
Definition health_store.h:24
bool hr_history
Keep the rolling minute by minute heart rate window, for a face that graphs it.
Definition health_store.h:23
bool sleep
Read the sleep total.
Definition health_store.h:28
bool distance
Read the walked distance, including for a steps readout that can show it instead.
Definition health_store.h:31
bool calories
Read the active calories total.
Definition health_store.h:30
Optional prefill, or pinned readings when live = false.
Definition health_store.h:39
int hr
Heart rate in beats per minute.
Definition health_store.h:40
int steps
Steps so far today.
Definition health_store.h:41
const uint16_t * step_hourly
Optional 24 slot hour by hour step curve, or NULL.
Definition health_store.h:47
int sleep_min
Minutes of sleep.
Definition health_store.h:43
int active_min
Active minutes so far today.
Definition health_store.h:44
int calories
Active calories so far today.
Definition health_store.h:42
int distance_m
Walked distance in meters.
Definition health_store.h:45
int step_hours
How many of those hourly buckets are real (0 to 24).
Definition health_store.h:48
const uint8_t * hr_history
Optional 60 slot minute by minute heart rate curve (0 means no reading), or NULL.
Definition health_store.h:46