REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
server.h
Go to the documentation of this file.
1// Copyright (c) 2023 anabrid GmbH
2// Contact: https://www.anabrid.com/licensing/
3// SPDX-License-Identifier: MIT OR GPL-2.0-or-later
4
5#pragma once
6
7#ifdef ARDUINO
8
9#include <ArduinoJson.h>
10#include <list>
11
12#include "QNEthernet.h"
13#include "net/auth.h"
14#include "net/ethernet.h"
15#include "utils/durations.h"
16#include "websockets/client.h"
17#include "utils/singleton.h"
18
19namespace web {
31
47struct LucidacWebServer : public utils::HeapSingleton<LucidacWebServer> {
48 std::list<LucidacWebsocketsClient> clients;
49 net::EthernetServer ethserver;
50
51 void begin();
52 void loop();
53};
54} // namespace web
55
56#endif // ARDUINO
A thin wrapper around the username.
Definition auth.h:231
Define singletons which are not static-space allocated (and thus consume valuable ICTM space).
Definition singleton.h:46
Definition assets.h:11
Simple time tracking (up to 50 days)
Definition durations.h:15
This class implements a simple webserver for the LUCIDAC.
Definition server.h:47
net::EthernetServer ethserver
Definition server.h:49
std::list< LucidacWebsocketsClient > clients
Definition server.h:48
This structure collects all relevant context about a running Websocket connection.
Definition server.h:24
websockets::WebsocketsClient ws
Definition server.h:28
net::auth::AuthentificationContext user_context
Definition server.h:26
net::EthernetClient socket
Definition server.h:27
LucidacWebsocketsClient(const net::EthernetClient &other)
Definition server.cpp:311
utils::duration last_contact
Tracking lifetime with millis() to time-out a connection.
Definition server.h:25