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:
28:4d9509e3b1cf
Parent:
26:07be5faf8925
Child:
29:53d346010624
--- a/MDM.h	Tue Apr 08 13:53:27 2014 +0000
+++ b/MDM.h	Tue Apr 08 14:11:03 2014 +0000
@@ -42,9 +42,13 @@
     #define SOCKET_ERROR -1
     #define SOCKET_OK     0 
     typedef uint32_t IP;
+    
+    typedef enum { MODEL_UNKNOWN, MODEL_SARA_G350, MODEL_LISA_U200, MODEL_LISA_C200 } Model; 
+    typedef enum { SIM_UNKNOWN, SIM_PIN, SIM_READY } Sim; 
+    typedef struct { Model model; Sim sim; const char* imsi; const char* imei; const char* ccid; } DevStatus;
     typedef enum { NET_UNKNOWN, NET_DENIED, NET_NONE, NET_HOME, NET_ROAMING } Net; 
     typedef enum { ACT_UNKNOWN, ACT_GSM, ACT_EDGE, ACT_UTRAN, ACT_CDMA } AcT; 
-    typedef struct { const char* num; const char* opr; int rssi; Net net; AcT act; } Status;
+    typedef struct { const char* num; const char* opr; int rssi; Net net; AcT act; } NetStatus;
     
     MDMParser(void);
     
@@ -65,11 +69,11 @@
         return waitFinalResp((_CALLBACKPTR)cb, (void*)param, timeout_ms);
     }
     // network
-    bool init(const char* pin = NULL);
-    bool checkNetStatus(Status* info = NULL);
+    bool init(const char* pin = NULL, DevStatus* status = NULL);
+    bool checkNetStatus(NetStatus* status = NULL);
     bool powerOff(void);
     // internet connection
-    bool join(const char* apn, const char* user = NULL, const char* password = NULL);
+    bool join(const char* apn = NULL, const char* user = NULL, const char* password = NULL);
     bool disconnect(void);
     bool gethostbyname(const char* host, IP* ip);
     // socket interface
@@ -95,8 +99,6 @@
     static int _parseFormated(Pipe<char>* pipe, int len, const char* fmt);
     virtual int _send(const void* buf, int len) = 0;
 private:
-    typedef enum { MODEL_UNKNOWN, MODEL_SARA_G350, MODEL_LISA_U200, MODEL_LISA_C200 } Model; 
-    typedef enum { SIM_UNKNOWN, SIM_PIN, SIM_READY } Sim; 
     static int _cbATI(int type, const char* buf, int len, Model* model);
     static int _cbCIMI(int type, const char* buf, int len, char* imsi);
     static int _cbUDNSRN(int type, const char* buf, int len, IP* ip);