C027_SupportTest_xively_locationで使用しているC027用ライブラリ

Fork of C027_Support by u-blox

下記のプログラムC027_SupportTest_xively_locationで使用しているC027用ライブラリです。

Import programC027_SupportTest_xively_location

インターフェース2014年10月号のu-blox C027で3G通信する記事で使用したプログラム。   CQ publishing Interface 2014.10 issue, C027 3G test program.

オリジナルのライブラリは下記を参照してください。

Import libraryC027_Support

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.

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))