22 #ifndef EMBAJAXOUTPUTDRIVERGENERIC_H
23 #define EMBAJAXOUTPUTDRIVERGENERIC_H
25 #if defined (EMBAJAX_OUTUPUTDRIVER_IMPLEMENTATION)
26 #error Duplicate definition of output driver. Fix your include-directives.
28 #define EMBAJAX_OUTUPUTDRIVER_IMPLEMENTATION
30 #if not defined EmbAJAXOutputDriverWebServerClass
31 #error Please define EmbAJAXOutputDriverWebServerClass or #include appropriate hardware specific driver
46 void printHeader(
bool html)
override {
47 _server->setContentLength(CONTENT_LENGTH_UNKNOWN);
49 _server->send(200,
"text/html",
"");
51 _server->send(200,
"text/json",
"");
54 void printContent(
const char *content)
override {
55 if (content[0] !=
'\0') _server->sendContent(content);
57 const char* getArg(
const char* name,
char* buf,
int buflen)
override {
58 _server->arg(name).toCharArray (buf, buflen);
62 _server->on(path, [=]() {
63 if (_server->method() == HTTP_POST) {
64 page->handleRequest(change_callback);
71 _server->handleClient();
74 EmbAJAXOutputDriverWebServerClass *_server;
static void setDriver(EmbAJAXOutputDriverBase *driver)
Definition: EmbAJAX.h:77
Abstract base class for output drivers/server implementations.
Definition: EmbAJAX.h:147
Output driver implementation. This implementation works with ESPAsyncWebServer (https://github....
Definition: EmbAJAXOutputDriverESPAsync.h:40
Output driver implementation. This implementation should work for most arduino web servers with minim...
Definition: EmbAJAXOutputDriverGeneric.h:38
EmbAJAXOutputDriverGeneric(EmbAJAXOutputDriverWebServerClass *server)
Definition: EmbAJAXOutputDriverGeneric.h:42
void installPage(EmbAJAXPageBase *page, const char *path, void(*change_callback)()=0) override
Definition: EmbAJAXOutputDriverGeneric.h:61
void loopHook() override
Definition: EmbAJAXOutputDriverGeneric.h:70
Absrract internal helper class.
Definition: EmbAJAX.h:709