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 init and its reconfigure both do.
Definition store_poll.c:12
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:26
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
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:92
time_t next
Wall-clock second the next recurring poll is due.
Definition store_poll.h:93
int poll_min
Minutes between polls. 0 or less means no recurring poll.
Definition store_poll.h:94
bool live
True on a live face. A store seeded with fixtures never polls.
Definition store_poll.h:95
#define SECONDS_PER_MINUTE
Seconds in a minute, so the epoch maths reads as what it is.
Definition timeband.c:12