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:
104:c64ba749a422
Parent:
103:197fa7920ad8
Child:
105:f6bb2a20de70
--- a/MDM.cpp	Thu Jul 03 21:00:22 2014 +0000
+++ b/MDM.cpp	Fri Jul 04 05:20:57 2014 +0000
@@ -8,9 +8,9 @@
 #define PROFILE         "0"   //!< this is the psd profile used
 #define MAX_SIZE        128   //!< max expected messages
 // num sockets
-#define MAXSOCKET     (sizeof(_sockets)/sizeof(*_sockets))
-//! test if it is a socket
-#define ISSOCKET(s)     (((s) >= 0) && ((s) < MAXSOCKET) && (_sockets[s].handle != SOCKET_ERROR))
+#define NUMSOCKETS      (sizeof(_sockets)/sizeof(*_sockets))
+//! test if it is a socket is ok to use
+#define ISSOCKET(s)     (((s) >= 0) && ((s) < NUMSOCKETS) && (_sockets[s].handle != SOCKET_ERROR))
 //! check for timeout
 #define TIMEOUT(t, ms)  ((ms != TIMEOUT_BLOCKING) && (ms < t.read_ms())) 
 //! registration ok check helper
@@ -88,7 +88,7 @@
     _ip        = NOIP;
     _init      = false;
     memset(_sockets, 0, sizeof(_sockets));
-    for (int socket = 0; socket < MAXSOCKET; socket ++)
+    for (int socket = 0; socket < NUMSOCKETS; socket ++)
         _sockets[socket].handle = SOCKET_ERROR;
 #ifdef MDM_DEBUG
     _debugLevel = 1;
@@ -1188,7 +1188,7 @@
 }
 
 int MDMParser::_findSocket(int handle) {
-    for (int socket = 0; socket < MAXSOCKET; socket ++) {
+    for (int socket = 0; socket < NUMSOCKETS; socket ++) {
         if (_sockets[socket].handle == handle)
             return socket;
     }