Cellular library for MTS Socket Modem Arduino Shield devices from Multi-Tech Systems

Dependents:   mtsas mtsas mtsas mtsas

Revision:
41:8b9b5098696f
Parent:
30:1326b623919a
Child:
51:ffc556ba33f7
--- a/Cellular/CellularFactory.cpp	Tue Jul 29 19:39:01 2014 +0000
+++ b/Cellular/CellularFactory.cpp	Wed Jul 30 20:22:23 2014 +0000
@@ -25,10 +25,15 @@
     
     /* "ATI4" gets us the model (HE910, DE910, etc) */
     for (int i = 0; i < 5; i++) {
-        model = sendCommand(io, "ATI4", 2000);
+        model = sendCommand(io, "ATI4", 3000);
         if (model.find("error") == string::npos && model.find("ERROR") == string::npos && !model.empty()) {
             /* didn't get an error - keep going */
-            break;
+            if(model.find("#STN") != string::npos) {
+                //If response found is from unsolicited response #STN: from the radio,
+                //then we got a "corrupted" response, and to try again.
+                continue;
+            }
+                break;
         }
         
         wait(1);