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:
25:4045d02e44f1
Parent:
24:0e287a85ac9e
Child:
26:07be5faf8925
--- a/MDM.h	Tue Apr 08 11:15:33 2014 +0000
+++ b/MDM.h	Tue Apr 08 11:59:28 2014 +0000
@@ -42,6 +42,9 @@
     #define SOCKET_ERROR -1
     #define SOCKET_OK     0 
     typedef uint32_t IP;
+    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;
     
     MDMParser(void);
     
@@ -54,7 +57,7 @@
 
     // network
     bool init(const char* pin = NULL);
-    bool checkNetStatus(void);
+    bool checkNetStatus(Status* info = NULL);
     bool powerOff(void);
     // internet connection
     bool join(const char* apn, const char* user = NULL, const char* password = NULL);
@@ -84,7 +87,6 @@
     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 { NET_UNKNOWN, NET_DENIED, NET_NONE, NET_HOME, NET_ROAMING } Net; 
     typedef enum { SIM_UNKNOWN, SIM_PIN, SIM_READY } Sim; 
     static int _cbATI(int type, const char* buf, int len, Model* model);
     static int _cbUDNSRN(int type, const char* buf, int len, IP* ip);
@@ -100,7 +102,9 @@
     Model _model;
     Sim _sim;
     Net _net;
+    AcT _act;
     char _num[32];
+    char _opr[32];
     int _rssi;
 private:
     typedef enum { SOCK_FREE, SOCK_CREATED, SOCK_CONNECTED } SockState;