How to know the tsy name programatically on a specific device

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Created: vvsnaresh (02 Apr 2007)
Last edited: hamishwillee (26 Jul 2012)

In order to load a tsy on a device, we need to pass a device specific tsy name, i.e erigsm.tsy, to RTelServer::LoadPhoneModule(). Without hard coding the name of the tsy and keep the code as portable as possible,knowing the tsy name programatically on a specific device will be a lot helpful.

This can be programatically retrieved, since tsy name is stored in the commdb in the modem bearer table for phone and SMS services.

The following code can be useful to get the tsy name:

CCommsDatabase* const db = CCommsDatabase::NewL(EDatabaseTypeUnspecified);
CleanupStack::PushL(db); // PUSH
TUint32 modemId = 0;
//Find the modem bearer for phone and SMS service.
db->GetGlobalSettingL(TPtrC(MODEM_PHONE_SERVICES_SMS), modemId);
CCommsDbTableView* const view =
db->OpenViewMatchingUintLC(TPtrC(MODEM), TPtrC(COMMDB_ID), modemId);
TInt err = view->GotoFirstRecord();
TFileName tsyName;
view->ReadTextL(TPtrC(MODEM_TSY_NAME), tsyName);
CleanupStack::PopAndDestroy(2, db); // view & db


This page was last modified on 26 July 2012, at 05:36.
36 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.