The active stock store: holds the quotes, owns the appmessage stock channel, and asks the phone for more whenever its turn on the face's cadence finds a poll due.
More...
|
|
static void | reset_state (void) |
| | Clear the watchlist back to empty.
|
|
static void | persist_save (void) |
| | Stash the whole state so a relaunch can restore it. Only a live face writes.
|
| static void | apply_seed (const StockSeed *seed) |
| | Prefill the store from a seed, for dev builds and screenshots.
|
| static void | on_stock_strip (const uint8_t *buf, uint16_t len) |
| | Stock channel. Takes the watchlist the reader unpacked and puts it away.
|
|
static void | cadence_poll (void) |
| | The store's turn on the face's cadence: poll when the deadline has come round.
|
|
void | stock_store_subscribe (void(*cb)(void)) |
| | Hand it the function to call when a quote changes (the screen redraw).
|
| void | stock_store_init (StockConfig cfg, const StockSeed *seed) |
| | Start the store with its rules. Pass seed = NULL for normal use.
|
| void | stock_store_reconfigure (StockConfig cfg) |
| | Re-apply the rules (e.g. the poll interval changed). Moves the next poll to the new interval, and switching the store off here stops it asking the phone. Only init decides whether the store is live, so one init started with live = false stays on its seed whatever cfg says, and one never started ignores the call.
|
|
const StockStrip * | stock_store_strip (void) |
| | The whole watchlist strip. count is 0 until a reading lands.
|
| const StockSlot * | stock_store_slot (uint8_t index) |
| | One slot by index, or NULL when the index is past what is filled.
|
|
int | stock_store_age_s (void) |
| | How many seconds since the last reading turned up, or -1 if we have none.
|
The active stock store: holds the quotes, owns the appmessage stock channel, and asks the phone for more whenever its turn on the face's cadence finds a poll due.