|
|
ChaosDMX
Open-Source DMX-Interface
|
Simple HTTP web server component for ESP32 with async FreeRTOS support. More...
#include "esp_http_server.h"Go to the source code of this file.
Data Structures | |
| struct | webserver_config_t |
| Web server configuration structure. More... | |
Functions | |
| httpd_handle_t | webserver_start (const webserver_config_t *config) |
| Initialize and start the HTTP web server. | |
| void | webserver_stop (httpd_handle_t server) |
| Stop the web server and cleanup resources. | |
| esp_err_t | webserver_register_handler (httpd_handle_t server, const httpd_uri_t *uri_handler) |
| Register a custom URI handler. | |
Simple HTTP web server component for ESP32 with async FreeRTOS support.
Definition in file web_server.h.
| esp_err_t webserver_register_handler | ( | httpd_handle_t | server, |
| const httpd_uri_t * | uri_handler ) |
Register a custom URI handler.
This allows dynamic registration of API endpoints and other custom handlers.
| server | HTTP server handle. |
| uri_handler | Pointer to httpd_uri_t structure. |
Register a custom URI handler.
| server | Handle to the HTTP server instance |
| uri_handler | Pointer to the URI handler struct |
Definition at line 278 of file web_server.c.
| httpd_handle_t webserver_start | ( | const webserver_config_t * | config | ) |
Initialize and start the HTTP web server.
This function creates a FreeRTOS task that manages the HTTP server. It serves static files from the data/ folder and supports dynamic handler registration.
| config | Configuration structure. If NULL, default values are used. |
Initialize and start the HTTP web server.
Initializes storage, configures the HTTP server, registers default handlers, and starts the FreeRTOS task for async operation.
| config | Pointer to webserver configuration struct (optional) |
Definition at line 166 of file web_server.c.
References health_check_handler(), LOGE, LOGI, LOGW, s_server_handle, s_server_task_handle, static_file_handler(), storage_init(), WEBSERVER_DEFAULT_MAX_HANDLERS, WEBSERVER_DEFAULT_PORT, WEBSERVER_DEFAULT_STACK_SIZE, WEBSERVER_DEFAULT_TASK_PRIORITY, and webserver_task().
Referenced by app_main().
| void webserver_stop | ( | httpd_handle_t | server | ) |
Stop the web server and cleanup resources.
| server | HTTP server handle returned by webserver_start(). Safe to pass NULL. |
Stop the web server and cleanup resources.
Stops the HTTP server and deletes the FreeRTOS task.
| server | Handle to the HTTP server instance |
Definition at line 253 of file web_server.c.
References LOGI, s_server_handle, and s_server_task_handle.