|
SensESP 3.6.1-alpha
Universal Signal K sensor toolkit ESP32
|
Pure decision logic for the WiFi watchdog. More...
#include <sensesp/system/wifi_watchdog_policy.h>
Public Member Functions | |
| void | set_link_state (WiFiWatchdogLink link, uint32_t now_ms) |
| bool | restart_due (uint32_t now_ms, uint32_t timeout_ms) const |
Pure decision logic for the WiFi watchdog.
Dependency-free (no Arduino) so it can be unit-tested on the host.
The policy arms on the first link-up after boot. Until then it never requests a restart, so a device that boots without a reachable access point keeps running instead of restarting on every timeout. Once armed, a restart is due when the link has been down continuously for at least the timeout. Repeated down reports keep the original outage start.
Times are unsigned milliseconds from a free-running 32-bit clock such as millis(). Elapsed time is computed with modular subtraction so a wrap of the clock during an outage does not fire early or late.
Definition at line 56 of file wifi_watchdog_policy.h.
|
inline |
|
inline |