29 return ((now / interval) + 1) * interval;
51 if (*next > now + interval)
bool store_poll_set(StorePoll *poll, int poll_min, bool live, time_t now)
Take a store's interval and whether it is live, as its reconfigure does.
Definition store_poll.c:20
bool store_poll_turn(StorePoll *poll, time_t now)
A store's turn on the face's cadence: whether a poll should go out now.
Definition store_poll.c:34
static bool store_poll_reconnect_due(int age_s, int poll_min)
Whether a reading is worth asking for again now that the phone is back.
Definition store_poll.h:77
static bool store_poll_due(int poll_min, time_t *next, time_t now)
Whether next has come round, moving it on to the following deadline when it has.
Definition store_poll.h:43
bool store_poll_reconnect(const StorePoll *poll, int age_s)
A store's catch-up when the phone comes back: whether to ask for its reading again.
Definition store_poll.c:39
bool store_poll_start(StorePoll *poll, int poll_min, bool live, time_t now)
Take a store's interval and whether it is live, as its init does.
Definition store_poll.c:14
static time_t store_poll_next(int poll_min, time_t now)
The next wall-clock second a poll of this interval falls due.
Definition store_poll.h:26
One store's polling: its interval, whether it polls at all, and when it is next due.
Definition store_poll.h:98
time_t next
Wall-clock second the next recurring poll is due.
Definition store_poll.h:99
int poll_min
Minutes between polls. 0 or less means no recurring poll.
Definition store_poll.h:100
bool pinned
True when init started the store not live, so no reconfigure turns it live.
Definition store_poll.h:102
bool live
True on a live face. A store seeded with fixtures never polls.
Definition store_poll.h:101
#define SECONDS_PER_MINUTE
Seconds in a minute, so the epoch maths reads as what it is.
Definition timeband.c:12