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:
103:197fa7920ad8
Parent:
101:edfeb8af206e
Child:
115:d8d94b73c725
diff -r fb982ff9da82 -r 197fa7920ad8 MDM.h
--- a/MDM.h	Thu Jul 03 18:44:32 2014 +0000
+++ b/MDM.h	Thu Jul 03 21:00:22 2014 +0000
@@ -526,7 +526,7 @@
     static int _cbUPSND(int type, const char* buf, int len, int* act);
     static int _cbUPSND(int type, const char* buf, int len, IP* ip);
     static int _cbUDNSRN(int type, const char* buf, int len, IP* ip);
-    static int _cbUSOCR(int type, const char* buf, int len, int* socket);
+    static int _cbUSOCR(int type, const char* buf, int len, int* handle);
     static int _cbUSORD(int type, const char* buf, int len, char* out);
     typedef struct { char* buf; IP ip; int port; } USORFparam;
     static int _cbUSORF(int type, const char* buf, int len, USORFparam* param);
@@ -544,11 +544,11 @@
     NetStatus   _net; //!< collected network information 
     IP          _ip;  //!< assigned ip address
     // management struture for sockets
-    typedef enum { SOCK_FREE, SOCK_CREATED, SOCK_CONNECTED } SockState;
-    typedef struct { volatile SockState state; volatile int pending; int timeout_ms; } SockCtrl;
-    // LISA-C has 6 TCP and 6 UDP sockets starting at index 18
-    // LISA-U and SARA-G have 7 sockets starting at index 1
-    SockCtrl _sockets[32];
+    typedef struct { int handle; int timeout_ms; volatile bool connected; volatile int pending; } SockCtrl;
+    // LISA-C has 6 TCP and 6 UDP sockets 
+    // LISA-U and SARA-G have 7 sockets
+    SockCtrl _sockets[12];
+    int _findSocket(int handle = SOCKET_ERROR/* = CREATE*/);
     static MDMParser* inst;
     bool _init;
 #ifdef TARGET_UBLOX_C027