Add Typed Admin Network Settings
This commit is contained in:
@@ -89,6 +89,52 @@ esp_err_t wifi_manager_get_working_config(wifi_app_config_t *config);
|
||||
*/
|
||||
esp_err_t wifi_manager_apply_working_config(const wifi_app_config_t *config);
|
||||
|
||||
/* Secret-free working projection, copied together with runtime under the mutex.
|
||||
* Zero wait: ESP_ERR_TIMEOUT means no snapshot was obtained. Password presence
|
||||
* is the only credential metadata, needed to stage/enable disabled profiles. */
|
||||
typedef struct {
|
||||
uint8_t enabled, priority;
|
||||
wifi_config_security_t security;
|
||||
uint8_t ssid_len, ssid[WIFI_CONFIG_SSID_MAX_LEN];
|
||||
bool password_configured;
|
||||
} wifi_manager_profile_settings_t;
|
||||
typedef struct {
|
||||
wifi_manager_snapshot_t runtime;
|
||||
uint8_t enabled_at_boot, ap_channel;
|
||||
wifi_config_ap_policy_t ap_policy;
|
||||
uint8_t ap_ssid_len, ap_ssid[WIFI_CONFIG_SSID_MAX_LEN];
|
||||
bool ap_password_configured;
|
||||
wifi_manager_profile_settings_t profiles[WIFI_CONFIG_STA_PROFILE_COUNT];
|
||||
} wifi_manager_settings_t;
|
||||
esp_err_t wifi_manager_get_settings(wifi_manager_settings_t *settings);
|
||||
|
||||
enum {
|
||||
WIFI_PATCH_BOOT = 1U << 0, WIFI_PATCH_POLICY = 1U << 1,
|
||||
WIFI_PATCH_CHANNEL = 1U << 2, WIFI_PATCH_ENABLED = 1U << 3,
|
||||
WIFI_PATCH_PRIORITY = 1U << 4, WIFI_PATCH_SECURITY = 1U << 5,
|
||||
WIFI_PATCH_SSID = 1U << 6, WIFI_PATCH_PASSWORD = 1U << 7,
|
||||
};
|
||||
/* profile=-1 selects AP/global fields; 0..3 selects a station profile.
|
||||
* Absent bits preserve CURRENT bytes, never a stale caller's secret copy.
|
||||
* PASSWORD with length zero clears only when canonical validation permits it.
|
||||
* Caller owns and must wipe this transient input after every exit path. */
|
||||
typedef struct {
|
||||
uint32_t fields;
|
||||
int8_t profile;
|
||||
uint8_t enabled_at_boot, ap_channel, enabled, priority;
|
||||
wifi_config_ap_policy_t ap_policy;
|
||||
wifi_config_security_t security;
|
||||
uint8_t ssid_len, ssid[WIFI_CONFIG_SSID_MAX_LEN];
|
||||
uint8_t password_len, password[WIFI_CONFIG_PSK_MAX_LEN];
|
||||
} wifi_manager_patch_t;
|
||||
/* Dispatcher-only conditional operations. A nonzero expected generation must
|
||||
* match under the mutation mutex; ESP_ERR_NOT_FOUND denotes stale selection.
|
||||
* No generation wrap/reuse. Queue failure leaves RAM untouched. */
|
||||
esp_err_t wifi_manager_patch_current(uint32_t generation, const wifi_manager_patch_t *patch);
|
||||
esp_err_t wifi_manager_save_current(uint32_t generation);
|
||||
/* Stored-only load: never generates or installs unknown default credentials. */
|
||||
esp_err_t wifi_manager_load_current(uint32_t generation);
|
||||
|
||||
/* Lifecycle requests are asynchronous and serialized by the manager task. */
|
||||
esp_err_t wifi_manager_start(void);
|
||||
esp_err_t wifi_manager_stop(void);
|
||||
|
||||
Reference in New Issue
Block a user