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:
35:9275215a3a5b
Parent:
34:3b3b7807c0c3
Child:
38:e6cab4632d84
diff -r 3b3b7807c0c3 -r 9275215a3a5b MDM.h
--- a/MDM.h	Wed Apr 09 14:25:41 2014 +0000
+++ b/MDM.h	Thu Apr 10 13:05:45 2014 +0000
@@ -19,15 +19,17 @@
 {
 public:
     //! Constructor 
-    MDMParser(void);
+    MDMParser();
     
     // ----------------------------------------------------------------
     // Types 
     // ----------------------------------------------------------------
     typedef enum { DEV_UNKNOWN, DEV_SARA_G350, DEV_LISA_U200, DEV_LISA_C200 } Dev; //!< MT Device Types 
     typedef enum { SIM_UNKNOWN, SIM_PIN, SIM_READY } Sim; //!< SIM Status
+    typedef enum { LPM_DISABLED, LPM_ENABLED, LPM_ACTIVE, LPM_SLEEP } Lpm; //!< SIM Status
     typedef struct { 
         Dev dev;            //!< Device Type
+        Lpm lpm;            //!< Power Saving 
         Sim sim;            //!< SIM Card Status
         char ccid[20+1];    //!< Integrated Circuit Card ID
         char imsi[15+1];    //!< International Mobile Station Identity
@@ -255,6 +257,7 @@
     #define TYPE_NOANSWER   0x260000
     #define TYPE_PROMPT     0x300000
     #define TYPE_PLUS       0x400000
+    #define TYPE_TEXT       0x500000
     
     /** Get a line from the physical interface. This function need 
         to be implemented in a inherited class. Usually just calls 
@@ -351,7 +354,7 @@
     */   
     static int _parseFormated(Pipe<char>* pipe, int len, const char* fmt);
 
-private:
+protected:
     // parsing callbacks for different AT commands and their parameter arguments
     static int _cbString(int type, const char* buf, int len, char* str);
     static int _cbInt(int type, const char* buf, int len, int* val);
@@ -386,7 +389,7 @@
     // management struture for sockets
     typedef enum { SOCK_FREE, SOCK_CREATED, SOCK_CONNECTED } SockState;
     typedef struct { SockState state; int pending; } SockCtrl;
-    SockCtrl _sockets[16];    
+    SockCtrl _sockets[16];
 };
 
 // -----------------------------------------------------------------------
@@ -397,10 +400,10 @@
     MDMSerial(PinName tx    _C027DEFAULT(MDMTXD), 
               PinName rx    _C027DEFAULT(MDMRXD), 
               int baudrate  _C027DEFAULT(MDMBAUD),
-#if DEVICE_SERIAL_FC
+ #if DEVICE_SERIAL_FC
               PinName rts   _C027DEFAULT(MDMRTS), 
               PinName cts   _C027DEFAULT(MDMCTS),
-#endif
+ #endif
               int rxSize    = 256 , 
               int txSize    = 128 );
     virtual int getLine(char* buffer, int length);