Symbian :Retrieve Cell ID

王朝other·作者佚名  2006-01-09
宽屏版  字体: |||超大  

http://discussion.forum.nokia.com/forum/showthread.php?s=3e73d93debcfa9b7daf449e1eaff6696&threadid=47318&highlight=%2Aprofile%2A

hi this the minimal code that retrive the cell id it works on sdk 1.2 but i have problem on 2.1 sdk. on sdk 2.1 it build first time then it dont compile at all. I want it to work on 2.1 sdk.

i added header file <etelbgsm.h> and gsmbas.lib but i have still problem

RTelServer iTelServer;

RBasicGsmPhone iPhone;

_LIT(KTsyName, "phonetsy.tsy");

iTelServer.Connect();

// Load the profile of the phone

iTelServer.LoadPhoneModule( KTsyName );

// Get the phone name

RTelServer::TPhoneInfo phoneInfo;

iTelServer.GetPhoneInfo( 0, phoneInfo );

// Open the phone by name

iPhone.Open( iTelServer, phoneInfo.iName );

MBasicGsmPhoneNetwork::TCurrentNetworkInfo ni;

iPhone.GetCurrentNetworkInfo( ni );

TInt cellId = ni.iCellId;

iPhone.Close();

iTelServer.UnloadPhoneModule( KTsyName );

iTelServer.Close();

TBuf<200> text;

_LIT(message,"Cell Id : %d ");

text.Format(message,cellId);

CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;

informationNote->ExecuteLD(text);

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有