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:
91:9439ad14d7f0
Parent:
88:a54018a0c576
Child:
92:57d4838f9861
--- a/cellular/Cellular.cpp	Fri Dec 27 16:48:30 2013 +0000
+++ b/cellular/Cellular.cpp	Fri Dec 27 20:54:26 2013 +0000
@@ -776,16 +776,19 @@
     }
 
     int timer = 0;
+    int readTimeout = 100;
     size_t previous = 0;
     char tmp[256];
     tmp[255] = 0;
     bool started = !echoMode;
     bool done = false;
     do {
-        wait(.1);
-        timer = timer + 100;
+        wait(0.1);
+        timer += 100;
+        
         previous = result.size();
-        int size = io->read(tmp,255);    //1 less than allocated
+        //Make a non-blocking read call by passing timeout of zero
+        int size = io->read(tmp,255,0);    //1 less than allocated (timeout is instant)
         if(size > 0) {
             result.append(tmp, size);
         }