Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to get IMEI on 7710

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: huwell (27 Jun 2007)
Last edited: hamishwillee (03 Feb 2012)

We could use PlpVariant to get imei in S60 2nd Edition development.

#if !defined(__WINS__) && !defined( __WINSCW__ )
PlpVariant::GetMachineIdL( iImei );
#else
iImei.Copy( KDefaultIMEI );
#endif

But it cannot work on 7710. We should use Etel3rdParty to read IMEI.

/* Declare the client class */ 
class CClientApp : public CActive
{
 
public:
 
// Construction
 
void ConstructL();
 
// Destruction
 
~CClientApp();
 
// Issue request: retrieve IMEI
 
void GetIMEI();
 
// Cancel request
 
void DoCancel();
 
// Service completed request
 
void RunL();
 
private:
 
CTelephony* iTelephony; // telephony object we own
 
CTelephony::TPhoneIdV1 iV1;
 
CTelephony::TPhoneIdV1Pckg* iPkg;
};
 
 
 
/* Define the client class */
 
void CClientApp::ConstructL()
{
iPkg = new (ELeave) CTelephony::TPhoneIdV1Pckg(iV1);
iTelephony = CTelephony::NewL();
CActiveScheduler::Add(this);
}
 
CClientApp::~CClientApp()
{
Cancel(); // if any request outstanding, calls DoCancel() to cleanup
delete iTelephony;
delete iPkg;
}
 
void CClientApp::GetIMEI()
{
iTelephony->GetPhoneId(iStatus,*iPkg );
SetActive();
CActiveScheduler::Start();
}
 
void CClientApp::RunL()
{
TBuf<50> retrievedIMEI;
if ( (iStatus == KErrNone) )
{
retrievedIMEI = (*iPkg)().iSerialNumber;
}
CActiveScheduler::Stop();
}
 
void CClientApp::DoCancel()
{
Cancel();
}


Internal links

This page was last modified on 3 February 2012, at 04:02.
75 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×