This page was last modified 04:18, 22 November 2007.
Network name with CTelephony
From Forum Nokia Wiki
The CNwNameCheck class illustrates how to read the current network's name using the CTelephony API. 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 implement the callback interface function in the implementing class and then construct an instance of the CNwNameCheck. The callback function will be then called with the current networks name.
GetNetWorkName.cpp
CNwNameCheck::~CNwNameCheck() { Cancel(); delete iTelephony; } void CNwNameCheck::ConstructL(void) { iTelephony = CTelephony::NewL(); iTelephony->GetCurrentNetworkName(iStatus, iIdV1Pkg); SetActive(); } CNwNameCheck::CNwNameCheck(MNwNameObserver& aObserver) : CActive(EPriorityNormal),iObserver(aObserver),iIdV1Pkg(iIdV1) { CActiveScheduler::Add(this); } void CNwNameCheck::RunL() { iObserver.NetworkNameL(iIdV1.iNetworkName); } void CNwNameCheck::DoCancel() { iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkNameCancel); }
GetNetWorkName.h
#include <Etel3rdParty.h> class MNwNameObserver { public: virtual void NetworkNameL(const TDesC& aNwName) = 0; }; class CNwNameCheck : public CActive { public: CNwNameCheck(MNwNameObserver& aObserver); void ConstructL(void); ~CNwNameCheck(); private: void RunL(); void DoCancel(); private: MNwNameObserver& iObserver; CTelephony* iTelephony; CTelephony::TNetworkNameV1 iIdV1; CTelephony::TNetworkNameV1Pckg iIdV1Pkg; };
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 如何直接挂断电话 | meiscai | Symbian | 18 | Yesterday 15:15 |
| Help on getting gsm network parameters | lifangjie | Symbian | 1 | 2007-11-21 14:23 |
| GetPhoneID() function in CTelephony | ozansafi | General Symbian C++ | 4 | 2008-04-17 19:22 |
| How to make and resived data call | mohhassan | General Symbian C++ | 5 | 2008-06-29 15:07 |
| Problem with data call | Suraj | Symbian Networking & Messaging | 0 | 2006-08-02 12:24 |
