Add a bunch of APNs

Fork of C027_Support by Xinlei Cao

Committer:
mazgch
Date:
Fri Jun 06 09:00:03 2014 +0000
Revision:
87:64f54572ea74
Parent:
85:dd8f4f0d0ca9
Child:
88:135fb4bb7aac
added orange post-paid apn

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mazgch 85:dd8f4f0d0ca9 1 #pragma once
mazgch 85:dd8f4f0d0ca9 2
mazgch 85:dd8f4f0d0ca9 3 /* ----------------------------------------------------------------
mazgch 85:dd8f4f0d0ca9 4 APN stands for Access Point Name, a setting on your modem or phone
mazgch 85:dd8f4f0d0ca9 5 that identifies an external network your phone can access for data
mazgch 85:dd8f4f0d0ca9 6 (e.g., 3G or 4G Internet service on your phone).
mazgch 85:dd8f4f0d0ca9 7
mazgch 85:dd8f4f0d0ca9 8 The APN settings can be forced when calling the join function.
mazgch 85:dd8f4f0d0ca9 9 Below is a list of known APNs that us used if no apn config
mazgch 85:dd8f4f0d0ca9 10 is forced. This list could be extended by other settings.
mazgch 85:dd8f4f0d0ca9 11
mazgch 85:dd8f4f0d0ca9 12 For further reading:
mazgch 85:dd8f4f0d0ca9 13 wiki apn: http://en.wikipedia.org/wiki/Access_Point_Name
mazgch 85:dd8f4f0d0ca9 14 wiki mcc/mnc: http://en.wikipedia.org/wiki/Mobile_country_code
mazgch 85:dd8f4f0d0ca9 15 google: https://www.google.de/search?q=APN+list
mazgch 85:dd8f4f0d0ca9 16 ---------------------------------------------------------------- */
mazgch 85:dd8f4f0d0ca9 17
mazgch 85:dd8f4f0d0ca9 18 //! helper to generate the APN string
mazgch 85:dd8f4f0d0ca9 19 #define _APN(apn,username,password) apn "\0" username "\0" password "\0"
mazgch 85:dd8f4f0d0ca9 20
mazgch 85:dd8f4f0d0ca9 21 //! helper to extract a field from the config string
mazgch 85:dd8f4f0d0ca9 22 #define _APN_GET(cfg) \
mazgch 85:dd8f4f0d0ca9 23 *cfg ? cfg : ""; \
mazgch 85:dd8f4f0d0ca9 24 cfg += strlen(cfg) + 1
mazgch 85:dd8f4f0d0ca9 25
mazgch 85:dd8f4f0d0ca9 26 //! APN lookup struct
mazgch 85:dd8f4f0d0ca9 27 typedef struct {
mazgch 85:dd8f4f0d0ca9 28 const char* mccmnc; //!< mobile country code (MCC) and mobile network code MNC
mazgch 85:dd8f4f0d0ca9 29 const char* cfg; //!< APN configuartion string, use _APN macro to generate
mazgch 85:dd8f4f0d0ca9 30 } APN_t;
mazgch 85:dd8f4f0d0ca9 31
mazgch 85:dd8f4f0d0ca9 32 //! default APN settings used by many networks
mazgch 85:dd8f4f0d0ca9 33 static const char* apndef = _APN("internet",,);
mazgch 85:dd8f4f0d0ca9 34
mazgch 85:dd8f4f0d0ca9 35 //! this is a list of special APNs for different network operators
mazgch 85:dd8f4f0d0ca9 36 static const APN_t apnlut[] = {
mazgch 85:dd8f4f0d0ca9 37
mazgch 85:dd8f4f0d0ca9 38 // Germany
mazgch 85:dd8f4f0d0ca9 39 { /*T-Mobile*/ "26201", _APN("internet.t-mobile","t-mobile","tm") },
mazgch 85:dd8f4f0d0ca9 40
mazgch 85:dd8f4f0d0ca9 41 // Switzerland
mazgch 85:dd8f4f0d0ca9 42 { /*Swisscom*/ "22801", _APN("gprs.swisscom.ch",,) },
mazgch 87:64f54572ea74 43 { /*Orange*/ "22803", _APN("internet",,) /* post-paid */
mazgch 87:64f54572ea74 44 _APN("click",,) /* pre-paid */ },
mazgch 85:dd8f4f0d0ca9 45
mazgch 85:dd8f4f0d0ca9 46 // USA
mazgch 85:dd8f4f0d0ca9 47 { /*T-Mobile*/ "310026|310260|310490",
mazgch 85:dd8f4f0d0ca9 48 _APN("epc.tmobile.com",,)
mazgch 85:dd8f4f0d0ca9 49 _APN("fast.tmobile.com",,) /*LTE*/ },
mazgch 85:dd8f4f0d0ca9 50 { /*AT&T*/ "310030|310150|310170|310260|310410|310560|310680",
mazgch 85:dd8f4f0d0ca9 51 _APN("phone",,)
mazgch 85:dd8f4f0d0ca9 52 _APN("wap.cingular","WAP@CINGULARGPRS.COM","CINGULAR1")
mazgch 85:dd8f4f0d0ca9 53 _APN("isp.cingular","ISP@CINGULARGPRS.COM","CINGULAR1") },
mazgch 85:dd8f4f0d0ca9 54 // ...
mazgch 85:dd8f4f0d0ca9 55 };