You Are Here:

Community: Wiki

This page was last modified on 16 September 2009, at 13:45.

Cell ID with CTelephony

From Forum Nokia Wiki

Reviewer Approved   

CCellIDCheck implementation illustrates how to get Cell ID information using CTelephony. Note that this example is intended to be used only with S60 3rd Edition devices, and does not work with pre-3rd Edition devices.

To use this example first implement the callback interface function in the implementing class and then construct an instance of the CCellIDCheck. The callback function will be then called with the current Cell Id information. The aCountryCode argument variable will have the three digit country code of the network, and aNwId will have two digit network operator identification inside that country.

aAreaCode then indicates a area inside the operators network and the aCellId is unique cell identifier inside that operators area.

Headers required:

#include <Etel3rdParty.h>

Library required:

LIBRARY        etel3rdparty.lib

Capabilities required:

capability         ReadUserData  ReadDeviceData  Location

GetCellID.cpp

CCellIDCheck::~CCellIDCheck()
{
Cancel();
delete iTelephony;
}
 
void CCellIDCheck::ConstructL(void)
{
iTelephony = CTelephony::NewL();
iTelephony->GetCurrentNetworkInfo(iStatus, iIdV1Pkg);
SetActive();
}
 
CCellIDCheck::CCellIDCheck(MCellIdObserver& aObserver)
: CActive(EPriorityNormal),iObserver(aObserver),iIdV1Pkg(iIdV1)
{
CActiveScheduler::Add(this);
}
 
void CCellIDCheck::RunL()
{
iObserver.CellIDL(iIdV1.iCountryCode,iIdV1.iNetworkId,iIdV1.iLocationAreaCode,iIdV1.iCellId);
 
}
 
void CCellIDCheck::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel);
}

GetCellID.h

#include <Etel3rdParty.h>
 
 
class MCellIdObserver
{
public:
virtual void CellIDL(const TDesC& aCountryCode,const TDesC& aNwId,TUint aAreaCode,TUint aCellId) = 0;
};
 
 
class CCellIDCheck : public CActive
{
public:
CCellIDCheck(MCellIdObserver& aObserver);
void ConstructL(void);
~CCellIDCheck();
private:
void RunL();
void DoCancel();
private:
MCellIdObserver& iObserver;
CTelephony* iTelephony;
CTelephony::TNetworkInfoV1 iIdV1;
CTelephony::TNetworkInfoV1Pckg iIdV1Pkg;
};


Related Links

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fPortingE5fBlackBerryE5fapplicationsE5fandE5fservicesE5ftoE5fS60E5fplatformX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx5E2E0000X