Implement HTTPS lifecycle and reboot controls
This commit is contained in:
+25
-1
@@ -39,7 +39,31 @@ typedef struct {
|
||||
/* Initialize runtime state without requiring valid certificate material. */
|
||||
esp_err_t web_server_init(void);
|
||||
|
||||
/* Start one TLS-only server on all active network interfaces. */
|
||||
typedef struct {
|
||||
uint32_t generation;
|
||||
bool running;
|
||||
bool transitioning;
|
||||
bool controllable;
|
||||
} web_server_management_snapshot_t;
|
||||
|
||||
/* Zero-wait, secret-free projection; controllable excludes failed cleanup and
|
||||
* exhausted generations. No HTTPD work or owner wait is performed. */
|
||||
esp_err_t web_server_get_management_snapshot(web_server_management_snapshot_t *snapshot);
|
||||
|
||||
/* Conditional lifecycle admission under the canonical server mutex. Call only
|
||||
* off HTTPD, after caller-owned authorization and bounded ACK handoff. These
|
||||
* APIs do not authenticate, acknowledge, cancel on revocation, or bound HTTPD
|
||||
* shutdown time. Restart reserves the lifecycle through stop and start; a failed
|
||||
* stop never starts another server. Stale/exhausted/unclean state rejects without
|
||||
* side effects. Canonical stop/start below remain the recovery path. */
|
||||
esp_err_t web_server_stop_current(uint32_t expected_generation);
|
||||
esp_err_t web_server_restart_current(uint32_t expected_generation);
|
||||
/* Reserves this HTTPS generation before canonical whole-device esp_restart().
|
||||
* Admission cannot be cancelled; normally does not return. Same caller rules. */
|
||||
esp_err_t web_server_reboot_current(uint32_t expected_generation);
|
||||
|
||||
/* Start one TLS-only server on all active network interfaces.
|
||||
* Start/stop may wait for HTTPD; never call from its task or queued callbacks. */
|
||||
esp_err_t web_server_start(void);
|
||||
esp_err_t web_server_stop(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user