Files
espresso_frame/firmware/main/status_screen.h
tfaour a518cbdbaf Add post-connect status screen with WiFi/server checklist
After a successful home WiFi connect, frame_client_run() now redraws the
panel as a two-row checklist (WiFi row with a checkmark, server row) so
the connection sequence is visible on-device rather than only in serial
logs. Refreshes once with the server row pending, probes the tools server
with a plain HTTP HEAD (any response, even 404, confirms the socket-level
connection works -- there's no real server yet), then refreshes again with
the final result. Two refreshes rather than one to actually show staged
progress, at the cost of the extra refresh time inherent to this panel.

Also fixes a second hardware-verified bug in the same area: on a failed
STA connect falling back to provisioning, wifi_init_softap()'s
esp_wifi_init() call was aborting with ESP_ERR_INVALID_STATE, because
frame_wifi_connect_sta() only stopped the WiFi driver on failure rather
than fully deinitializing it (and destroying the STA netif) before
handing back control.
2026-07-18 14:08:19 -04:00

21 lines
698 B
C

#pragma once
#include "esp_err.h"
typedef enum {
STATUS_PENDING,
STATUS_OK,
STATUS_FAILED,
} status_state_t;
/**
* Renders a two-row connection checklist onto the e-ink panel: a WiFi row
* (SSID + a checkmark once connected) and a server row (toolsserver
* address + a checkmark once reachable), each showing a checkmark on
* STATUS_OK, "FAILED" on STATUS_FAILED, or "..." while STATUS_PENDING.
* Call once per stage as connection progress is confirmed, so the panel
* visibly updates as each step completes.
*/
esp_err_t status_screen_show(const char *wifi_ssid, status_state_t wifi_state, const char *server_addr,
status_state_t server_state);