Added HTTP API to C027_Support library.
Fork of C027_Support by
Revision 90:3915192f6d7e, committed 2014-06-06
- Comitter:
- mazgch
- Date:
- Fri Jun 06 15:01:03 2014 +0000
- Parent:
- 89:ea396f9f90a2
- Child:
- 91:5af303e25287
- Commit message:
- cleanup apn selection
Changed in this revision
MDM.cpp | Show annotated file Show diff for this revision Revisions of this file |
MDMAPN.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MDM.cpp Fri Jun 06 10:42:47 2014 +0000 +++ b/MDM.cpp Fri Jun 06 15:01:03 2014 +0000 @@ -431,10 +431,6 @@ sendFormated("AT+CGREG=2\r\n"); if (RESP_OK != waitFinalResp()) return false; - // set operator selection - sendFormated("AT+COPS=0,0\r\n"); - if (RESP_OK != waitFinalResp(NULL,NULL,180*1000)) - return false; } // enable the network registration unsolicited result code sendFormated("AT+CREG=%d\r\n", (_dev.dev == DEV_LISA_C200) ? 1 : 2); @@ -714,15 +710,21 @@ TRACE("Testing APN Settings(\"%s\",\"%s\",\"%s\")\r\n", apn, username, password); } // Set up the APN - sendFormated("AT+UPSD=" PROFILE ",1,\"%s\"\r\n", apn?apn:""); - if (RESP_OK != waitFinalResp()) - return NOIP; - sendFormated("AT+UPSD=" PROFILE ",2,\"%s\"\r\n", username?username:""); - if (RESP_OK != waitFinalResp()) - return NOIP; - sendFormated("AT+UPSD=" PROFILE ",3,\"%s\"\r\n", password?password:""); - if (RESP_OK != waitFinalResp()) - return NOIP; + if (apn && *apn) { + sendFormated("AT+UPSD=" PROFILE ",1,\"%s\"\r\n", apn); + if (RESP_OK != waitFinalResp()) + return NOIP; + } + if (username && *username) { + sendFormated("AT+UPSD=" PROFILE ",2,\"%s\"\r\n", username); + if (RESP_OK != waitFinalResp()) + return NOIP; + } + if (password && *password) { + sendFormated("AT+UPSD=" PROFILE ",3,\"%s\"\r\n", password); + if (RESP_OK != waitFinalResp()) + return NOIP; + } // try different Authentication Protocols // 0 = none // 1 = PAP (Password Authentication Protocol)
--- a/MDMAPN.h Fri Jun 06 10:42:47 2014 +0000 +++ b/MDMAPN.h Fri Jun 06 15:01:03 2014 +0000 @@ -34,7 +34,9 @@ /*! this is a list of special APNs for different network operators There is no need to enter the default apn internet in the table; - apndef will be used if no entry matches. + apndef will be used if no entry matches. + + The APN without username/password have to be listed first. */ static const APN_t apnlut[] = { // MCC Country @@ -50,6 +52,18 @@ { /* Vodafone */ "222-10", _APN("web.omnitel.it",,) }, { /* Wind */ "222-88", _APN("internet.wind.biz",,) }, +// 440 Japan - JP + { /* Softbank */ "440-04,06,20,40,41,42,43,44,45,46,47,48,90,91,92,93,94,95" + ",96,97,98" + _APN("open.softbank.ne.jp","opensoftbank","ebMNuX1FIHg9d3DA") + _APN("smile.world","dna1trop","so2t3k3m2a") }, + { /* NTTDoCoMo */"440-09,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27," + "28,29,30,31,32,33,34,35,36,37,38,39,58,59,60,61,62,63," + "64,65,66,67,68,69,87,99", + _APN("bmobilewap",,) /*BMobile*/ + _APN("mpr2.bizho.net","Mopera U",) /* DoCoMo */ + _APN("bmobile.ne.jp","bmobile@wifi2","bmobile") /*BMobile*/ }, + // 293 Slovenia - SI { /* Si.mobil */ "293-40", _APN("internet.simobil.si",,) }, { /* Tusmobil */ "293-70", _APN("internet.tusmobil.si",,) }, @@ -72,7 +86,7 @@ _APN("epc.tmobile.com",,) _APN("fast.tmobile.com",,) /* LTE */ }, { /* AT&T */ "310-030,150,170,260,410,560,680", - _APN("phone",,) + _APN("phone",,) _APN("wap.cingular","WAP@CINGULARGPRS.COM","CINGULAR1") _APN("isp.cingular","ISP@CINGULARGPRS.COM","CINGULAR1") }, };