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:
21:c4d64830bf02
Parent:
19:2b5d097ca15d
Child:
24:0e287a85ac9e
--- a/GPS.cpp	Mon Mar 24 07:38:05 2014 +0000
+++ b/GPS.cpp	Tue Apr 08 09:15:37 2014 +0000
@@ -12,28 +12,31 @@
     while (len > 0)
     {
         // NMEA protocol
+        pipe->set(unkn);
         int nmea = _parseNmea(pipe,len);
         if ((nmea != NOT_FOUND) && (unkn > 0))  
-            return unkn;
+            return pipe->get(buf,unkn);
         if (nmea == WAIT && fr)                       
             return WAIT;
         if (nmea > 0)                           
             return NMEA | pipe->get(buf,nmea);
         // UBX protocol
+        
+        pipe->set(unkn);
         int ubx = _parseUbx(pipe,len);
         if ((ubx != NOT_FOUND) && (unkn > 0))   
-            return unkn;
+            return pipe->get(buf,unkn);
         if (ubx == WAIT && fr)                        
             return WAIT;
         if (ubx > 0)                            
             return UBX | pipe->get(buf,ubx);
+        
         // UNKNOWN
-        *buf++ = pipe->getc();
         unkn ++;
         len--;
     }
-    if (unkn != NOT_FOUND)                      
-        return unkn; 
+    if (unkn > 0)                      
+        return pipe->get(buf,unkn); 
     return WAIT;
 }
 
@@ -42,7 +45,6 @@
     int o = 0;
     int c = 0;
     char ch;
-    pipe->start();
     if (++o > len)                      return WAIT;
     if ('$' != pipe->next())            return NOT_FOUND;
     // this needs to be extended by crc checking 
@@ -70,7 +72,6 @@
 int GPSParser::_parseUbx(Pipe<char>* pipe, int l)
 {
     int o = 0;
-    pipe->start();
     if (++o > l)                return WAIT;
     if ('\xB5' != pipe->next()) return NOT_FOUND;   
     if (++o > l)                return WAIT;