Phase 8D - massive refactor and admin functions / admin shell in
webinterface. Memory and cross-origin problems.
This commit is contained in:
+34
-5
@@ -72,6 +72,9 @@ typedef struct {
|
||||
wifi_manager_counters_t counters;
|
||||
} wifi_manager_snapshot_t;
|
||||
|
||||
/* A stale expected working-config generation maps cleanly to HTTP 409. */
|
||||
#define WIFI_MANAGER_ERR_CONFIG_CONFLICT ESP_ERR_INVALID_VERSION
|
||||
|
||||
/*
|
||||
* Initializes ESP-NETIF, the default event loop, both default Wi-Fi netifs,
|
||||
* Wi-Fi itself, and the permanent policy task. The manager never aborts the
|
||||
@@ -79,15 +82,41 @@ typedef struct {
|
||||
*/
|
||||
esp_err_t wifi_manager_init(const wifi_app_config_t *config);
|
||||
|
||||
/* Returns a copy of the RAM working configuration, including credentials. */
|
||||
/*
|
||||
* Returns a copy of the RAM working configuration, including credentials.
|
||||
* The caller owns the returned copy and must securely wipe it after use.
|
||||
*/
|
||||
esp_err_t wifi_manager_get_working_config(wifi_app_config_t *config);
|
||||
|
||||
/*
|
||||
* Replaces the RAM working configuration. Disabled-profile-only edits do not
|
||||
* interrupt a running radio; changes to effective station/AP policy are
|
||||
* applied asynchronously by restarting with the newest generation.
|
||||
* Atomically copies the credential-bearing working configuration and the exact
|
||||
* nonzero generation that identified it. Both outputs are cleared on failure;
|
||||
* the caller must securely wipe config after every successful call.
|
||||
*/
|
||||
esp_err_t wifi_manager_apply_working_config(const wifi_app_config_t *config);
|
||||
esp_err_t wifi_manager_get_working_config_versioned(wifi_app_config_t *config,
|
||||
uint32_t *generation);
|
||||
|
||||
|
||||
/*
|
||||
* Atomically replace the complete validated working configuration only when
|
||||
* expected_generation still identifies the current configuration. A stale
|
||||
* expectation returns WIFI_MANAGER_ERR_CONFIG_CONFLICT without queueing a
|
||||
* restart or changing state. resulting_generation is optional and is set to
|
||||
* zero on failure. Generation exhaustion returns ESP_ERR_INVALID_STATE.
|
||||
*/
|
||||
esp_err_t wifi_manager_compare_exchange_working_config(
|
||||
const wifi_app_config_t *config, uint32_t expected_generation,
|
||||
uint32_t *resulting_generation);
|
||||
|
||||
/*
|
||||
* Persist exactly the working configuration identified by expected_generation.
|
||||
* All config writers are excluded through the NVS operation. A stale
|
||||
* expectation returns WIFI_MANAGER_ERR_CONFIG_CONFLICT. Generation exhaustion
|
||||
* returns ESP_ERR_INVALID_STATE. The saved generation is not incremented because
|
||||
* the RAM working configuration is unchanged.
|
||||
*/
|
||||
esp_err_t wifi_manager_save_working_config_if_generation(
|
||||
uint32_t expected_generation);
|
||||
|
||||
/* Lifecycle requests are asynchronous and serialized by the manager task. */
|
||||
esp_err_t wifi_manager_start(void);
|
||||
|
||||
Reference in New Issue
Block a user