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:
101:edfeb8af206e
Parent:
98:c786461edd40
Child:
103:197fa7920ad8
--- a/MDM.h	Tue Jul 01 05:46:06 2014 +0000
+++ b/MDM.h	Tue Jul 01 06:41:26 2014 +0000
@@ -409,6 +409,10 @@
     */ 
     virtual int getLine(char* buf, int len) = 0; 
     
+    /* clear the pending input data
+    */
+    virtual void purge(void) = 0;
+    
     /** Write data to the device 
         \param buf the buffer to write
         \param buf size of the buffer to write
@@ -596,6 +600,13 @@
                 NOT_FOUND if nothing was found
     */ 
     virtual int getLine(char* buffer, int length);
+    
+    /* clear the pending input data */
+    virtual void purge(void) 
+    { 
+        while (readable())
+            getc();
+    }
 protected:
     /** Write bytes to the physical interface.
         \param buf the buffer to write
@@ -617,6 +628,7 @@
     //! Destructor          
     virtual ~MDMUsb(void);
     virtual int getLine(char* buffer, int length);
+    virtual void purge(void) { }
 protected:
     virtual int _send(const void* buf, int len);
 };