IoT25S IoT Klocka 0.1
Grupparbete för IoT25S på Jensen YH
Loading...
Searching...
No Matches
web_portal.h File Reference

Wi-Fi provisioning/runtime portal service API. More...

#include "esp_err.h"
+ Include dependency graph for web_portal.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

esp_err_t web_portal_start (void)
 Start Wi-Fi mode handling and HTTP portal service.
 

Detailed Description

Wi-Fi provisioning/runtime portal service API.

Definition in file web_portal.h.

Function Documentation

◆ web_portal_start()

esp_err_t web_portal_start ( void  )

Start Wi-Fi mode handling and HTTP portal service.

Returns
ESP_OK on success, otherwise an ESP_ERR_* code.

Definition at line 882 of file web_portal.c.

883{
884 app_config_t config;
885
886 ESP_RETURN_ON_ERROR(web_portal_wifi_init_once(), TAG, "wifi init failed");
887
888 app_state_get_config(&config);
889
890 if (config.wifi_configured && config.wifi_ssid[0] != '\0' && web_portal_start_sta(&config) == ESP_OK) {
892 } else {
893 ESP_RETURN_ON_ERROR(web_portal_start_ap(&config), TAG, "AP start failed");
894 }
895
897}
void app_state_get_config(app_config_t *config)
Get current persisted configuration.
Definition app_state.c:214
void app_state_set_portal_mode(bool portal_mode)
Update runtime portal mode flag.
Definition app_state.c:256
Persisted configuration model.
Definition app_state.h:40
char wifi_ssid[APP_WIFI_SSID_MAX_LEN+1]
Definition app_state.h:41
bool wifi_configured
Definition app_state.h:43
static esp_err_t web_portal_start_sta(const app_config_t *config)
Definition web_portal.c:451
static esp_err_t web_portal_start_ap(const app_config_t *config)
Definition web_portal.c:402
static const char * TAG
Definition web_portal.c:72
static esp_err_t web_portal_start_http_server(void)
Definition web_portal.c:824
static esp_err_t web_portal_wifi_init_once(void)
Definition web_portal.c:367
+ Here is the call graph for this function:
+ Here is the caller graph for this function: