|
Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
|
Decides what the WiFi glue should do next. Events that do not apply to the current state return Action{None} and change nothing. All time arithmetic is wrap-safe. More...
#include <wifi_plan.h>
Public Member Functions | |
| Action | start (bool have_saved, uint32_t now_ms) |
| Boot only: saved networks -> Scanning + StartScan; none -> Setup + StartHotspot. | |
| Action | on_scan_done (const Candidates &c, uint32_t now_ms) |
| Scan finished (Scanning, Setup or Lost). Candidates -> Joining; none -> Setup (Scanning only). | |
| Action | on_joined (uint32_t now_ms) |
| Joining, Lost or Setup -> Connected; StopHotspot if the hotspot is up. | |
| Action | on_join_failed (JoinFail why, uint32_t now_ms) |
| Joining only: next remembered candidate, else Setup (+ StartHotspot if not up). A Transient failure first retries the same candidate (same Join action, up to kTransientRetries, only before kJoinTimeoutMs since its first attempt). Entering Setup with the hotspot not yet up schedules the first rescan after kSetupFirstRescanMs; later ones keep kSetupRescanMs. | |
| Action | on_disconnected (uint32_t now_ms) |
| Connected -> Lost (auto-reconnect retries; nothing issued). | |
| Action | on_network_added (uint32_t now_ms) |
| Setup or Lost -> StartScan (and the last failure is cleared; a scan that then finds no candidate records NotFound); other states only store the network (None). | |
| Action | tick (uint32_t now_ms) |
| Timers: join timeout, Lost -> Setup, Setup rescan. | |
| PlanState | state () const |
| bool | hotspot_up () const |
| JoinFail | last_failure () const |
Decides what the WiFi glue should do next. Events that do not apply to the current state return Action{None} and change nothing. All time arithmetic is wrap-safe.