chore(format): initial formatting

This commit is contained in:
HendrikRauh 2026-03-05 23:05:35 +01:00
parent fa08fcfe65
commit 008c79852b
21 changed files with 1021 additions and 1082 deletions

View file

@ -1,6 +1,7 @@
/**
* @file web_server.h
* @brief Simple HTTP web server component for ESP32 with async FreeRTOS support.
* @brief Simple HTTP web server component for ESP32 with async FreeRTOS
* support.
*/
#pragma once
@ -8,50 +9,50 @@
#include "esp_http_server.h"
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
/**
* @brief Web server configuration structure.
*/
typedef struct
{
uint16_t port; ///< HTTP server port (default: 80)
size_t max_uri_handlers; ///< Maximum number of URI handlers
size_t stack_size; ///< FreeRTOS task stack size
UBaseType_t task_priority; ///< FreeRTOS task priority
} webserver_config_t;
/**
* @brief Web server configuration structure.
*/
typedef struct {
uint16_t port; ///< HTTP server port (default: 80)
size_t max_uri_handlers; ///< Maximum number of URI handlers
size_t stack_size; ///< FreeRTOS task stack size
UBaseType_t task_priority; ///< FreeRTOS task priority
} webserver_config_t;
/**
* @brief 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.
*
* @param config Configuration structure. If NULL, default values are used.
* @return HTTP server handle on success, NULL on failure.
*/
httpd_handle_t webserver_start(const webserver_config_t *config);
/**
* @brief 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.
*
* @param config Configuration structure. If NULL, default values are used.
* @return HTTP server handle on success, NULL on failure.
*/
httpd_handle_t webserver_start(const webserver_config_t *config);
/**
* @brief Stop the web server and cleanup resources.
*
* @param server HTTP server handle returned by webserver_start().
* Safe to pass NULL.
*/
void webserver_stop(httpd_handle_t server);
/**
* @brief Stop the web server and cleanup resources.
*
* @param server HTTP server handle returned by webserver_start().
* Safe to pass NULL.
*/
void webserver_stop(httpd_handle_t server);
/**
* @brief Register a custom URI handler.
*
* This allows dynamic registration of API endpoints and other custom handlers.
*
* @param server HTTP server handle.
* @param uri_handler Pointer to httpd_uri_t structure.
* @return ESP_OK on success, error code otherwise.
*/
esp_err_t webserver_register_handler(httpd_handle_t server, const httpd_uri_t *uri_handler);
/**
* @brief Register a custom URI handler.
*
* This allows dynamic registration of API endpoints and other custom handlers.
*
* @param server HTTP server handle.
* @param uri_handler Pointer to httpd_uri_t structure.
* @return ESP_OK on success, error code otherwise.
*/
esp_err_t webserver_register_handler(httpd_handle_t server,
const httpd_uri_t *uri_handler);
#ifdef __cplusplus
}

View file

@ -3,12 +3,12 @@
#include "esp_err.h"
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
esp_err_t wifi_start_ap(const char *ssid, const char *password, uint8_t channel, uint8_t max_connections);
void wifi_stop_ap(void);
esp_err_t wifi_start_ap(const char *ssid, const char *password, uint8_t channel,
uint8_t max_connections);
void wifi_stop_ap(void);
#ifdef __cplusplus
}