Active system store: the watch's own battery, bluetooth and next-alarm state. It subscribes to the battery and connection services itself and buzzes on a bluetooth change through a policy the face installs (so the store never has to know about settings or buzzing). More...
#include <pebble.h>Go to the source code of this file.
Data Structures | |
| struct | SystemConfig |
| The rules a face hands the store. More... | |
| struct | SystemSeed |
| Optional prefill, or pinned state when live = false. More... | |
Macros | |
| #define | SYSTEM_STORE_LISTENS_PHONE 0 |
| the face does not declare PHONE_REQUEST | |
| #define | SYSTEM_STORE_LISTENS_MUSIC 0 |
| the face does not declare MUSIC_REQUEST | |
| #define | SYSTEM_STORE_LISTENS_WEATHER 1 |
| the face declares WEATHER_REQUEST, so that store listens | |
| #define | SYSTEM_STORE_LISTENS_STOCK 0 |
| the face does not declare STOCK_REQUEST | |
| #define | SYSTEM_STORE_LISTENS_CALENDAR 0 |
| the face does not declare CALENDAR_REQUEST | |
| #define | SYSTEM_STORE_LINK_LISTENER_COUNT |
| How many stores this face has that listen for the link. | |
| #define | SYSTEM_STORE_LINK_LISTENER_SLOTS (SYSTEM_STORE_LINK_LISTENER_COUNT + 1) |
| How many slots the list holds, one for each store that listens and one spare for the face's own. | |
Typedefs | |
| typedef void(*) | BtVibePolicy(bool connected) |
| Called on a real bluetooth transition (a change, not the first reading), so the face can buzz however its own settings say. NULL for a silent link change. | |
Functions | |
| void | system_store_init (SystemConfig cfg, const SystemSeed *seed) |
| Start the store with its rules. Pass seed = NULL for normal use. | |
| void | system_store_deinit (void) |
| Stop tracking the battery + connection services. | |
| void | system_store_subscribe (void(*cb)(void)) |
| Hand it the function to call when something changes (the screen redraw). | |
| void | system_store_on_reconnect (void(*cb)(void)) |
| Hand it the function to call when the phone app link comes back after a drop. | |
| int | system_store_battery (void) |
| How full the battery is from 0 to 100. | |
| bool | system_store_charging (void) |
| True while the watch is plugged in. | |
| bool | system_store_bluetooth (void) |
| True when the phone link is up. | |
| bool | system_store_next_alarm (time_t *out) |
| When the wearer's next enabled alarm fires. | |
Active system store: the watch's own battery, bluetooth and next-alarm state. It subscribes to the battery and connection services itself and buzzes on a bluetooth change through a policy the face installs (so the store never has to know about settings or buzzing).
The alarm has no service to subscribe to, so it is read straight through on each call rather than mirrored here.
It holds the watch's one connection subscription. A Pebble app has a single connection handler, and a second subscribe replaces the first, so a store that needs to hear the link adds itself as a link listener here rather than subscribing on its own.