Firmware  0.0.0
Loading...
Searching...
No Matches
server.cpp File Reference

HTTP server for station. More...

#include "server.hpp"
#include <ArduinoJson.h>
#include <driver/gpio.h>
#include <esp_app_desc.h>
#include <esp_wifi.h>
#include <dcc/dcc.hpp>
#include <gsl/util>
#include <ztl/string.hpp>
#include "analog/convert.hpp"
#include "frontend_embeds.hpp"
#include "log.h"
#include "mem/nvs/settings.hpp"
#include "utility.hpp"
Include dependency graph for server.cpp:

Namespaces

namespace  http
 
namespace  http::sta
 

Macros

#define GENERIC_WS_HANDLER(NAME, URI)
 

Detailed Description

Author
Vincent Hamp
Date
01/03/2023

Macro Definition Documentation

◆ GENERIC_WS_HANDLER

#define GENERIC_WS_HANDLER ( NAME,
URI )
Value:
esp_err_t Server::NAME(httpd_req_t* req) { \
if (req->method == HTTP_GET) { \
LOGI("WS open"); \
return ESP_OK; \
} else { \
httpd_req_t cpy{.handle = req->handle, \
.method = req->method, \
.uri = URI, \
.content_len = req->content_len, \
.aux = req->aux, \
.user_ctx = req->user_ctx, \
.sess_ctx = req->sess_ctx, \
.free_ctx = req->free_ctx, \
.ignore_sess_ctx_changes = \
req->ignore_sess_ctx_changes}; \
return asyncResponse(&cpy); \
} \
}