support library for C027 helper functions for Buffer Pipes, Buffered Serial Port (rtos capable) and GPS parsing. It includes modem APIs for USSD, SMS and Sockets.

Dependents:   HTTPClient_Cellular_HelloWorld Cellular_HelloMQTT MbedSmartRestMain Car_Bon_car_module ... more

This library is intended to be used with u-blox products such as the C027 or a shield with u-blox cellular and GPS modules like the cellular and positioning shield from Embedded Artist.

For 2G/GSM and 3G/UMTS you need to:

  • have a SIM card and know its PIN number
  • need to know you network operators APN setting These setting should be passed to the connect or init and join functions. You can also extend the APN database in MDMAPN.h.

For CDMA products you need to make sure that you have provisioned and activated the modem with either Sprint or Verizon.

Revision:
50:d76aece8038f
Parent:
48:46ba168127d6
Child:
52:8071747a7cb3
--- a/MDM.cpp	Fri May 09 17:49:32 2014 +0000
+++ b/MDM.cpp	Fri May 09 19:35:18 2014 +0000
@@ -249,6 +249,16 @@
         sendFormated("AT+GSN\r\n");
         if (OK != waitFinalResp(_cbString, _dev.meid))
             return false;
+#if 0
+        // enable power saving
+        if (_dev.lpm != LPM_DISABLED) {
+             // enable power saving (requires flow control, cts at least)
+            sendFormated("AT+UPSV=1,1280\r\n");
+            if (OK != waitFinalResp())
+                return false;  
+            _dev.lpm = LPM_ACTIVE;
+        }
+#endif
     } else {
         if (_dev.dev == DEV_LISA_U200) {
             // enable the network identification feature 
@@ -302,11 +312,20 @@
         sendFormated("AT+CGSN\r\n");
         if (OK != waitFinalResp(_cbString, _dev.imei))
             return false;
+#if 0
         // Configure New message indication
-        //sendFormated("AT+CNMI=2,1,0,0,0\r\n");
-        //if (OK != waitFinalResp())
-        //    return false;
-            
+        sendFormated("AT+CNMI=2,1,0,0,0\r\n");
+        if (OK != waitFinalResp())
+            return false;
+#endif
+        // enable power saving
+        if (_dev.lpm != LPM_DISABLED) {
+             // enable power saving (requires flow control, cts at least)
+            sendFormated("AT+UPSV=1\r\n");
+            if (OK != waitFinalResp())
+                return false;  
+            _dev.lpm = LPM_ACTIVE;
+        }
     } 
     // Setup SMS in text mode 
     sendFormated("AT+CMGF=1\r\n");
@@ -320,14 +339,6 @@
     sendFormated("AT+CIMI\r\n");
     if (OK != waitFinalResp(_cbString, _dev.imsi))
         return false;
-    // enable power saving
-    if (_dev.lpm != LPM_DISABLED) {
-         // enable power saving (requires flow control, cts at least)
-        sendFormated("AT+UPSV=1\r\n");
-        if (OK != waitFinalResp())
-            return false;  
-        _dev.lpm = LPM_ACTIVE;
-    }
     if (status)
         memcpy(status, &_dev, sizeof(DevStatus));
     return true; 
@@ -483,7 +494,7 @@
     _ip = NOIP;
     if (_dev.dev == DEV_LISA_C200) {
         // TODO: is there something to do here?
-         
+
         //Get local IP address
         sendFormated("AT+CMIP?\r\n");
         if (OK != waitFinalResp(_cbCMIP, &_ip))