Demo app to read data from temperature sensor connected to STM-F411RE and send values to AT&T M2X Data Service via MTS shield.

Dependencies:   M2XStreamClient SocketModem jsonlite mbed

Fork of STM32_MTS_Wifi_Connect_M2X by AT&T Developer Summit Hackathon 2016

Files at this revision

API Documentation at this revision

Comitter:
mfiore
Date:
Sat Jan 04 21:37:02 2014 +0000
Parent:
7:25269711fb2c
Child:
9:b8765986190f
Commit message:
put Wifi::Connect call in loop for robustness

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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