forked from Dynatrace/ufo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyRequestHandler.h
43 lines (32 loc) · 1.48 KB
/
MyRequestHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <ESP8266WebServer.h>
#include <FS.h>
class IPDisplay;
class DisplayCharter;
class Adafruit_DotStar;
class Config;
class MyFunctionRequestHandler : public RequestHandler {
public:
MyFunctionRequestHandler(DisplayCharter* pDisplayLowerRing, DisplayCharter* pDisplayUpperRing, IPDisplay* pIpDisplay, Adafruit_DotStar* pLedstripLogo, Config* pConfig, bool debug);
bool canHandle(HTTPMethod requestMethod, String requestUri) override { return true; }
bool canUpload(String requestUri) override { return true; }
bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, String requestUri) override;
void upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload) override;
private:
bool handleStatic(ESP8266WebServer& server, String& actualUrl, const __FlashStringHelper* url, const __FlashStringHelper* staticFile, const __FlashStringHelper* contentType, bool mayCache);
void httpReboot(ESP8266WebServer& server, String message);
String parseFileName(String& path);
void infoHandler(ESP8266WebServer& server);
void dtIntegrationHandler(ESP8266WebServer& server);
void apiHandler(ESP8266WebServer& server);
void dynatracePostHandler(ESP8266WebServer& server);
private:
DisplayCharter* mpDisplayLowerRing;
DisplayCharter* mpDisplayUpperRing;
IPDisplay* mpIpDisplay;
Adafruit_DotStar* mpLedstripLogo;
Config* mpConfig;
bool mDebug;
int miUploadSize;
File mUploadFile;
bool mbRebootRequired;
};