Splits provisioning (softAP + captive portal + NVS-backed config) into wifi_provisioning.c and home-network connection into frame_client.c. /save_config now parses the form body and persists it to NVS; on boot the device goes straight to STA mode if a config exists, retrying a few times before falling back to provisioning if the home network is unreachable. The provisioning AP is now always named ESPRESSO with a random per-device password (generated once, persisted in NVS) instead of a fixed Kconfig value, drawn from a charset that avoids visually ambiguous characters since it'll be read off the e-ink panel and possibly typed by hand.
23 lines
832 B
C
23 lines
832 B
C
#pragma once
|
|
|
|
#include "esp_err.h"
|
|
#include "wifi_provisioning.h"
|
|
|
|
/**
|
|
* Connects to the home WiFi network described by cfg, retrying up to
|
|
* CONFIG_FRAME_STA_CONNECT_MAX_RETRIES times with a per-attempt timeout of
|
|
* CONFIG_FRAME_STA_CONNECT_TIMEOUT_MS. Returns ESP_OK once an IP address
|
|
* has been obtained, ESP_FAIL if all retries are exhausted.
|
|
*/
|
|
esp_err_t frame_wifi_connect_sta(const frame_config_t *cfg);
|
|
|
|
/**
|
|
* Runs the frame's normal-operation cycle: fetch the current image from
|
|
* cfg->toolsserver, display it, and deep-sleep until the next refresh.
|
|
*
|
|
* TODO(step 6): implement the HTTP fetch + EPD display + esp_deep_sleep
|
|
* cycle once the display driver (step 4) and server (step 3) exist. For
|
|
* now this just confirms STA connectivity survives a reboot.
|
|
*/
|
|
void frame_client_run(const frame_config_t *cfg);
|