|
REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
#include "proto/main.pb.h"#include <web/server.h>#include <net/auth.h>#include <net/ethernet.h>#include <protocol/protocol.h>#include <utils/logging.h>#include <web/assets.h>#include <web/websockets.h>#include <build/distributor.h>#include <build/distributor_generated.h>#include "web/aWOT.h"
Go to the source code of this file.
Classes | |
| struct | HTTPContext |
Namespaces | |
| namespace | web |
Macros | |
| #define | ENABLE_AWOT_NAMESPACE |
| #define | SERVER_VERSION "LucidacWebServer/" FIRMWARE_VERSION |
| #define | ERR(msg) |
Functions | |
| bool | contains (const char *haystack, const char *needle) |
| bool | equals (const char *a, const char *b) |
| void | allocate_interesting_headers (awot::Application &app) |
| aWOT preallocates everything, therefore request headers are not dynamically parsed but instead only seved when previously storage was allocated. | |
| void | notfound (awot::Request &req, awot::Response &res) |
| void | serve_static (const web::StaticFile &file, awot::Response &res) |
| void | serve_static (awot::Request &req, awot::Response &res) |
| void | index (awot::Request &req, awot::Response &res) |
| void | web::convertToJson (const StaticFile &file, JsonVariant serialized) |
| void | about_static (awot::Request &req, awot::Response &res) |
| void | set_cors (awot::Request &req, awot::Response &res) |
| void | api_preflight (awot::Request &req, awot::Response &res) |
| void | api (awot::Request &req, awot::Response &res) |
| void | websocket_upgrade (awot::Request &req, awot::Response &res) |
| void | onWebsocketMessageCallback (websockets::WebsocketsClient &wsclient, websockets::WebsocketsMessage msg) |
Variables | |
| awot::Application | webapp |
Macro Definition Documentation
◆ ENABLE_AWOT_NAMESPACE
| #define ENABLE_AWOT_NAMESPACE |
Definition at line 17 of file server.cpp.
◆ ERR
| #define ERR | ( | msg | ) |
Definition at line 218 of file server.cpp.
Referenced by websocket_upgrade().
◆ SERVER_VERSION
| #define SERVER_VERSION "LucidacWebServer/" FIRMWARE_VERSION |
Definition at line 27 of file server.cpp.
Referenced by about_static(), index(), notfound(), set_cors(), and websocket_upgrade().
Function Documentation
◆ about_static()
| void about_static | ( | awot::Request & | req, |
| awot::Response & | res ) |
Definition at line 153 of file server.cpp.
References SERVER_VERSION.
◆ allocate_interesting_headers()
| void allocate_interesting_headers | ( | awot::Application & | app | ) |
aWOT preallocates everything, therefore request headers are not dynamically parsed but instead only seved when previously storage was allocated.
Therefore this function serves as a global registry for interesting client-side headers.
Definition at line 44 of file server.cpp.
◆ api()
| void api | ( | awot::Request & | req, |
| awot::Response & | res ) |
Definition at line 193 of file server.cpp.
References set_cors().
◆ api_preflight()
| void api_preflight | ( | awot::Request & | req, |
| awot::Response & | res ) |
Definition at line 188 of file server.cpp.
References set_cors().
◆ contains()
| bool contains | ( | const char * | haystack, |
| const char * | needle ) |
Definition at line 21 of file server.cpp.
Referenced by websocket_upgrade().
◆ equals()
| bool equals | ( | const char * | a, |
| const char * | b ) |
Definition at line 23 of file server.cpp.
Referenced by websocket_upgrade().
◆ index()
| void index | ( | awot::Request & | req, |
| awot::Response & | res ) |
Definition at line 120 of file server.cpp.
References serve_static(), and SERVER_VERSION.
Referenced by platform::interfaces::FrontPlaneSignalGeneratorHAL_Common::set_const_param(), platform::interfaces::FrontPlaneSignalGeneratorHAL_Common::set_parameter(), and platform::interfaces::FrontPlaneSignalGeneratorHAL_Common::set_sine_param().
◆ notfound()
| void notfound | ( | awot::Request & | req, |
| awot::Response & | res ) |
◆ onWebsocketMessageCallback()
| void onWebsocketMessageCallback | ( | websockets::WebsocketsClient & | wsclient, |
| websockets::WebsocketsMessage | msg ) |
Definition at line 327 of file server.cpp.
◆ serve_static() [1/2]
| void serve_static | ( | awot::Request & | req, |
| awot::Response & | res ) |
Definition at line 100 of file server.cpp.
References notfound(), and serve_static().
◆ serve_static() [2/2]
| void serve_static | ( | const web::StaticFile & | file, |
| awot::Response & | res ) |
Definition at line 75 of file server.cpp.
References uint32_t.
Referenced by index(), and serve_static().
◆ set_cors()
| void set_cors | ( | awot::Request & | req, |
| awot::Response & | res ) |
Definition at line 177 of file server.cpp.
References SERVER_VERSION.
Referenced by api(), and api_preflight().
◆ websocket_upgrade()
| void websocket_upgrade | ( | awot::Request & | req, |
| awot::Response & | res ) |
Definition at line 229 of file server.cpp.
References contains(), equals(), ERR, and SERVER_VERSION.
Variable Documentation
◆ webapp
| awot::Application webapp |
Definition at line 37 of file server.cpp.