Problem with fetching IMEI number

Login to reply to this topic.
Thu, 2006-11-09 08:37
Joined: 2006-10-05
Forum posts: 80
I want to fetch the IMEI number from Series 60 phones.

My code snippet:

_LIT(KGsmModuleName, "phonetsy.tsy");

   
// Connect to the ETel server
RTelServer telServer;
   User::LeaveIfError(telServer.Connect());
CleanupClosePushL(telServer);
   
// Make sure our TSY is loaded
   User::LeaveIfError(telServer.LoadPhoneModule(KGsmModuleName));
   
// Get the phone name
RTelServer::TPhoneInfo phoneInfo;
   User::LeaveIfError(telServer.GetPhoneInfo(0,phoneInfo));
   
   
// Open the phone by name
RBasicGsmPhone phone;
   
User::LeaveIfError(phone.Open(telServer,phoneInfo.iName));
CleanupClosePushL(phone);

// Get Phone Info
RBasicGsmPhone::TId id;
   User::LeaveIfError(phone.GetGsmPhoneId(id));
   
//// Close the Phone handle, no longer //needed
CleanupStack::PopAndDestroy(); // phone

TBuf<20> imeiNumber;
imeiNumber.Zero();
imeiNumber.AppendNum(id.iSerialNumber);

   telServer.UnloadPhoneModule(KGsmModuleName);
CleanupStack::PopAndDestroy(); // telServer

//--------------------------------------------------

The error occurs at the highlighted line. It is not allowing me to create an object of RBasicGsmPhone.

This code gives no error when I run in the Series 60 emulator but application closes in the 6600 phone.

I have included the etel.h and etelbgsm.h files as well as linked to etel.lib and gsmbas.lib.

I took  etelbgsm.h and gsmbas.lib from Nokia 9200 Communicator SDK.

Please help me solve my error...I am terribly stuck up.


Mon, 2007-01-08 11:59
Joined: 2004-09-06
Forum posts: 235
Re: Problem with fetching IMEI number
may be you have a wrong version of gsmbas.lib.
try with some higher version of this lib.

Or is it that Nk6600 doesn't have this lib atall?
Wed, 2007-02-14 13:08
Joined: 2005-02-11
Forum posts: 214
Re: Problem with fetching IMEI number
IMEI can be obtained more easily
Code:
  TPlpVariantMachineId imei;
  PlpVariant::GetMachineIdL(imei);

"I only know that I know nothing." (Socrates)

  • Login to reply to this topic.