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:
31:a0bed6c1e05d
Parent:
24:0e287a85ac9e
Child:
45:ebc2fd8dcf21
--- a/GPS.cpp	Tue Apr 08 15:49:04 2014 +0000
+++ b/GPS.cpp	Wed Apr 09 11:48:04 2014 +0000
@@ -15,7 +15,7 @@
         pipe->set(unkn);
         int nmea = _parseNmea(pipe,len);
         if ((nmea != NOT_FOUND) && (unkn > 0))  
-            return pipe->get(buf,unkn);
+            return UNKNOWN | pipe->get(buf,unkn);
         if (nmea == WAIT && fr)                       
             return WAIT;
         if (nmea > 0)                           
@@ -25,7 +25,7 @@
         pipe->set(unkn);
         int ubx = _parseUbx(pipe,len);
         if ((ubx != NOT_FOUND) && (unkn > 0))   
-            return pipe->get(buf,unkn);
+            return UNKNOWN | pipe->get(buf,unkn);
         if (ubx == WAIT && fr)                        
             return WAIT;
         if (ubx > 0)                            
@@ -36,7 +36,7 @@
         len--;
     }
     if (unkn > 0)                      
-        return pipe->get(buf,unkn); 
+        return UNKNOWN | pipe->get(buf,unkn); 
     return WAIT;
 }
 
@@ -104,6 +104,13 @@
     return _send(buf, len);
 }
 
+void GPSParser::powerOff(void)
+{
+    // set the gps into backup mode using the command RMX-LPREQ
+    struct { unsigned long dur; unsigned long flags; } msg = {0/*endless*/,0/*backup*/};
+    sendUbx(0x02, 0x41, &msg, sizeof(msg));
+}
+
 int GPSParser::sendNmea(const char* buf, int len)
 {
     char head[1] = { '$' };