A simple web server that can be bound to either the EthernetInterface or the WiflyInterface.

Dependents:   Smart-WiFly-WebServer WattEye X10Svr SSDP_Server

Revision:
5:c9b27e718054
Parent:
4:f34642902056
Child:
7:99ad7a67f05e
--- a/SW_HTTPServer.cpp	Tue Jun 25 16:37:06 2013 +0000
+++ b/SW_HTTPServer.cpp	Tue Jun 25 18:07:43 2013 +0000
@@ -312,17 +312,16 @@
 }
 
 
-void HTTPServer::GetRemoteAddr(char * str, int strSize)
+bool HTTPServer::GetRemoteAddr(char * str, int strSize)
 {
     bool res = false;
     char *p;
 
     if (strSize < 16) {        // Can only guard it here w/o modifying Wifly class
         *str = '\0';
-        return;
+        return res;
     }
-    res = wifly->sendCommand("show z\r", "NO", str, strSize, 500);
-    wait(0.2);  // how long to wait is fragile, but need the rest of the chars to come in...
+    res = wifly->sendCommand("show z\r", NULL, str, strSize);
     if (res) {
         p = strchr(str, '\n');  // truncate after the octets.
         if (p) *p = '\0';
@@ -330,8 +329,10 @@
         if (p) *p = '\0';
         p = strchr(str, '<');   // or a <
         if (p) *p = '\0';
+        res = true;
     }
     wifly->exit();
+    return res;
 }