REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
web::LucidacWebServer Struct Reference

This class implements a simple webserver for the LUCIDAC. More...

#include <server.h>

Inheritance diagram for web::LucidacWebServer:
Collaboration diagram for web::LucidacWebServer:

Public Member Functions

void begin ()
 
void loop ()
 

Public Attributes

std::list< LucidacWebsocketsClientclients
 
net::EthernetServer ethserver
 

Additional Inherited Members

- Static Public Member Functions inherited from utils::HeapSingleton< LucidacWebServer >
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.

Definition at line 47 of file server.h.

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()

Member Data Documentation

◆ clients

std::list<LucidacWebsocketsClient> web::LucidacWebServer::clients

Definition at line 48 of file server.h.

◆ ethserver

net::EthernetServer web::LucidacWebServer::ethserver

Definition at line 49 of file server.h.

Referenced by begin().


The documentation for this struct was generated from the following files: