Getting the Current Cell Id using Symbian S60

 What you need:
Series 60 SDK
Communicator 9200 SDK version 0.9 or higher
etel.h from Communicator 9200 SDK
etelbgsm.h from Communicator 9200 SDK

Instructions:
Copy etel.h and etelbgsm.h to the /Symbian/6.1/Series60/Epoc32/Include directory.

Link your app to gsmbas.lib and etel.lib.

Use this code:

RBasicGsmPhone phone;
RTelServer server;

User::LeaveIfError( server.Connect() );
// load a phone profile
_LIT(KGsmModuleName, "phonetsy.tsy");
User::LeaveIfError( server.LoadPhoneModule( KGsmModuleName ) );

// initialize the phone object
RTelServer::TPhoneInfo info;
User::LeaveIfError( server.GetPhoneInfo( 0, info ) );
User::LeaveIfError( phone.Open( server, info.iName ) );

MBasicGsmPhoneNetwork::TCurrentNetworkInfo netinfo;
User::LeaveIfError( phone.GetCurrentNetworkInfo( netinfo ) );

Now you should be able to access the fields of
MBasicGsmPhoneNetwork::TCurrentNetworkInfo
which are
.iCellId
.iLocationAreaCode
.iNetworkInfo.iShortName

Once you have grabbed the info use this code to clean up:

phone.Close();
server.UnloadPhoneModule( KGsmModuleName );

server.Close();

All the code should work for the 6600 as well. You have the option of
just compiling with the 1.2 SDK or copying the headers to the 2.0 SDK .

Explore the other functions and data available through these objects as well. The headers should provide you with enough information to figure out what they are. Not all of them are completely implemented. According to a Forum Nokia post you can get to the information by:

  • ManufacturerId, Serial No: GetPhoneInfo()
  • BER, battery status: GetX - async version
  • Signal Strength: SignalStrengthNotification()

Use the NotifyChangeOfCurrentNetwork, so that works as well.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值