27#if defined(HAS_MESSAGE_KEY_PHONE_REQUEST)
28#define SYSTEM_STORE_LISTENS_PHONE 1
30#define SYSTEM_STORE_LISTENS_PHONE 0
32#if defined(HAS_MESSAGE_KEY_MUSIC_REQUEST)
33#define SYSTEM_STORE_LISTENS_MUSIC 1
35#define SYSTEM_STORE_LISTENS_MUSIC 0
37#if defined(HAS_MESSAGE_KEY_WEATHER_REQUEST)
38#define SYSTEM_STORE_LISTENS_WEATHER 1
40#define SYSTEM_STORE_LISTENS_WEATHER 0
42#if defined(HAS_MESSAGE_KEY_STOCK_REQUEST)
43#define SYSTEM_STORE_LISTENS_STOCK 1
45#define SYSTEM_STORE_LISTENS_STOCK 0
47#if defined(HAS_MESSAGE_KEY_CALENDAR_REQUEST)
48#define SYSTEM_STORE_LISTENS_CALENDAR 1
50#define SYSTEM_STORE_LISTENS_CALENDAR 0
54#define SYSTEM_STORE_LINK_LISTENER_COUNT \
55 (SYSTEM_STORE_LISTENS_PHONE + SYSTEM_STORE_LISTENS_MUSIC + SYSTEM_STORE_LISTENS_WEATHER + \
56 SYSTEM_STORE_LISTENS_STOCK + SYSTEM_STORE_LISTENS_CALENDAR)
59#define SYSTEM_STORE_LINK_LISTENER_SLOTS (SYSTEM_STORE_LINK_LISTENER_COUNT + 1)
63#if SYSTEM_STORE_LINK_LISTENER_COUNT > 0
64#define SYSTEM_STORE_LINK_LISTENERS 1
121#if defined(SYSTEM_STORE_LINK_LISTENERS)
133void system_store_add_link_listener(
void (*listener)(
void));
143void system_store_remove_link_listener(
void (*listener)(
void));
int system_store_battery(void)
How full the battery is from 0 to 100.
Definition system_store.c:181
bool system_store_bluetooth(void)
True when the phone link is up.
Definition system_store.c:183
bool system_store_next_alarm(time_t *out)
When the wearer's next enabled alarm fires.
Definition system_store.c:185
void system_store_deinit(void)
Stop tracking the battery + connection services.
Definition system_store.c:175
bool system_store_charging(void)
True while the watch is plugged in.
Definition system_store.c:182
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:73
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:137
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:116
void system_store_subscribe(void(*cb)(void))
Hand it the function to call when something changes (the screen redraw).
Definition system_store.c:111
The rules a face hands the store.
Definition system_store.h:79
bool live
True subscribes the services and false just keeps the fake data for screenshots.
Definition system_store.h:80
BtVibePolicy vibe
Buzz policy for a bluetooth change, or NULL for silent.
Definition system_store.h:81
Optional prefill, or pinned state when live = false.
Definition system_store.h:88
int battery
Battery level from 0 to 100.
Definition system_store.h:89
bool charging
True when plugged in.
Definition system_store.h:90
bool bluetooth
True when the phone link is up.
Definition system_store.h:91
time_t next_alarm
When the next alarm fires, or 0 for none.
Definition system_store.h:92