SensESP 3.6.1-alpha
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::WiFiWatchdogPolicy Class Reference

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
 

Detailed Description

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.

Member Function Documentation

◆ restart_due()

bool sensesp::WiFiWatchdogPolicy::restart_due ( uint32_t  now_ms,
uint32_t  timeout_ms 
) const
inline

Definition at line 76 of file wifi_watchdog_policy.h.

Here is the caller graph for this function:

◆ set_link_state()

void sensesp::WiFiWatchdogPolicy::set_link_state ( WiFiWatchdogLink  link,
uint32_t  now_ms 
)
inline

Definition at line 58 of file wifi_watchdog_policy.h.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: