Student project by David Berlin and Boris Dogadov made for the Embedded Systems Workshop course given in Tel-Aviv University on 2010 by Sivan Toledo. Visit the project website for more details: http://davidberlin.co.il/sadna/ .
Dependencies: EthernetNetIf NTPClient_NetServices mbed HTTPServer HTTPClient CyaSSL
Diff: HttpHandlerSetup.h
- Revision:
- 0:3e7d6f496a67
- Child:
- 1:b05231650f32
diff -r 000000000000 -r 3e7d6f496a67 HttpHandlerSetup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HttpHandlerSetup.h Sun Apr 17 21:30:10 2011 +0000 @@ -0,0 +1,32 @@ +#include "HTTPServer.h" + +#ifndef HTTP_HANDLER_SETUP +#define HTTP_HANDLER_SETUP + +bool ReadSettings(char* username, char* password); + +class HttpHandlerSetup : public HTTPRequestHandler +{ +public: + HttpHandlerSetup(const char* rootPath, const char* path, TCPSocket* pTcpSocket); + virtual ~HttpHandlerSetup(); + + static inline HTTPRequestHandler* inst(const char* rootPath, const char* path, TCPSocket* pTcpSocket) { return new HttpHandlerSetup(rootPath, path, pTcpSocket); } +protected: + + virtual void doGet(); + virtual void doPost(); + virtual void doHead(); + + virtual void onReadable(); //Data has been read + virtual void onWriteable(); //Data has been written & buf is free + virtual void onClose(); //Connection is closing + +private: + void doGetPageWelcome(); + void UpdateSettingsFile(); + + bool m_WasDataRead; +}; + +#endif \ No newline at end of file