Phase 5: Wi-Fi manager w/ reconnect, Scryfall HTTPS client + cJSON caching to /spiffs on net_task (Core 0)

This commit is contained in:
2026-09-09 17:53:41 +02:00
parent e09ec04946
commit 58b15869e2
8 changed files with 671 additions and 1 deletions

40
main/wifi_manager.h Normal file
View File

@@ -0,0 +1,40 @@
/*
* MTG RFID Companion - Wi-Fi manager (Core 0)
*
* Phase 5 Step 5.1: Station-mode auto-connect with disconnect event
* handling and reconnect back-off.
*/
#pragma once
#include "esp_err.h"
#include "freertos/FreeRTOS.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Initialize the Wi-Fi subsystem (netif, driver, events).
* @return ESP_OK on success.
*/
esp_err_t wifi_manager_init(void);
/**
* @brief Start station mode and attempt to connect to the configured AP.
*/
esp_err_t wifi_manager_start(void);
/**
* @brief True if the STA has a valid IP.
*/
bool wifi_manager_connected(void);
/**
* @brief Block until connected or timeout. Returns ESP_OK if connected.
*/
esp_err_t wifi_manager_wait_connected(TickType_t timeout_ticks);
#ifdef __cplusplus
}
#endif