⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 network.cpp

📁 手机RILGSM实现的源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-1999  Microsoft Corporation

Module Name:

network.cpp

Abstract:


Notes:
Long operator names in the OPERATORNAMEMAP should not exceeed 16 characters in
length, otherwise visual clipping of the operator name string may occur in the
user interface.  The OPERATORNAMEMAP entries must be numerically ordered.

In this sample code, all PCS 1900-based networks have a single
entry listed for each operator even though there are 
three-digit MNCs sometimes used in the PCS spectrum.  For example, PLMN A is a PCS network and is 
frequently seen in various SIM EF_PLMNsel tables as "123 45", "123 045", or "123 450", depending
on what equipment last wrote to that table.  To cover each instance, we
search up to three times in the search code below.

--*/

/*------------------------------------------------------------------------------
       Revision History
       Date                   Author                    Activity ID                             Activity Headline
       2005-12-21        caohongsheng                CEDB00003946                      Display "46000" error
       2005-12-21        caohongsheng                CEDB00003948                      Can't display Chinese Char
       2006-02-20        wangzhengang                CEDB00006684                      The roaming state is  not normal
       2006-02-20        caohongsheng                CEDB00007150                      Display error operator when roaming to europe
       2006-03-23        liuhongjie                  CEDB00011160                      A CMCC sim card with MNC: 02, An Roaming Icon will be displayed
                                                                                       But in fact, it's not Roaming status.
       2006-04-06        Fuxiangbing                 CEDB00013082                      Add rc file   
       2006-04-27        wuguangliang                CEDB200000271                     Add a global varible to indicate the system is in unregisteration proccess
       2006-05-17        Fuxiangbing                 CEDB200000907                     modify perator name
       2006-06-12        zhangqun                    CEDB200002376                     Add a global varible to indicate all stack module is ready
       2006-06-16        Fuxiangbing                 CEDB200002792                     手机插入159a卡出现漫游图标
       2006-06-27        Fuxiangbing                 CEDB200003545                     使用159号段sim卡网络信号显示为满格但是无法呼出电话
       2006-07-31        Fuxiangbing                 CEDB200006623                     无线管理器:多次打开关闭电话功能后,电话功能无法再开启
       2007-03-27        Likai                       CEDB200049188	                   Upgrade codes to OMAP_PPC_RIL_Crossbow2 and Crossbow
       2007-09-27        Cuiguoqing                  WM600018341	                     Modify codes to resolve the network operator name wrong after manual network select.
       2007-10-24        Cuiguoqing                  WM600020863	                     Modify codes to draw roam icon on title bar correctly for two card on Cynthia850 ver2.05.
       2007-10-29        Cuiguoqing                  WM600021201                       create a registry for avoiding sending AT+COPS by app frequently.
       2007-11-05        Wangxiaogang                WM600021938                       Update Operaor Name List
       2007-11-20        Chenjianjun                    WM600023057                       There are "CMCC" settings when opening manual network
       2007-11-20        Chenjianjun                    WM600023073                       All of preferred network are "CMCC"
       2007-11-21        zhongchuren                     WM600023517                     Fix the issue with power On/Off
       2007-12-10        Cuiguoqing                     WM600025288                     Prevent to broadcast MS network register status after send AT+CREG? in order to draw roam icon by ourselves.
       2007-12-24        LiKai                            WM600026864                        add code for radio test
       2008-01-02         Cuiguoqing                    WM600027855                        modify for network icon.
       2008-01-16         Cuiguoqing                    WM600029394                        change registry about network operator.
       2008-01-23         Sunrenhong                    WM600029890                        if language is chinese,we should dislpay chinese for operator name
       2008-02-02         Cuiguoqing                     WM600030645                         Modify for display correctly operator name in Chinese version.    
------------------------------------------------------------------------------*/



#include "precomp.h"
//#include "../resource.h"


#define UNKNOWN_COUNTRY_CODE ("--")
#define MCC_LEN (3)
extern HINSTANCE g_hNetworkResDll ;     // instance handle of the network resource DLL

//Added by wuguangliang 2005/4/18
//Indicate that MS is manually unregister from network
BOOL g_bManualUnregister = FALSE;

//Added by zhangqun 2006/6/12
//Indicate the stack is ready for all module
BOOL g_bStackAllReady = FALSE;
DWORD g_dwCREGFlag=0;
BOOL g_bGetOperatorList = FALSE;
extern BOOL g_bRadioOff;
extern BOOL IsPrimaryCard(void);
//
// Long operator names
//
static const OPERATORNAMEMAP g_rgonmOperatorNames[] =
{
    { 20201,    "GR Cosmote",          "GR" },
    { 20205,    "Vodafone GR",      "GR" },
    { 20210,    "TIM GR",         "GR" },
    { 20404,    "Vodafone NL",      "NL" },
    { 20408,    "NL KPN",              "NL" },
    { 20412,    "NL Telfort",          "NL" },
    { 20416,    "T-Mobile NL",              "NL" },
    { 20420,    "Orange NL",        "NL" },
    { 20601,    "BEL PROXIMUS",         "BE" },
    { 20610,    "B mobistar",         "BE" },
    { 20620,    "BASE",           "BE" },
    { 20801,    "Orange F",           "FR" },
    { 20810,    "F SFR",           "FR" },
    { 20820,    "F-Bouygues Telecom",           "FR" },
    { 21210,    "Monaco",           "MO" },
    { 21303,    "STA-MOBILAND",         "AD" },
    { 21401,    "Vodafone ES",       "ES" },
    { 21403,    "Orange",            "ES" },
    { 21404,    "Yoigo",            "ES" },
    { 21407,    "MoviStar",         "ES" },
    { 21601,    "H pannon",       "HU" },
    { 21630,    "T-Mobile H",           "HU" },
    { 21670,    "vodafone HU",         "HU" },
    { 21803,    "BA-ERONET",           "BA" },
    { 21805,    "MOBI'S",   "BA" },
    { 21890,    "BH GSMBIH",          "BA" },
    { 21901,    "T-Mobile HR",           "HR" },
    { 21902,    "HR TELE2",           "HR" },
    { 21910,    "HR VIP",              "HR" },
    { 22001,    "Telenor SRB",           "YU" },
    { 22002,    "ProMonte",         "YU" },
    { 22003,    "YUG 03",   "YU" },
    { 22004,    "T-Mobile CG",            "YU" },
    { 22005,    "Vip SRB",            "YU" },    
    { 22201,    "I TIM",              "IT" },
    { 22210,    "vodafone IT",      "IT" },
    { 22288,    "I WIND",             "IT" },
    { 22299,    "3 ITA",          "IT" },
    { 22601,    "RO Vodafone RO",           "RO" },
    { 22603,    "RO COSMOTE",         "RO" },
    { 22610,    "RO ORANGE",           "RO" },
    { 22801,    "Swisscom",        "CH" },
    { 22802,    "sunrise",          "CH" },
    { 22803,    "Orange CH",           "CH" },
    { 22807,    "In&Phone",           "CH" },
    { 22808,    "Tele2 Switzerland",           "CH" },
    { 23001,    "T-Mobile CZ",           "CZ" },
    { 23002,    "EUROTEL-CZ",          "CZ" },
    { 23003,    "Vodafone CZ",            "CZ" },
    { 23101,    "Orange SK",          "SK" },
    { 23102,    "T-Mobile SK",          "SK" },
    { 23106,    "O2-SK",          "SK" },
    { 23201,    "A1",               "AT" },
    { 23203,    "T-Mobile A",         "AT" },
    { 23205,    "one",              "AT" },
    { 23210,    "3 AT",        "AT" },
    { 23212,    "one",        "AT" },    
    { 23401,    "PMN UK",          "GB" },
    { 23403,    "Airtel-Vodafone",          "GB" },
    { 23409,    "PMN UK",          "GB" },
    { 23410,    "O2-UK",          "GB" },
    { 23415,    "Vodafone UK",         "GB" },
    { 23416,    "Opal UK",         "GB" },
    { 23420,    "3 UK",         "GB" },
    { 23430,    "T-Mobile UK",      "GB" },
    { 23431,    "T-Mobile UK",      "GB" },
    { 23432,    "T-Mobile UK",      "GB" },
    { 23433,    "Orange",           "GB" },
    { 23450,    "JT-Wave",           "GB" },
    { 23455,    "C&W",     "GB" },
    { 23458,    "Manx Pronto",             "GB" },
    { 23801,    "TDC MOBIL",        "DK" },
    { 23802,    "DK SONOFON",          "DK" },
    { 23806,    "3 DK",          "DK" },
    { 23820,    "TELIA DK",            "DK" },
    { 24001,    "TELIA S",          "SE" },
    { 24002,    "3 SE",          "SE" },
    { 24004,    "SWEDEN",          "SE" },    
    { 24005,    "Sweden 3G",          "SE" },
    { 24008,    "Telenor SE",         "SE" },
    { 24010,    "S COMVIQ",         "SE" },
    { 24201,    "N Telenor",          "NO" },
    { 24202,    "N NetCom",           "NO" },
    { 24203,    "Teletopia 3",           "NO" },
    { 24205,    "Network Norway N",           "NO" },    
    { 24403,    "dna",            "FI" },
    { 24405,    "FI elisa",       "FI" },
    { 24412,    "dna",               "FI" },
    { 24414,    "FI AMT",              "FI" },
    { 24491,    "FI SONERA",           "FI" },
    { 24601,    "OMNITEL LT",          "LT" },
    { 24602,    "LT BITE GSM",         "LT" },
    { 24603,    "TELE2",            "LT" },
    { 24701,    "LV LMT",          "LV" },
    { 24702,    "LV TELE2",          "LV" },
    { 24705,    "BITE LV",          "LV" },
    { 24801,    "EE EMT",          "EE" },
    { 24802,    "EE elisa",              "EE" },
    { 24803,    "TELE2",            "EE" },
    { 25001,    "MTS-RUS",              "RU" },
    { 25002,    "MegaFon",              "RU" },
    { 25004,    "SIBCHALLENGE RUS",              "RU" },
    { 25005,    "ETK RUS",              "RU" },    
    { 25007,    "RUS SMARTS",           "RU" },
    { 25010,    "RUS DTC",              "RU" },
    { 25013,    "RUS Kuban-GSM",        "RU" },
    { 25016,    "RUS16",              "RU" },
    { 25017,    "Utel",        "RU" },
    { 25019,    "RUS INDIGO",        "RU" },
    { 25020,    "TELE2",        "RU" },
    { 25028,    "RUS Beeline",            "RU" },
    { 25035,    "MOTIV",        "RU" },   
    { 25092,    "Primetelefone RUS",          "RU" },
    { 25099,    "Beeline",         "RU" },
    { 25501,    "MTS UKR",              "UA" },
    { 25502,    "Beeline UA",          "UA" },
    { 25503,    "UA-KYIVSTAR",         "UA" },
    { 25505,    "UA-GT",   "UA" },
    { 25506,    "life:)",   "UA" },
    { 25701,    "BY VELCOM",           "BY" },
    { 25702,    "MTS BY",           "BY" },
    { 25704,    "BeST BY",           "BY" },
    { 25901,    "Orange MD",           "MD" },
    { 25902,    "MD MOLDCELL",         "MD" },
    { 25904,    "MDA EVENTIS",         "MD" },    
    { 26001,    "Plus",         "PL" },
    { 26002,    "Era",          "PL" },
    { 26003,    "Orange PL",             "PL" },
    { 26201,    "T-Mobile D",         "DE" },
    { 26202,    "Vodafone.de",      "DE" },
    { 26203,    "E-Plus",           "DE" },
    { 26207,    "O2 - DE",          "DE" },
    { 26208,    "O2 - DE",           "DE" },
    { 26601,    "GIBTEL GSM",           "GI" },
    { 26801,    "vodafone P",         "PT" },
    { 26803,    "P OPTIMUS",          "PT" },
    { 26806,    "P TMN",              "PT" },
    { 27001,    "L LUXGSM",           "LU" },
    { 27077,    "L TANGO",            "LU" },
    { 27099,    "L VOX.LU",            "LU" },
    { 27201,    "vodafone IE",     "IE" },
    { 27202,    "O2 - IRL",         "IE" },
    { 27203,    "IRL - METEOR",           "IE" },
    { 27205,    "3 IRL",           "IE" },   
    { 27401,    "Siminnl",           "IS" },
    { 27402,    "Og Vodafone",              "IS" },
    { 27403,    "Og Vodafone",              "IS" },
    { 27404,    "Viking",           "IS" },
    { 27407,    "IS-IceCell",           "IS" },
    { 27408,    "On-waves",           "IS" },
    { 27601,    "AMC - AL",              "AL" },
    { 27602,    "vodafone AL",         "AL" },
    { 27801,    "vodafone MT",   "MT" },
    { 27821,    "go mobile",        "MT" },
    { 28001,    "CYTAMOBILE-VODAFONE",          "CY" },
    { 28010,    "MTN",          "XX" },
    { 28201,    "GEO-GEOCELL",          "GE" },
    { 28202,    "MAGTI-GSM-GEO",        "GE" },
    { 28204,    "BEELINE GE",           "GE" },
    { 28301,    "Beeline AM",           "AM" },
    { 28305,    "RA 05",           "AM" },
    { 28401,    "M-Tel BG",        "BG" },
    { 28403,    "vivatel",        "BG" },    
    { 28405,    "BG GLOBUL",        "BG" },
    { 28601,    "TR TURKCELL",         "TR" },
    { 28602,    "VODAFONE TR",           "TR" },
    { 28603,    "AVEA",             "TR" },
    { 28801,    "F?roya Tele",           "FO" },
    { 28802,    "KALL",           "FO" },
    { 29001,    "TELE Greenland",   "GR" },
    { 29266,    "SMT",   "--" },    
    { 29340,    "SI vodafone",         "SI" },
    { 29341,    "MOBITEL",          "SI" },
    { 29364,    "T-2",          "SI" },
    { 29370,    "SI TUSMOBIL",          "SI" },
    { 29401,    "T-Mobile MK",          "MK" },
    { 29402,    "MKD COSMOFON",          "MK" },
    { 29501,    "SwisscomFL",          "LI" },
    { 29502,    "Orange FL",           "LI" },
    { 29505,    "FL1",              "LI" },
    { 29577,    "LI TANGO",         "LI" },
    { 30801,    "SPM AMERIS",      "XX" },
    { 30802,    "SPM-PROSODIE",      "XX" },    
    { 31026,    "T-Mobile",         "US" },
    { 31030,    "Centennial Communications",         "US" },
    { 31031,    "T-Mobile",         "US" },
    { 31032,    "IT&E",         "US" },    
    { 31040,    "USATX",    "US" },    
    { 31046,    "USA SIMMETRY",         "US" },
    { 31080,    "Corr Wireless",         "US" },
    { 31090,    "Edge Wireless",         "US" },
    { 31100,    "Wilkes USA",              "US" }, 
    { 31101,    "Wilkes USA",              "US" },
    { 31105,    "Wilkes USA",              "US" },
    { 33403,    "movistar",           "XX" },
    { 33420,    "Mx Telcel GSM",           "XX" },
    { 33805,    "DIGICEL",          "JM" },

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -