Reading SIM contacts: working!

Login to reply to this topic.
Mon, 2003-12-01 18:14
Joined: 2003-11-28
Forum posts: 5
Hi,

thanks for your suggestions.
Now, with etelbgsm.h, my code reads contacts in the SIM card.
But... it is working only on the Nokia 7650, with Symbian 6.0,
but not on the Nokia 6600 with Symbian 7.0.

Is there a way to do the same on the Nokia 6600?

This is the code for Nokia 7650:

==================================================

CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeUnspecified);
CleanupStack::PushL(db);
CCommsDbTableView* table = db->OpenTableLC(TPtrC(MODEM));
table->GotoFirstRecord();
TBuf<255> KTsyName;
TBuf<100> name;
table->ReadTextL(TPtrC(MODEM_TSY_NAME),KTsyName);
// Cleanup - CommsDB no longer needed
CleanupStack::PopAndDestroy(2); // table,db

// Connect to the ETel server
RTelServer aTelServer;
User::LeaveIfError(aTelServer.Connect());
CleanupClosePushL(aTelServer);

User::LeaveIfError(aTelServer.LoadPhoneModule(KTsyName));


TInt numberOfPhones;
User::LeaveIfError(aTelServer.EnumeratePhones(numberOfPhones));


for (TInt i=numberOfPhones; i>0; i--) {
  // Get the phone name
   RTelServer::TPhoneInfo phoneInfo;

   User::LeaveIfError(aTelServer.GetPhoneInfo(i-1,phoneInfo));
   
   // Open the phone by name
   RBasicGsmPhone phone;
   User::LeaveIfError(phone.Open(aTelServer,phoneInfo.iName));

   RGsmPhoneBook myBook;
   User::LeaveIfError(myBook.Open(phone, SIM_PHONEBOOK));

   RGsmPhoneBook::TEntry entry;

   TInt test = myBook.ReadFirst(entry);

   CleanupClosePushL(phone);

   name = entry.iText;

}

CleanupStack::PopAndDestroy(2);

============================================================

Thanks.
Fabio

Tue, 2003-12-02 10:25
Joined: 2003-10-20
Forum posts: 35
Reading SIM contacts: working!
Hi Fabio,

U can access sim phonebook in SDK 2.0 using PhoneBook Synchronizer that provides an interface to access/modify SIM contacts.

BTW, did U manage to write contact into SIM using SDK 1.2?
I've managed but something goes wrong and the SIM phonebook is no more accessible (ErrorCode = -14) for further operation.

I often regret my speech, I never regret my silence

Tue, 2003-12-02 11:26
Joined: 2003-11-28
Forum posts: 5
Reading SIM contacts: working!
Hi Fabriz,

my application only read contacts from SIM, without error.
Do you have a code sample (or help links) about PhoneBook Synchronizer?

Thanks.
Fabio
Tue, 2003-12-02 11:51
Joined: 2003-10-20
Forum posts: 35
Reading SIM contacts: working!
I never used the Synchronizer, just navigate through the SDK Help and found it  Huh

I also manage to read contacts into SIM...the problem comes after a write operation.

Sorry,

Fabrizio.

I often regret my speech, I never regret my silence

Thu, 2003-12-11 18:51
Joined: 2003-12-11
Forum posts: 1
Re: Reading SIM contacts: working!
hi

could you tell me where i can find all etelbgsm.h .lib ... stuff or send them
to simopaolo@hotmail.com .
Thanks a lot
Paolo
Sat, 2005-09-10 09:59
Joined: 2005-07-07
Forum posts: 34
Re: Reading SIM contacts: working!
Hi Paolo,

Did you recieve from somebody this lib and .h file. If you have this files please send they to me Sad
My mail is dilian@unicoders.biz

Thanks a lot!
Sun, 2005-09-11 07:46
Joined: 2005-03-04
Forum posts: 176
Re: Reading SIM contacts: working!
You can find the header on old (!) 9200 SDK's and A925 (Motorola). Maybe you must search some time, cause it was a mistake to publish the real header and libs.
If you don't find them, tell me. This case, i will look on Monday at work...

Bye;
CG
  • Login to reply to this topic.