Clinton Lee Taylor / Mbed 2 deprecated WiFiLamp

Dependencies:   ESP8266_WebServer mbed

Fork of WiFiLamp by Sebastian Schocke

Revision:
9:319aeb6e0123
Parent:
7:f15c81074400
Child:
11:3ab606a42227
--- a/ESP8266_WebServer/ESP8266_WebServer.h	Fri Dec 19 09:08:56 2014 +0000
+++ b/ESP8266_WebServer/ESP8266_WebServer.h	Sat Dec 27 05:56:47 2014 +0000
@@ -1,17 +1,29 @@
 #include "mbed.h"
 #include <string>
+#include <map>
 
 #ifndef _ESP8266_WEB_SERVER_H
 #define _ESP8266_WEB_SERVER_H
 
+class ESP8266_WebRequest
+{
+    char httpMethod[64];
+    char httpURI[512];
+    
+    public:
+        ESP8266_WebRequest(int linkID, const char* packet, Serial* debugSerial);
+        int LinkID;
+        std::string Method;
+        std::string URI;
+        std::map<std::string, std::string> Parameters;
+};
+
 class ESP8266_WebServer
 {
     Serial *serial;
     char buffer[1024];
     char reply[1024];
     char response[2048];
-    char httpMethod[64];
-    char httpURI[512];
     char* rxptr;
     
     private:
@@ -19,16 +31,14 @@
         short string_waiting(const char*);
         void readBuffer(void);
         void sendResponse(int linkID);
+        
     public:
-        int LinkID;
-        std::string Method;
-        std::string URI;
         Serial *debugSerial;
         
         ESP8266_WebServer(Serial *espUART);
         void rxint(void);
         void Initialize(void);
-        bool GetRequest(void);
+        ESP8266_WebRequest* GetRequest(void);
         void SendHTMLReply(int linkID, std::string reply);
         void Send404Reply(int linkID);
 };