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:
13:e2446fcdc246
Child:
40:295099ff5338
diff -r 2b5d097ca15d -r c4d64830bf02 Pipe.h
--- a/Pipe.h	Mon Mar 24 07:38:05 2014 +0000
+++ b/Pipe.h	Tue Apr 08 09:15:37 2014 +0000
@@ -25,6 +25,17 @@
         if (_a) 
             delete [] _a;
     }
+    void dump(void)
+    {
+        int o = _r;
+        printf("pipe: %d/%d ", size(), _s);
+        while (o != _w) {
+            T t = _b[o]; 
+            printf("%0*X", sizeof(T)*2, t);
+            o = _inc(o); 
+        }
+        printf("\n");
+    }
     // writing thread
     bool writeable(void) // = not full
     {
@@ -128,10 +139,12 @@
     // the following functions are useful if you like to inspect or parse the buffer
     
     //! reset the parsing index and return the number of available elments 
-    virtual int start(void) 
+    virtual int set(int ix) 
     {
-        _o = _r; 
-        return size(); 
+        int sz = size();
+        ix = (ix > sz) ? sz : ix;
+        _o = _inc(_r, ix); 
+        return sz - ix;
     }
     //! get the next element and increment 
     virtual T next(void)