* add C027_Support fork

Fork of C027_Support by u-blox

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] = { '$' };