Add a bunch of APNs

Fork of C027_Support by Xinlei Cao

Revision:
73:2b32e0a21df2
Parent:
72:d1e943ad6558
Child:
74:208e3e32d263
--- a/MDM.cpp	Thu May 15 07:06:07 2014 +0000
+++ b/MDM.cpp	Thu May 15 08:25:45 2014 +0000
@@ -1035,64 +1035,67 @@
    
 // ----------------------------------------------------------------
  
-void MDMParser::dumpDevStatus(MDMParser::DevStatus* status) 
+void MDMParser::dumpDevStatus(MDMParser::DevStatus* status, 
+            _DPRINT dprint, void* param) 
 {
-    printf("Modem Device Status:\r\n");
+    dprint(param, "Modem Device Status:\r\n");
     const char* txtDev[] = { "Unknown", "SARA-G350", "LISA-U200", "LISA-C200" };
     if (status->dev < sizeof(txtDev)/sizeof(*txtDev) && (status->dev != MDMParser::DEV_UNKNOWN))
-        printf("  Device:       %s\r\n", txtDev[status->dev]);
+        dprint(param, "  Device:       %s\r\n", txtDev[status->dev]);
     const char* txtLpm[] = { "Disabled", "Enabled", "Active" };
     if (status->lpm < sizeof(txtLpm)/sizeof(*txtLpm))
-        printf("  Power Save:   %s\r\n", txtLpm[status->lpm]);
+        dprint(param, "  Power Save:   %s\r\n", txtLpm[status->lpm]);
     const char* txtSim[] = { "Unknown", "Pin", "Ready" };
     if (status->sim < sizeof(txtSim)/sizeof(*txtSim) && (status->sim != MDMParser::SIM_UNKNOWN))
-        printf("  SIM:          %s\r\n", txtSim[status->sim]);
+        dprint(param, "  SIM:          %s\r\n", txtSim[status->sim]);
     if (*status->ccid)  
-        printf("  CCID:         %s\r\n", status->ccid);
+        dprint(param, "  CCID:         %s\r\n", status->ccid);
     if (*status->imei) 
-        printf("  IMEI:         %s\r\n", status->imei);
+        dprint(param, "  IMEI:         %s\r\n", status->imei);
     if (*status->imsi)  
-        printf("  IMSI:         %s\r\n", status->imsi);
+        dprint(param, "  IMSI:         %s\r\n", status->imsi);
     if (*status->meid) 
-        printf("  MEID:         %s\r\n", status->meid); // LISA-C
+        dprint(param, "  MEID:         %s\r\n", status->meid); // LISA-C
     if (*status->manu) 
-        printf("  Manufacturer: %s\r\n", status->manu);
+        dprint(param, "  Manufacturer: %s\r\n", status->manu);
     if (*status->model)  
-        printf("  Model:        %s\r\n", status->model);
+        dprint(param, "  Model:        %s\r\n", status->model);
     if (*status->ver)  
-        printf("  Version:      %s\r\n", status->ver);
+        dprint(param, "  Version:      %s\r\n", status->ver);
 }
 
-void MDMParser::dumpNetStatus(MDMParser::NetStatus *status)
+void MDMParser::dumpNetStatus(MDMParser::NetStatus *status,
+            _DPRINT dprint, void* param)
 {
-    printf("Modem Network Status:\r\n");
+    dprint(param, "Modem Network Status:\r\n");
     const char* txtReg[] = { "Unknown", "Denied", "None", "Home", "Roaming" };
     if (status->reg < sizeof(txtReg)/sizeof(*txtReg) && (status->reg != MDMParser::REG_UNKNOWN))
-        printf("  Registration:       %s\r\n", txtReg[status->reg]);
+        dprint(param, "  Registration:       %s\r\n", txtReg[status->reg]);
     const char* txtGprs[] = { "Unknown", "Detached", "Attached" };
     if (status->gprs < sizeof(txtGprs)/sizeof(*txtGprs) && (status->gprs != MDMParser::GPRS_UNKNOWN))
-        printf("  Gprs:               %s\r\n", txtGprs[status->gprs]);
+        dprint(param, "  Gprs:               %s\r\n", txtGprs[status->gprs]);
     const char* txtAct[] = { "Unknown", "GSM", "Edge", "3G", "CDMA" };
     if (status->act < sizeof(txtAct)/sizeof(*txtAct) && (status->act != MDMParser::ACT_UNKNOWN))
-        printf("  Access Technology:  %s\r\n", txtAct[status->act]);
+        dprint(param, "  Access Technology:  %s\r\n", txtAct[status->act]);
     if (status->rssi) 
-        printf("  Signal Strength:    %d dBm\r\n", status->rssi);
+        dprint(param, "  Signal Strength:    %d dBm\r\n", status->rssi);
     if (status->ber) 
-        printf("  Bit Error Rate:     %d\r\n", status->ber);
+        dprint(param, "  Bit Error Rate:     %d\r\n", status->ber);
     if (*status->opr)  
-        printf("  Operator:           %s\r\n", status->opr);
+        dprint(param, "  Operator:           %s\r\n", status->opr);
     if (status->lac != 0xFFFF)  
-        printf("  Location Area Code: %04X\r\n", status->lac);
+        dprint(param, "  Location Area Code: %04X\r\n", status->lac);
     if (status->ci != 0xFFFFFFFF)  
-        printf("  Cell ID:            %08X\r\n", status->ci);
+        dprint(param, "  Cell ID:            %08X\r\n", status->ci);
     if (*status->num)  
-        printf("  Phone Number:       %s\r\n", status->num);
+        dprint(param, "  Phone Number:       %s\r\n", status->num);
 }
 
-void MDMParser::dumpIp(MDMParser::IP ip) 
+void MDMParser::dumpIp(MDMParser::IP ip,
+            _DPRINT dprint, void* param) 
 {
     if (ip != NOIP)
-        printf("Modem IP Address: " IPSTR "\r\n", IPNUM(ip));
+        dprint(param, "Modem IP Address: " IPSTR "\r\n", IPNUM(ip));
 }
     
 // ----------------------------------------------------------------