sensor web server

Dependencies:   EthernetNetIf HTTPServer mbed

Committer:
nobuki
Date:
Sun Nov 18 11:24:12 2012 +0000
Revision:
0:803d8094260a
version1.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nobuki 0:803d8094260a 1 #ifndef SENSOR_HANDLER_H
nobuki 0:803d8094260a 2 #define SENSOR_HANDLER_H
nobuki 0:803d8094260a 3
nobuki 0:803d8094260a 4 #include <HTTPRequestHandler.h>
nobuki 0:803d8094260a 5
nobuki 0:803d8094260a 6 class SensorHandler : public HTTPRequestHandler
nobuki 0:803d8094260a 7 {
nobuki 0:803d8094260a 8 public:
nobuki 0:803d8094260a 9 SensorHandler(const char* rootPath, const char* path, TCPSocket* pTCPSocket);
nobuki 0:803d8094260a 10 virtual ~SensorHandler();
nobuki 0:803d8094260a 11
nobuki 0:803d8094260a 12 static inline HTTPRequestHandler* inst(const char* rootPath, const char* path, TCPSocket* pTCPSocket) { return new SensorHandler(rootPath, path, pTCPSocket); } //if we ever could do static virtual functions, this would be one
nobuki 0:803d8094260a 13
nobuki 0:803d8094260a 14 virtual void doGet();
nobuki 0:803d8094260a 15 virtual void doPost();
nobuki 0:803d8094260a 16 virtual void doHead();
nobuki 0:803d8094260a 17
nobuki 0:803d8094260a 18 virtual void onReadable(); //Data has been read
nobuki 0:803d8094260a 19 virtual void onWriteable(); //Data has been written & buf is free
nobuki 0:803d8094260a 20 virtual void onClose(); //Connection is closing
nobuki 0:803d8094260a 21
nobuki 0:803d8094260a 22 private:
nobuki 0:803d8094260a 23 void printString( const char* pszString );
nobuki 0:803d8094260a 24 };
nobuki 0:803d8094260a 25
nobuki 0:803d8094260a 26 #endif