REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
This class implements a simple webserver for the LUCIDAC. More...
#include <server.h>


Public Member Functions | |
void | begin () |
void | loop () |
Public Attributes | |
std::list< LucidacWebsocketsClient > | clients |
net::EthernetServer | ethserver |
Additional Inherited Members | |
![]() | |
static LucidacWebServer & | get () |
Detailed Description
This class implements a simple webserver for the LUCIDAC.
It's main job is to elevate the JSONL protocol in the HTTP "REST-like" world, allowing to speak the JSONL protocol also over HTTP and therefore opening LUCIDAC programming to web technologies.
Second, it serves a few "static files", i.e. HTML/CSS/JS/images which allow to host simple sites directly from the firmware (See also assets.h
for the appropriate tooling).
This web server shall have no further logic beyond passing queries to the standard "protocol". Therefore, any "client side programs" are encoded in the "static files" (also refered to as "assets"). For the firmware, this acts just as a regular client.
Member Function Documentation
◆ begin()
FLASHMEM void web::LucidacWebServer::begin | ( | ) |
TODO: Expose REST-like frontend for a few simple requests such as GET /rest/status GET+PUT /rest/config GET+PUT /rest/settings
Definition at line 276 of file server.cpp.
References about_static(), allocate_interesting_headers(), api(), api_preflight(), ethserver, awot::Application::get(), utils::HeapSingleton< StartupConfig >::get(), index(), awot::Application::options(), awot::Application::post(), serve_static(), webapp, and websocket_upgrade().
◆ loop()
FLASHMEM void web::LucidacWebServer::loop | ( | ) |
Definition at line 343 of file server.cpp.
References HTTPContext::client, websockets::CloseReason_GoingAway, HTTPContext::convert_to_websocket, utils::HeapSingleton< StartupConfig >::get(), LOG4, LOG5, LOG_ALWAYS, onWebsocketMessageCallback(), awot::Application::process(), HTTPContext::server, and webapp.
Member Data Documentation
◆ clients
std::list<LucidacWebsocketsClient> web::LucidacWebServer::clients |
◆ ethserver
net::EthernetServer web::LucidacWebServer::ethserver |
The documentation for this struct was generated from the following files:
- lib/communication/src/web/server.h
- lib/communication/src/web/server.cpp