|
IoT25S IoT Klocka 0.1
Grupparbete för IoT25S på Jensen YH
|
#include "web_portal.h"#include <ctype.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "freertos/FreeRTOS.h"#include "freertos/event_groups.h"#include "freertos/task.h"#include "esp_check.h"#include "esp_event.h"#include "esp_http_server.h"#include "esp_log.h"#include "esp_netif.h"#include "mdns.h"#include "esp_system.h"#include "esp_wifi.h"#include "sdkconfig.h"#include "app_state.h"#include "time_service.h"
Include dependency graph for web_portal.c:Go to the source code of this file.
Data Structures | |
| struct | web_portal_timezone_option_t |
Macros | |
| #define | WIFI_CONNECTED_BIT BIT0 |
| #define | WIFI_FAILED_BIT BIT1 |
| #define | CONFIG_WEB_PORTAL_WIFI_CONNECT_TIMEOUT_MS 15000 |
| #define | CONFIG_WEB_PORTAL_AP_CHANNEL 1 |
| #define | CONFIG_WEB_PORTAL_HTTP_MAX_URI_HANDLERS 16 |
| #define | CONFIG_WEB_PORTAL_REBOOT_DELAY_MS 1000 |
| #define | CONFIG_WEB_PORTAL_MDNS_ENABLE 1 |
| #define | CONFIG_WEB_PORTAL_MDNS_HOSTNAME "alarmclock" |
| #define | CONFIG_WEB_PORTAL_MDNS_INSTANCE_NAME "ESP32-C3 Alarm Clock" |
| #define | CONFIG_WEB_PORTAL_LOG_AP_CREDENTIALS 0 |
| #define | WIFI_CONNECT_TIMEOUT_MS CONFIG_WEB_PORTAL_WIFI_CONNECT_TIMEOUT_MS |
| #define | WEB_PORTAL_TIMEZONE_CUSTOM_ID "custom" |
Functions | |
| const uint8_t s_portal_html_start[] | asm ("_binary_index_html_start") |
| const uint8_t s_portal_html_end[] | asm ("_binary_index_html_end") |
| const uint8_t s_portal_css_start[] | asm ("_binary_style_css_start") |
| const uint8_t s_portal_css_end[] | asm ("_binary_style_css_end") |
| const uint8_t s_portal_js_start[] | asm ("_binary_app_js_start") |
| const uint8_t s_portal_js_end[] | asm ("_binary_app_js_end") |
| static void | web_portal_copy_text (char *dest, size_t dest_len, const char *src) |
| static void | web_portal_reboot_task (void *arg) |
| static void | web_portal_schedule_reboot (void) |
| static void | web_portal_start_mdns (uint16_t http_port) |
| static void | web_portal_stop_mdns (void) |
| static void | web_portal_send_redirect (httpd_req_t *req) |
| static char | web_portal_hex_to_char (char high, char low) |
| static void | web_portal_url_decode (char *dest, size_t dest_len, const char *src) |
| static bool | web_portal_form_get_value (const char *body, const char *key, char *out, size_t out_len) |
| static esp_err_t | web_portal_read_body (httpd_req_t *req, char *buffer, size_t buffer_len) |
| static int16_t | web_portal_clamp_timezone_offset (long parsed) |
| static bool | web_portal_timezone_location_valid (const char *location_id) |
| static void | web_portal_wifi_event_handler (void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) |
| static esp_err_t | web_portal_wifi_init_once (void) |
| static esp_err_t | web_portal_start_ap (const app_config_t *config) |
| static esp_err_t | web_portal_start_sta (const app_config_t *config) |
| static esp_err_t | web_portal_root_get (httpd_req_t *req) |
| static esp_err_t | web_portal_css_get (httpd_req_t *req) |
| static esp_err_t | web_portal_js_get (httpd_req_t *req) |
| static esp_err_t | web_portal_status_get (httpd_req_t *req) |
| static esp_err_t | web_portal_config_get (httpd_req_t *req) |
| static esp_err_t | web_portal_config_post (httpd_req_t *req) |
| static esp_err_t | web_portal_time_post (httpd_req_t *req) |
| static esp_err_t | web_portal_alarms_get (httpd_req_t *req) |
| static esp_err_t | web_portal_alarms_post (httpd_req_t *req) |
| static esp_err_t | web_portal_reset_wifi_post (httpd_req_t *req) |
| static esp_err_t | web_portal_captive_redirect (httpd_req_t *req) |
| static esp_err_t | web_portal_not_found_handler (httpd_req_t *req, httpd_err_code_t error) |
| static esp_err_t | web_portal_start_http_server (void) |
| esp_err_t | web_portal_start (void) |
| Start Wi-Fi mode handling and HTTP portal service. | |
Variables | |
| static const char * | TAG = "web_portal" |
| static const web_portal_timezone_option_t | s_timezone_options [] |
| static const size_t | s_timezone_option_count |
| static EventGroupHandle_t | s_wifi_event_group |
| static httpd_handle_t | s_http_server |
| static bool | s_wifi_initialized |
| static int | s_retry_count |
| static bool | s_reboot_scheduled |
| static bool | s_mdns_initialized |
| static uint16_t | s_http_port = 80 |
| static char | s_last_sta_ssid [APP_WIFI_SSID_MAX_LEN+1] |
| #define CONFIG_WEB_PORTAL_AP_CHANNEL 1 |
Definition at line 35 of file web_portal.c.
| #define CONFIG_WEB_PORTAL_HTTP_MAX_URI_HANDLERS 16 |
Definition at line 39 of file web_portal.c.
| #define CONFIG_WEB_PORTAL_LOG_AP_CREDENTIALS 0 |
Definition at line 59 of file web_portal.c.
| #define CONFIG_WEB_PORTAL_MDNS_ENABLE 1 |
Definition at line 47 of file web_portal.c.
| #define CONFIG_WEB_PORTAL_MDNS_HOSTNAME "alarmclock" |
Definition at line 51 of file web_portal.c.
| #define CONFIG_WEB_PORTAL_MDNS_INSTANCE_NAME "ESP32-C3 Alarm Clock" |
Definition at line 55 of file web_portal.c.
| #define CONFIG_WEB_PORTAL_REBOOT_DELAY_MS 1000 |
Definition at line 43 of file web_portal.c.
| #define CONFIG_WEB_PORTAL_WIFI_CONNECT_TIMEOUT_MS 15000 |
Definition at line 31 of file web_portal.c.
| #define WEB_PORTAL_TIMEZONE_CUSTOM_ID "custom" |
Definition at line 63 of file web_portal.c.
| #define WIFI_CONNECT_TIMEOUT_MS CONFIG_WEB_PORTAL_WIFI_CONNECT_TIMEOUT_MS |
Definition at line 62 of file web_portal.c.
| #define WIFI_CONNECTED_BIT BIT0 |
Definition at line 27 of file web_portal.c.
| #define WIFI_FAILED_BIT BIT1 |
Definition at line 28 of file web_portal.c.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
static |
Definition at line 697 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 724 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 808 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 276 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 551 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 573 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 109 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 503 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 223 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 196 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 512 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 814 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 254 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 122 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 797 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 494 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 129 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 189 of file web_portal.c.
Here is the caller graph for this function:| esp_err_t web_portal_start | ( | void | ) |
Start Wi-Fi mode handling and HTTP portal service.
Definition at line 882 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 402 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 824 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 139 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 451 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 521 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 176 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 679 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 287 of file web_portal.c.
Here is the caller graph for this function:
|
static |
Definition at line 204 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 304 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 367 of file web_portal.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 106 of file web_portal.c.
|
static |
Definition at line 101 of file web_portal.c.
|
static |
Definition at line 107 of file web_portal.c.
|
static |
Definition at line 105 of file web_portal.c.
|
static |
Definition at line 104 of file web_portal.c.
|
static |
Definition at line 103 of file web_portal.c.
|
static |
Definition at line 97 of file web_portal.c.
|
static |
Definition at line 79 of file web_portal.c.
|
static |
Definition at line 100 of file web_portal.c.
|
static |
Definition at line 102 of file web_portal.c.
|
static |
Definition at line 72 of file web_portal.c.