14#define APP_WIFI_SSID_MAX_LEN 32
16#define APP_WIFI_PASSWORD_MAX_LEN 64
18#define APP_AP_SSID_MAX_LEN 32
20#define APP_AP_PASSWORD_MAX_LEN 16
22#define APP_TIMEZONE_LOCATION_MAX_LEN 32
24#define APP_IP_ADDRESS_MAX_LEN 16
26#define APP_ALARM_MAX_COUNT 8
esp_err_t app_state_update_alarm(uint8_t index, uint8_t hour, uint8_t minute, bool enabled)
Replace an existing alarm entry by index.
#define APP_TIMEZONE_LOCATION_MAX_LEN
Maximum timezone location identifier length (without null terminator).
esp_err_t app_state_init(void)
Initialize state, defaults, and NVS-backed values.
esp_err_t app_state_toggle_alarm(uint8_t index)
Toggle the enabled flag of an alarm by index.
#define APP_WIFI_SSID_MAX_LEN
Maximum Wi-Fi SSID length (without null terminator).
#define APP_AP_SSID_MAX_LEN
Maximum provisioning AP SSID length (without null terminator).
void app_state_get_time_epoch(int64_t *epoch, bool *valid)
Get stored epoch value and validity flag.
void app_state_get_alarms(alarm_entry_t *out, uint8_t *count)
Get current alarm list.
#define APP_AP_PASSWORD_MAX_LEN
Maximum provisioning AP password length (without null terminator).
esp_err_t app_state_delete_alarm(uint8_t index)
Delete an alarm by index (subsequent alarms shift down).
esp_err_t app_state_add_alarm(uint8_t hour, uint8_t minute, bool enabled)
Add a new alarm.
void app_state_set_wifi_connected(bool connected, const char *ip_address)
Update runtime Wi-Fi status and optional station IP.
esp_err_t app_state_reset_wifi_credentials(void)
Clear persisted Wi-Fi credentials.
void app_state_set_alarm_active(bool active)
Update runtime alarm active flag.
void app_state_get_config(app_config_t *config)
Get current persisted configuration.
#define APP_ALARM_MAX_COUNT
Maximum number of configurable alarms.
void app_state_get_snapshot(app_state_snapshot_t *snapshot)
Get a thread-safe snapshot of the full state.
esp_err_t app_state_set_time_epoch(int64_t epoch, bool valid)
Update stored epoch and validity flag.
void app_state_set_portal_mode(bool portal_mode)
Update runtime portal mode flag.
#define APP_WIFI_PASSWORD_MAX_LEN
Maximum Wi-Fi password length (without null terminator).
#define APP_IP_ADDRESS_MAX_LEN
Maximum IPv4 address string length including null terminator.
esp_err_t app_state_update_config(const app_config_t *config)
Replace persisted configuration with provided values.
Persisted configuration model.
Snapshot of full app state.