A library for talking to Multi-Tech's Cellular SocketModem Devices.

Dependents:   M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more

Revision:
150:95093b517872
Parent:
141:571e0ef6c8dc
Child:
151:483208276759
--- a/wifi/Wifi.cpp	Mon Jan 20 15:33:54 2014 +0000
+++ b/wifi/Wifi.cpp	Thu Aug 28 20:16:59 2014 +0000
@@ -363,7 +363,9 @@
         return socketOpened;
     }
     std::string response = sendCommand("show connection", 2000, "\n");
-    int start = response.find("f");
+    // response to "show connection" always starts with 8
+    // http://ww1.microchip.com/downloads/en/DeviceDoc/rn-wiflycr-ug-v1.2r.pdf
+    int start = response.find("8");
     if(start != string::npos && response.size() >= (start + 3)) {
         if(response[start + 3] == '1') {
             socketOpened = true;