Own fork of C027_Support

Dependents:   MbedSmartRestMain MbedSmartRestMain

Fork of C027_Support by u-blox

Revision:
88:135fb4bb7aac
Parent:
85:dd8f4f0d0ca9
Child:
90:3915192f6d7e
--- a/MDM.cpp	Fri Jun 06 09:00:03 2014 +0000
+++ b/MDM.cpp	Fri Jun 06 10:33:13 2014 +0000
@@ -529,13 +529,11 @@
     _net.ci = 0xFFFFFFFF;
     // check registration
     sendFormated("AT+CREG?\r\n");
-    if (RESP_OK != waitFinalResp())
-        return false;
+    waitFinalResp();     // don't fail as service could be not subscribed 
     if (_dev.dev != DEV_LISA_C200) {
         // check PSD registration
         sendFormated("AT+CGREG?\r\n");
-        if (RESP_OK != waitFinalResp())
-            return false;
+        waitFinalResp(); // don't fail as service could be not subscribed 
     }
     if (REG_OK(_net.csd) || REG_OK(_net.psd))
     {
@@ -700,23 +698,8 @@
             bool ok = false;
             // try to lookup the apn settings from our local database by mccmnc
             const char* config = NULL;
-            if (!apn && !username && !password) {
-                char mccmnc[8] = "";
-                config = apndef;
-                sendFormated("AT+UDOPN=0\r\n");
-                if ((RESP_OK == waitFinalResp(_cbUDOPN, mccmnc)) && *mccmnc) {
-                    TRACE("Lookup APN Settings for network \"%s\" from operator \"%s\"\r\n", 
-                            mccmnc, _net.opr);
-                    // many carriers use internet without username and password, os use this as default
-                    // now try to lookup the setting for our table
-                    for (int i = 0; i < sizeof(apnlut)/sizeof(*apnlut); i ++) {
-                        if (strstr(apnlut[i].mccmnc, mccmnc)) {
-                            config = apnlut[i].cfg;
-                            break;
-                        }
-                    }
-                }
-            }
+            if (!apn && !username && !password)
+                config = apnconfig(_dev.imsi);
             
             // Set up the dynamic IP address assignment.
             sendFormated("AT+UPSD=" PROFILE ",7,\"0.0.0.0\"\r\n");