Loading...
Searching...
No Matches
system_store.h
Go to the documentation of this file.
1
12#pragma once
13#include <pebble.h>
14
19
26typedef void (*BtVibePolicy)(bool connected);
27
31typedef struct
32{
33 bool live;
36
40typedef struct
41{
42 int battery;
43 bool charging;
44 bool bluetooth;
45 time_t next_alarm;
47
54void system_store_init(SystemConfig cfg, const SystemSeed *seed);
55
57void system_store_deinit(void);
58
60void system_store_subscribe(void (*cb)(void));
61
63void system_store_on_reconnect(void (*cb)(void));
64
66int system_store_battery(void);
67
69bool system_store_charging(void);
70
72bool system_store_bluetooth(void);
73
83bool system_store_next_alarm(time_t *out);
84
int system_store_battery(void)
How full the battery is from 0 to 100.
Definition system_store.c:142
bool system_store_bluetooth(void)
True when the phone link is up.
Definition system_store.c:144
bool system_store_next_alarm(time_t *out)
When the wearer's next enabled alarm fires.
Definition system_store.c:146
void system_store_deinit(void)
Stop tracking the battery + connection services.
Definition system_store.c:136
bool system_store_charging(void)
True while the watch is plugged in.
Definition system_store.c:143
void(*) BtVibePolicy(bool connected)
Called on a real bluetooth transition (a change, not the first reading), so the face can buzz however...
Definition system_store.h:26
void system_store_init(SystemConfig cfg, const SystemSeed *seed)
Start the store with its rules. Pass seed = NULL for normal use.
Definition system_store.c:103
void system_store_on_reconnect(void(*cb)(void))
Hand it the function to call when the phone app link comes back after a drop.
Definition system_store.c:98
void system_store_subscribe(void(*cb)(void))
Hand it the function to call when something changes (the screen redraw).
Definition system_store.c:93
The rules a face hands the store.
Definition system_store.h:32
bool live
True subscribes the services and false just keeps the fake data for screenshots.
Definition system_store.h:33
BtVibePolicy vibe
Buzz policy for a bluetooth change, or NULL for silent.
Definition system_store.h:34
Optional prefill, or pinned state when live = false.
Definition system_store.h:41
int battery
Battery level from 0 to 100.
Definition system_store.h:42
bool charging
True when plugged in.
Definition system_store.h:43
bool bluetooth
True when the phone link is up.
Definition system_store.h:44
time_t next_alarm
When the next alarm fires, or 0 for none.
Definition system_store.h:45