Simple detection for LE910-NA1 modules

Fork of MTS-Cellular by MultiTech

Revision:
55:85c04afa939a
Parent:
52:2cb58398a4f9
Child:
56:43205bd2752a
--- a/Cellular/Cellular.cpp	Mon Aug 11 19:54:54 2014 +0000
+++ b/Cellular/Cellular.cpp	Mon Aug 11 21:01:50 2014 +0000
@@ -251,11 +251,10 @@
 {
     string csmp;
     
-    if (type == MTSMC_H5_IP || type == MTSMC_H5) {
+    if (type == MTSMC_H5_IP || type == MTSMC_H5 || type == MTSMC_G3) {
         csmp = "AT+CSMP=17,167,0,0";
     } else if (type == MTSMC_EV3_IP || type == MTSMC_EV3 || type == MTSMC_C2_IP || type == MTSMC_C2) {
         csmp = "AT+CSMP=,4098,0,2";
-    } else if (type == MTSMC_G3) {
     } else {
         logError("unknown radio type [%d]", type);
         return MTS_FAILURE;
@@ -290,17 +289,12 @@
     }
     wait(.2);
     
-    for (int i = 0; i < 5; i++) {
-        string  response2 = sendCommand(message, 4000, CTRL_Z);
-        if (response2.find("+CMGS:") != string::npos) {
-            break;
-        }
-        if (i >= 5) {
-            logError("CMGS message failed");
-            return MTS_FAILURE;
-        }
-        wait(1);
+    string  response2 = sendCommand(message, 12000, CTRL_Z);
+    if (response2.find("+CMGS:") == string::npos) {
+        logError("CMGS message failed");
+        return MTS_FAILURE;
     }
+        
     return MTS_SUCCESS;
 }