Peter Ferland / MTS-Cellular_lat1

Fork of MTS-Cellular by MultiTech

Revision:
52:2cb58398a4f9
Parent:
48:3f9d82915e83
Child:
56:43205bd2752a
--- a/Test/TestSMS.h	Tue Aug 05 18:35:22 2014 +0000
+++ b/Test/TestSMS.h	Mon Aug 11 16:03:19 2014 +0000
@@ -56,17 +56,8 @@
         }
     }
     
-    //For determining when the SIM card is ready
-    std::string result;
-    for (int i = 0; i < 25; i++) {
-        if (i >= 25) {
-            Test::assertTrue(false);
-        }
-        if(radio->sendBasicCommand("AT+CMGD=1,4", 1000) == MTS_SUCCESS) {
-            break;
-        }
-        wait(1);
-    }
+    //Wait until the SIM card is ready
+    while (radio->sendBasicCommand("AT+CMGD=1,4", 1000) != MTS_SUCCESS);
     
     Test::assertTrue(radio->deleteAllReceivedSms() == MTS_SUCCESS);
     Test::assertTrue(radio->getReceivedSms().size() == 0);
@@ -81,8 +72,8 @@
         }
         wait(1);
     }
-    //Response doesn't contain "My Number", and thus will always fail
-    //Code seems to not be the same for UIP versus EasyIP
+    
+    //Read phone number from radio
     if (response.find("+CNUM:") != string::npos) {
         parts = Text::split(response, ",");
         number = parts[1];