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:
44:9d12223b78ff
Parent:
38:e6cab4632d84
Child:
51:e7b81c31baec
--- a/MDM.h	Fri Apr 11 20:10:28 2014 +0000
+++ b/MDM.h	Thu Apr 17 20:41:30 2014 +0000
@@ -22,6 +22,8 @@
 public:
     //! Constructor 
     MDMParser();
+    //! get static instance
+    static MDMParser* getInstance() { return inst; };
     
     // ----------------------------------------------------------------
     // Types 
@@ -142,6 +144,19 @@
     */
     bool socketConnect(int socket, const char* host, int port);
         
+    /** make a socket connection
+        \param socket the socket handle
+        \return true if connected, false otherwise
+    */
+    bool socketIsConnected(int socket);
+     
+    /** Get the number of bytes pending for reading for this socket
+        \param socket the socket handle
+        \param timeout_ms -1 blocking, else non blocking timeout in ms
+        \return 0 if successful or SOCKET_ERROR on failure 
+    */
+    bool socketSetBlocking(int socket, unsigned int timeout_ms);
+    
     /** Write socket data 
         \param socket the socket handle
         \param buf the buffer to write
@@ -398,8 +413,9 @@
     IP          _ip;  //!< assigned ip address
     // management struture for sockets
     typedef enum { SOCK_FREE, SOCK_CREATED, SOCK_CONNECTED } SockState;
-    typedef struct { SockState state; int pending; } SockCtrl;
+    typedef struct { SockState state; int pending; unsigned int timeout_ms; } SockCtrl;
     SockCtrl _sockets[16];
+    static MDMParser* inst;
 };
 
 // -----------------------------------------------------------------------