Loading...
Searching...
No Matches
store_fetch.h File Reference

The fetch timing the polling stores share: the one-shot catch-up, the cadence turn, and what an init or a reconfigure does to them. More...

#include <pebble.h>
#include "io/stores/store_poll.h"

Go to the source code of this file.

Data Structures

struct  StoreFetch
 One store's polling state, its catch-up timer, and how it asks the phone. More...

Functions

void store_fetch_fire (void *data)
 The one-shot fetch's timer callback. Clears the timer and asks the phone.
void store_fetch_stop (StoreFetch *fetch)
 Cancel the one-shot fetch, if one is armed.
void store_fetch_arm (StoreFetch *fetch)
 Arm the one-shot fetch after first_ms, unless one is already waiting.
void store_fetch_turn (StoreFetch *fetch, time_t now)
 The store's turn on the face's cadence. Asks the phone when the deadline has come round.
void store_fetch_start (StoreFetch *fetch, int poll_min, bool live, time_t now)
 What a store's init does with its polling. Takes the interval, then arms one fetch shortly after launch when polling is on, so the store is not blank while the first deadline is coming.
void store_fetch_reconfigure (StoreFetch *fetch, int poll_min, bool live, time_t now, bool empty)
 What a store's reconfigure does with its polling.

Detailed Description

The fetch timing the polling stores share: the one-shot catch-up, the cadence turn, and what an init or a reconfigure does to them.

Each store keeps one StoreFetch and points it at its own request. The interval and deadline decisions stay in store_poll.h, so everything here is a guard around a timer or a request.