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:
18:e5697801df29
Parent:
17:296d94a006b4
Child:
19:2b5d097ca15d
--- a/SerialPipe.cpp	Fri Jan 31 09:49:51 2014 +0000
+++ b/SerialPipe.cpp	Fri Mar 14 13:07:48 2014 +0000
@@ -102,73 +102,3 @@
     }
 }
 
-// -----------------------------------------------------------------------
-
-int SerialPipeEx::getLine(char* buffer, int length)
-{
-    return getLine(buffer, length, &_pipeRx);
-}
-
-int SerialPipeEx::getLine(char* buffer, int length, Pipe<char>* pipe)
-{
-    int o = 0;
-    int i = 0;
-    int l = pipe->start();
-    while ((i < l) && (o < length))
-    {
-        int t = pipe->next();
-        i ++;
-        if (t == '\r')     // terminate commands with carriage return
-        {
-            pipe->done();
-            if (length > o)
-                buffer[o] = '\0';
-            return o;          // if enter send the zero char
-        }
-        else if (t == '\n')     // skip/filter new line 
-             /* skip */;
-        else if (t != '\b')     // normal char (no backspace)
-            buffer[o++] = t;
-        else if (o > 0)         // backspace
-            o --;               // remove it
-    }
-    o = 0;
-    if (length > 0)
-        buffer[0] = '\0';
-    return WAIT;
-}
-
-int SerialPipeEx::getResp(char* buffer, int length)
-{
-    return getResp(buffer, length, &_pipeRx);
-}
-
-int SerialPipeEx::getResp(char* buffer, int length, Pipe<char>* pipe)
-{
-    int o = 0;
-    int i = 0;
-    int l = pipe->start();
-    static const char erTxt[] = "ERROR\r\n";
-    static const char okTxt[] = "OK\r\n"; 
-    int er = 0;
-    int ok = 0;
-    while ((i < pipe->size()) && (o < length))
-    {
-        int t = pipe->next();
-        i ++;
-        buffer[o++] = t;
-        ok = (t == okTxt[ok]) ? ok + 1 : 0;
-        er = (t == erTxt[er]) ? er + 1 : 0;
-        if ((okTxt[ok] == '\0') || (erTxt[er] == '\0'))
-        {
-            pipe->done();
-            if (length > o)
-                buffer[o] = '\0';
-            return o;
-        }
-    }
-    o = 0;
-    if (length > 0)
-        buffer[0] = '\0';
-    return WAIT;
-}