ATT Hackathon wifi connect

Dependencies:   SocketModem mbed

Fork of MTS_Wifi_Connect_Example by Multi-Hackers

Revision:
8:fa93a2d07116
Parent:
6:7c2bdcf9d302
Child:
11:07858ad69f4e
--- a/main.cpp	Sat Jan 04 21:12:06 2014 +0000
+++ b/main.cpp	Sat Jan 04 21:37:02 2014 +0000
@@ -33,7 +33,11 @@
     //Setup and check connection
     printf("Set Network: %s\n\r", getCodeNames(wifi->setNetwork(ssid, securityType, securityKey)).c_str());
     printf("Set DHCP: %s\n\r", getCodeNames(wifi->setDeviceIP("DHCP")).c_str());
-    printf("Connect: %s\n\r", wifi->connect() ? "Success" : "Failure");
+    while (! wifi->connect()) {
+        printf("Connect: Failure\r\n");
+        wait(1);
+    }
+    printf("Connect: Success\r\n");
     printf("Is Connected: %s\n\r", wifi->isConnected() ? "True" : "False");
     
     //Ping