Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Smart-WiFly-WebServer WattEye X10Svr SSDP_Server
Diff: SW_HTTPServer.cpp
- 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;
}