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:
68:33a96cf64986
Parent:
66:69072b3c5bca
Child:
69:4d6fa520dfca
--- a/MDM.cpp	Tue May 13 16:03:40 2014 +0000
+++ b/MDM.cpp	Tue May 13 16:25:56 2014 +0000
@@ -770,31 +770,43 @@
 int MDMParser::socketSend(int socket, const char * buf, int len)
 {
     TRACE("socketSend(%d,,%d)\r\n", socket,len);
-    if(len > 0) {
-        sendFormated("AT+USOWR=%d,%d\r\n",socket,len);
+    int cnt = len;
+    while (cnt > 0) {
+        int blk = MAX_SIZE;
+        if (cnt < blk) 
+            blk = cnt;
+        sendFormated("AT+USOWR=%d,%d\r\n",socket,blk);
         if (RESP_PROMPT != waitFinalResp())
             return SOCKET_ERROR;
         WAIT_MS(50);
-        send(buf, len);
+        send(buf, blk);
         if (RESP_OK != waitFinalResp()) 
             return SOCKET_ERROR;
+        buf += blk;
+        cnt -= blk;
     }
-    return len;
+    return (len - cnt);
 }
 
 int MDMParser::socketSendTo(int socket, IP ip, int port, const char * buf, int len)
 {
     TRACE("socketSendTo(%d," IPSTR ",%d,,%d)\r\n", socket, IPNUM(ip),port,len);
-    if(len > 0) {
-        sendFormated("AT+USOST=%d,\"" IPSTR "\",%d,%d\r\n",socket,IPNUM(ip),port,len);
+    int cnt = len;
+    while (cnt > 0) {
+        int blk = MAX_SIZE;
+        if (cnt < blk) 
+            blk = cnt;
+       sendFormated("AT+USOST=%d,\"" IPSTR "\",%d,%d\r\n",socket,IPNUM(ip),port,blk);
         if (RESP_PROMPT != waitFinalResp())
             return SOCKET_ERROR;
         WAIT_MS(50);
-        send(buf, len);
+        send(buf, blk);
         if (RESP_OK != waitFinalResp())
             return SOCKET_ERROR;
+        buf += blk;
+        cnt -= blk;
     }
-    return len;
+    return (len - cnt);
 }
 
 int MDMParser::socketReadable(int socket)