Dirk-Willem van Gulik (NXP/mbed) / Mbed 2 deprecated AmpereMeter

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RestMeterHandler.h Source File

RestMeterHandler.h

00001 #ifndef _RESTMETERHANDLER
00002 #define _RESTMETERHANDLER
00003 
00004 #include "HTTPRequestHandler.h"
00005 #include "Servo.h"
00006 
00007 class RestMeterHandler : public HTTPRequestHandler
00008 {
00009 public:
00010   RestMeterHandler(const char* rootPath, const char* path, TCPSocket* pTCPSocket);
00011   virtual ~RestMeterHandler();
00012 
00013   static void attach(const char *(*)(const char *));
00014   
00015 //protected:
00016   static inline HTTPRequestHandler* inst(const char* rootPath, const char* path, TCPSocket* pTCPSocket) { 
00017     return new RestMeterHandler(rootPath, path, pTCPSocket); 
00018   } 
00019   
00020   virtual void doGet();
00021   virtual void doPost();
00022   virtual void doHead();
00023   
00024   virtual void onReadable(); //Data has been read
00025   virtual void onWriteable(); //Data has been written & buf is free
00026   virtual void onClose(); //Connection is closing
00027   
00028 private:
00029    static const char *(*callback)(const char *);
00030   
00031 };
00032 #endif