Symbian
Symbian OS Library

FAQ-0969 How do I find a tsy name on a specific device programmatically?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Telephony (ETel)
Created: 02/06/2004 Modified: 02/17/2004
Number: FAQ-0969
Platform: Symbian OS v7.0, Symbian OS v7.0s

Question:
When I want to load a tsy on a device, I need to pass a device specific tsy name, i.e erigsm.tsy, to RTelServer::LoadPhoneModule(). However I don't want to hard code the name in order to keep my code as portable as possible. How do I know the tsy name programatically on a specific device?

Answer:

The tsy name is stored in the commdb in the modem bearer table for phone and SMS services.
You can retrieve it from the commdb with the following code snip.


CCommsDatabase* const db = CCommsDatabase::NewL(EDatabaseTypeUnspecified);
CleanupStack::PushL(db); // PUSH
TUint32 modemId = 0;
db->GetGlobalSettingL(TPtrC(MODEM_PHONE_SERVICES_SMS), modemId); //Find the modem bearer for phone and SMS service.

CCommsDbTableView* const view = db->OpenViewMatchingUintLC(TPtrC(MODEM), TPtrC(COMMDB_ID), modemId); // PUSH
TInt err = view->GotoFirstRecord();
User::LeaveIfError(err);
TFileName tsyName;
view->ReadTextL(TPtrC(MODEM_TSY_NAME), tsyName);
User::LeaveIfError(telServer.LoadPhoneModule(tsyName));
CleanupStack::PopAndDestroy(2, db); // view & db