diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-CC5A1C8D-55AA-5FAE-A446-4CBF949C9003.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-CC5A1C8D-55AA-5FAE-A446-4CBF949C9003.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,61 @@ + + + + + +Subscriber Identity Tutorial This tutorial describes how an application gets the subscriber identification information. create a new instance of the CTelephony use CTelephony::GetSubscriberId() to get the IMSI number the function returns the IMSI in a CTelephony::TSubscriberIdV1 object pass the enumeration CTelephony::EGetSubscriberIdCancel to cancel the asynchronous request. Subscriber identity example #include <e32base.h> +#include <Etel3rdParty.h> + +class CClientApp : public CActive + { + +private: + CTelephony* iTelephony; + CTelephony::TSubscriberIdV1 iSubscriberIdV1; + CTelephony::TSubscriberIdV1Pckg iSubscriberIdV1Pckg; + +public: + CClientApp(CTelephony* aTelephony); + void SomeFunction(); + +private: + /* + These are the pure virtual methods from CActive that + MUST be implemented by all active objects + */ + void RunL(); + void DoCancel(); + }; + +CClientApp:: CClientApp(CTelephony* aTelephony) + : CActive(EPriorityStandard), + iTelephony(aTelephony), + iSubscriberIdV1Pckg(iSubscriberIdV1) + { + //default constructor + } + +void CClientApp::SomeFunction() + { + iTelephony->GetSubscriberId(iStatus, iSubscriberIdV1Pckg); + SetActive(); + } + +void CClientApp::RunL() + { + if(iStatus==KErrNone) + { + TBuf<CTelephony::KIMSISize> suscriberId = iSubscriberIdV1.iSubscriberId; + } + } + +void CClientApp::DoCancel() + { + iTelephony->CancelAsync(CTelephony::EGetSubscriberIdCancel); + } \ No newline at end of file