#pragma once namespace kvida { enum class CommissioningState { Idle, ApActive, Connecting, Connected, Failed, }; // Starts a SoftAP + captive portal so the user can submit Wi-Fi // credentials from any browser -- no companion app needed. Intended to // be triggered by a physical action (e.g. a button press), per the // "configuration mode requires physical user interaction" security // principle in AGENTS.md. No-op if already active or already connected. void start_commissioning(); // Stops the SoftAP/captive portal (e.g. on timeout, or once connected). // Safe to call even if not active. void stop_commissioning(); CommissioningState commissioning_state(); // Attempts to connect using credentials already stored in NVS from a // previous commissioning session. Returns false immediately if none are // stored; otherwise the result arrives asynchronously via // commissioning_state(). bool try_stored_credentials(); } // namespace kvida