Add a bunch of APNs

Fork of C027_Support by Xinlei Cao

Revision:
37:cc3433329d66
Parent:
36:c4df7bcf9b6e
Child:
43:a89a7a505991
diff -r c4df7bcf9b6e -r cc3433329d66 MDM.cpp
--- a/MDM.cpp	Thu Apr 10 13:07:02 2014 +0000
+++ b/MDM.cpp	Thu Apr 10 13:44:54 2014 +0000
@@ -180,7 +180,7 @@
 
 int MDMParser::_cbString(int type, const char* buf, int len, char* str)
 {
-    if (str && (type == TYPE_TEXT)) {
+    if (str && (type == TYPE_UNKNOWN)) {
         if (sscanf(buf, "\r\n%s\r\n", str) == 1)
             /*nothing*/;
     }
@@ -189,7 +189,7 @@
 
 int MDMParser::_cbInt(int type, const char* buf, int len, int* val)
 {
-    if (val && (type == TYPE_TEXT)) {
+    if (val && (type == TYPE_UNKNOWN)) {
         if (sscanf(buf, "\r\n%d\r\n", val) == 1)
             /*nothing*/;
     }
@@ -332,7 +332,7 @@
 
 int MDMParser::_cbATI(int type, const char* buf, int len, Dev* dev)
 {
-    if ((type == TYPE_TEXT) && dev) {
+    if ((type == TYPE_UNKNOWN) && dev) {
         if (strstr(buf, "SARA-G350")) {
             *dev = DEV_SARA_G350;
             /*TRACE("Identified Device: SARA-G350 2G\\n")*/;
@@ -858,7 +858,7 @@
         if (type == TYPE_PLUS) {
             if (sscanf(buf, "\r\n+CMGR: \"%*[^\"]\",\"%[^\"]", param->num) == 1) {
             }
-        } else if ((type == TYPE_TEXT) && (buf[len-2] == '\r') && (buf[len-1] == '\n')) {
+        } else if ((type == TYPE_UNKNOWN) && (buf[len-2] == '\r') && (buf[len-1] == '\n')) {
             memcpy(param->buf, buf, len-2);
             param->buf[len-2] = '\0';
         }
@@ -993,7 +993,6 @@
             { "\r\n+",                  "\r\n",             TYPE_PLUS       },
             { "\r\n@",                  NULL,               TYPE_PROMPT     }, // Sockets
             { "\r\n>",                  NULL,               TYPE_PROMPT     }, // SMS
-            { "\r\n",                   "\r\n",             TYPE_TEXT       },
         };
         for (int i = 0; i < sizeof(lutF)/sizeof(*lutF); i ++) {
             pipe->set(unkn);