C027 updated to work with latest mBed libraries

Dependents:   Cellular_HelloMQTT UBLOXModemDriver UBLOXMQTTDriver

Fork of C027_Support by u-blox

Revision:
71:041de9a6d93c
Parent:
70:0a87d256cd24
Child:
72:d1e943ad6558
--- a/MDM.cpp	Wed May 14 09:12:47 2014 +0000
+++ b/MDM.cpp	Thu May 15 06:16:10 2014 +0000
@@ -394,6 +394,10 @@
     sendFormated("AT+CIMI\r\n");
     if (RESP_OK != waitFinalResp(_cbString, _dev.imsi))
         return false;
+    // enable the network registration unsolicited result code
+    sendFormated("AT+CREG=%d\r\n", (_dev.dev == DEV_LISA_C200) ? 1 : 2);
+    if (RESP_OK != waitFinalResp())
+        return false;
     if (status)
         memcpy(status, &_dev, sizeof(DevStatus));
     return true; 
@@ -438,10 +442,6 @@
 
 bool MDMParser::checkNetStatus(NetStatus* status /*= NULL*/)
 {
-    // enable the network registration unsolicited result code
-    sendFormated("AT+CREG=%d\r\n", (_dev.dev == DEV_LISA_C200) ? 1 : 2);
-    if (RESP_OK != waitFinalResp())
-        return false;
     // check registration
     sendFormated("AT+CREG?\r\n");
     if (RESP_OK != waitFinalResp())