Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
esp32_web_server.h
Go to the documentation of this file.
1#pragma once
2
3#if defined(ARDUINO)
5#include <DNSServer.h>
6#include <WebServer.h>
7
8namespace ersa::hal {
9
11class Esp32WebServer final : public IHttpServer, public IDnsServer {
12public:
13 Esp32WebServer();
14 Result<void> begin(uint16_t port) override;
15 void route(std::string_view path, HttpMethod method, HttpHandler handler, void* context) override;
16 void routeNotFound(HttpHandler handler, void* context) override;
17 void handleClient() override;
18 void stop() override;
19 bool hasArgument(std::string_view name) const override;
20 std::string argument(std::string_view name) const override;
21 void send(uint16_t status, std::string_view contentType, std::string_view body) override;
22 Result<void> begin(uint16_t port, std::string_view domain, const uint8_t address[4]) override;
23 void process() override;
24
25private:
26 WebServer server_;
27 DNSServer dns_;
28};
29
30} // namespace ersa::hal
31#endif
void begin()
Definition app_agenda.cpp:27
void stop()
Definition battery.h:7