This tutorial describes how to retrieve the phone identification parameters from the device.
The phone idenitifcation is returned in a packaged CTelephony::TPhoneIdV1 . It contains the following member variables, each a TBuf descriptor of up to 50 characters:
#include <e32base.h> #include <Etel3rdParty.h> class CClientApp : public CActive { private: CTelephony* iTelephony; CTelephony::TPhoneIdV1 iPhoneIdV1; CTelephony::TPhoneIdV1Pckg iPhoneIdV1Pckg; 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), iPhoneIdV1Pckg(iPhoneIdV1) { //default constructor } void CClientApp::SomeFunction() { iTelephony->GetPhoneId(iStatus, iPhoneIdV1Pckg); SetActive(); } void CClientApp::RunL() { if(iStatus==KErrNone) { TBuf<CTelephony::KPhoneManufacturerIdSize> manufacturer = iPhoneIdV1.iManufacturer; TBuf<CTelephony::KPhoneModelIdSize> model = iPhoneIdV1.iModel; TBuf<CTelephony::KPhoneSerialNumberSize> serialNumber = iPhoneIdV1.iSerialNumber; } } void CClientApp::DoCancel() { iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel); }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.