Go to the documentation of this file.
15 #define DATA_PREF "%*"
16 #define DATA_POST "*%"
18 #define INDEX_FILE_NAME "INDEX~1.HTM"
19 #define OUT_OF_RANGE_ERR 4294967295UL
20 #define MAX_HTTP_RQ_LENGTH 160
21 #define HTTP_RQ_GET_START "GET "
22 #define HTTP_RQ_SETTINGS "/?settings="
23 #define HTTP_RQ_NOTIFICATION "/?notification="
24 #define HTTP_RQ_SEPARATOR ';'
40 byte mac[6] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
102 #ifdef EMAIL_NOTIFICATION
103 int processHTTPRequestNotification(
int startPos, String &httpRequest,
int numberOfValues);
void saveSettings()
Saves settings on the SD card.
String buff
buffer for parsing an HTTP request
int processHTTPRequest(String &httpRequest)
Processes an HTTP request.
std::vector< HTMLDataSource * > htmlDataSources
collection of classing providing data for the HTML content
LeaksController * leaksController
instance of LeaksController so it can be updated with each line read off the file
EthernetServer server
instance of EthernetServer listening on port 80
int setEthernet()
Sets up the ethernet shield.
void addHTMLSource(HTMLDataSource *source)
Adds another source of data for the HTML content.
void update() override
Updates the class.
bool online
flag if the server is up and running
int processHTTPRequestSettings(int startPos, String &httpRequest, int numberOfValues)
Processes an HTTP request for changing settings of the water leak detection algorithms.
WebServer & operator=(WebServer const &)
Assignment operator of the class.
WebServer(WebServer const &)
Copy constructor of the class.
static WebServer * getInstance()
Returns the instance of the class.
static WebServer * instance
the instance of the class
const String replaceHTMLWithData(String html) const
Inserts a piece of data into a line of the HTML content.
byte mac[6]
MAC address of the Ethernet shield.
WebServer()
Constructor of the class.
void setup(LeaksController *leaksController)
Sets the pointer to an instance of LeaksController.