smsprotocols/smsstack/smsprot/Src/smsprot.cpp
changeset 42 3adadc800673
parent 0 3553901f7fa8
child 66 07a122eea281
--- a/smsprotocols/smsstack/smsprot/Src/smsprot.cpp	Thu May 27 14:05:07 2010 +0300
+++ b/smsprotocols/smsstack/smsprot/Src/smsprot.cpp	Fri Jun 11 14:49:29 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,6 +19,12 @@
  @file
 */
 
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "smsprotTraces.h"
+#endif
+
 #include <commsdattypesv1_1.h>
 #include <logwrap.h>
 #include "Gsmumsg.h"
@@ -62,11 +68,7 @@
  */
 CSmsProtocolFamily * CSmsProtocolFamily::NewL()
 	{
-	LOGSMSPROT4("CSmsProtocolFamily::NewL [version %d.%d.%d]",
-			 KSmsPrtMajorVersionNumber,
-			 KSmsPrtMinorVersionNumber,
-			 KSmsPrtBuildVersionNumber
-			 );
+    OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLFAMILY_NEWL_1, "CSmsProtocolFamily::NewL [version %u.%u.%u]",KSmsPrtMajorVersionNumber,KSmsPrtMinorVersionNumber,KSmsPrtBuildVersionNumber );
 	return new (ELeave)CSmsProtocolFamily;
 	} // CSmsProtocolFamily::NewL
 
@@ -79,7 +81,7 @@
  */
 TInt CSmsProtocolFamily::Install()
 	{
-	LOGSMSPROT1("CSmsProtocolFamily::Install");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLFAMILY_INSTALL_1, "CSmsProtocolFamily::Install");
 	return KErrNone;
 	} // CProtocolFamilyBase::Install
 
@@ -93,7 +95,7 @@
  */
 TInt CSmsProtocolFamily::Remove()
 	{
-	LOGSMSPROT1("CSmsProtocolFamily::Remove");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLFAMILY_REMOVE_1, "CSmsProtocolFamily::Remove");
 	return KErrNone;
 	} // CProtocolFamilyBase::Remove
 
@@ -109,7 +111,7 @@
  */
 CProtocolBase * CSmsProtocolFamily::NewProtocolL(TUint /*aSockType*/,TUint /*aProtocol*/)
 	{
-	LOGSMSPROT1("CSmsProtocolFamily::NewProtocolL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLFAMILY_NEWPROTOCOLL_1	        , "CSmsProtocolFamily::NewProtocolL");
 	return CSmsProtocol::NewL();
 	} // CProtocolFamilyBase::NewProtocolL
 
@@ -127,12 +129,12 @@
  */
 TUint CSmsProtocolFamily::ProtocolList(TServerProtocolDesc *& aProtocolList)
 	{
-	LOGSMSPROT1("CSmsProtocolFamily::ProtocolList");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLFAMILY_PROTOCOLLIST_1, "CSmsProtocolFamily::ProtocolList");
 
 	TRAPD(ret, (aProtocolList=new(ELeave) TServerProtocolDesc[1]));
 	if(ret!=KErrNone)
 		{
-		LOGSMSPROT2("WARNING! new TServerProtocolDesc left with %d", ret);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLFAMILY_PROTOCOLLIST_2, "WARNING! new TServerProtocolDesc left with %d", ret);
 		return 0;
 		}
 
@@ -169,7 +171,7 @@
  */
 EXPORT_C CProtocolFamilyBase* InstallSMS()
 	{
-	LOGSMSPROT1("CSmsProtocolFamily::CSmsProtocolFamily()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, INSTALLSMS_1, "CSmsProtocolFamily::CSmsProtocolFamily()");
 
 	CSmsProtocolFamily*  smsProtocolFamily(NULL);
 	
@@ -190,7 +192,7 @@
  */
 CSmsProtocol* CSmsProtocol::NewL()
 	{
-	LOGSMSPROT1("CSmsProtocol::NewL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NEWL_1, "CSmsProtocol::NewL()");
 
 	return new (ELeave) CSmsProtocol();
 	} // CSmsProtocol::NewL
@@ -252,7 +254,7 @@
  */
 CServProviderBase *CSmsProtocol::NewSAPL(TUint aSocketType)
 	{
-	LOGSMSPROT2("*CSmsProtocol::NewSAPL [sockettype=%d]", aSocketType);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NEWSAPL_1, "*CSmsProtocol::NewSAPL [sockettype=%d]", aSocketType);
 	if (aSocketType!=KSockDatagram)
 		User::Leave(KErrNotSupported);
 	return CSmsProvider::NewL(*this);
@@ -274,14 +276,14 @@
  */
 void CSmsProtocol::InitL(TDesC& /*aTag*/)
 	{
-	LOGSMSPROT1("CSmsProtocol::InitL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_INITL_1, "CSmsProtocol::InitL");
 
 	User::LeaveIfError(iFs.Connect());
 
 	iReassemblyStore=CFacadeSmsReassemblyStore::NewL(iFs, *this);
 	iReassemblyStore->InitL();
 
-	LOGSMSPROT1("CSmsProtocol::InitL Constructing members");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_INITL_2, "CSmsProtocol::InitL Constructing members");
 
 	ReadConfigurableSettingsL();
 
@@ -315,7 +317,7 @@
 		User::LeaveIfError(ret);
 #endif
 */
-	LOGSMSPROT1("CSmsProtocol::InitL Querying CommDb");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_INITL_3, "CSmsProtocol::InitL Querying CommDb");
 
 	// Read the global modem ID setting from  Cooms Database
 	TUint32 modemId = 0;
@@ -344,12 +346,7 @@
 
 	CleanupStack::PopAndDestroy(sess);
 
-#ifdef _SMS_LOGGING_ENABLED
-	TBuf8<KCommsDbSvrMaxFieldLength> buf8;
-	buf8.Copy(iGsmTsyName);
-	LOGSMSPROT3("CSmsProtocol::InitL [modemId=%d tsy=%S]",
-				modemId, &buf8);
-#endif
+    OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_INITL_4, "CSmsProtocol::InitL [modemId=%d tsy=%S]",(TInt)modemId, iGsmTsyName );
 
 	// Start event notification state machines
 	iSmsModemNotification->Start();
@@ -396,7 +393,7 @@
  */
 void CSmsProtocol::StartL(void)
 	{
-	LOGSMSPROT1("CSmsProtocol::StartL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_STARTL_1, "CSmsProtocol::StartL");
 	} // CSmsProtocol::StartL
 
 
@@ -407,7 +404,7 @@
  */
 void CSmsProtocol::Identify(TServerProtocolDesc *aDesc)const
 	{
-	LOGSMSPROT1("CSmsProtocol::Identify");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_IDENTIFY_1, "CSmsProtocol::Identify");
 
 	aDesc->iName=KSmsDatagram;
 	aDesc->iAddrFamily=KSMSAddrFamily;
@@ -436,7 +433,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::NewHostResolverL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NEWHOSTRESOLVERL_1, "CSmsProtocol::NewHostResolverL");
     SmspPanic(ESmspCantCreateHostResolver);
     return NULL;
     BULLSEYE_RESTORE
@@ -454,7 +451,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("*CSmsProtocol::NewServiceResolverL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NEWSERVICERESOLVERL_1, "*CSmsProtocol::NewServiceResolverL");
     SmspPanic(ESmspCantCreateServiceResolver);
     return NULL;
     BULLSEYE_RESTORE
@@ -472,7 +469,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::NewNetDatabaseL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NEWNETDATABASEL_1, "CSmsProtocol::NewNetDatabaseL");
     SmspPanic(ESmspCantCreateNetDatabase);
     return NULL;
     BULLSEYE_RESTORE
@@ -490,7 +487,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::BindL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_BINDL_1, "CSmsProtocol::BindL");
     SmspPanic(ESmspCantBind);
     BULLSEYE_RESTORE
     }
@@ -508,7 +505,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::BindToL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_BINDTOL_1, "CSmsProtocol::BindToL");
     SmspPanic(ESmspCantBindTo);
     BULLSEYE_RESTORE
     }
@@ -525,7 +522,7 @@
 	TRAPD(ret, ini=CESockIniData::NewL(_L("smswap.sms.esk")));
 	if(ret!=KErrNone)
 		{
-		LOGSMSPROT2("esk read failed, error code = [%d]", ret);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_READCONFIGURABLESETTINGSL_1, "esk read failed, error code = [%d]", ret);
 		User::Leave(ret);
 		}
 
@@ -536,7 +533,7 @@
 		{
 		if (var > 0)
 			{
-			LOGSMSPROT2("sendTryTimeout [%d]", var);
+			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_READCONFIGURABLESETTINGSL_2, "sendTryTimeout [%d]", var);
 			iSmsSettings.SetSendTryTimeout(var);
 			}
 		else
@@ -549,7 +546,7 @@
 		{
 		if (var > 0)
 			{
-			LOGSMSPROT2("bootTimerTimeout [%d]", var);
+			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_READCONFIGURABLESETTINGSL_3, "bootTimerTimeout [%d]", var);
 			iSmsSettings.SetBootTimerTimeout(var);
 			}
 		else
@@ -574,7 +571,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::Send");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_SEND_1, "CSmsProtocol::Send");
     SmspPanic(ESmspCantSend);
     return KErrNotSupported;
     BULLSEYE_RESTORE
@@ -592,7 +589,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::Process");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_PROCESS_1, "CSmsProtocol::Process");
     SmspPanic(ESmspCantProcess);
     BULLSEYE_RESTORE
     }
@@ -609,7 +606,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::GetOption");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_GETOPTION_1, "CSmsProtocol::GetOption");
     // SmspPanic(ESmspCantGetOption);
     return KErrNotSupported;
     BULLSEYE_RESTORE
@@ -627,7 +624,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::SetOption");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_SETOPTION_1, "CSmsProtocol::SetOption");
     //SmspPanic(ESmspCantSetOption);
     return KErrNotSupported;
     BULLSEYE_RESTORE
@@ -645,7 +642,7 @@
     {
     // Ignore in code coverage - not intended to be used
     BULLSEYE_OFF    
-    LOGSMSPROT1("CSmsProtocol::Error");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ERROR_1, "CSmsProtocol::Error");
     SmspPanic(ESmspCantError);
     BULLSEYE_RESTORE
     }
@@ -659,7 +656,7 @@
  */
 void CSmsProtocol::AddSmsMessageObserverL(MSmsMessageObserver& aObserver)
     {
-    LOGSMSPROT2("CSmsProtocol::AddSmsMessageObserverL [aObserver=0x%08x]", &aObserver);
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ADDSMSMESSAGEOBSERVERL_1, "CSmsProtocol::AddSmsMessageObserverL [aObserver=0x%08x]", &aObserver);
     iSmsMessageObserverList.AppendL(&aObserver);
     SetClosingDown(EFalse);
     }
@@ -676,7 +673,7 @@
  */
 TInt CSmsProtocol::BindSmsMessageObserver(MSmsMessageObserver& aObserver,const TSmsAddr& aSmsAddr)
 	{
-	LOGSMSPROT2("CSmsProtocol::BindSmsMessageObserver 0x%08x", &aObserver);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_BINDSMSMESSAGEOBSERVER_1, "CSmsProtocol::BindSmsMessageObserver 0x%08x", &aObserver);
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 	TInt ret=KErrNone;
 
@@ -696,7 +693,7 @@
 			TRAP(ret, ProcessCompleteSmsMessagesL());
 			if(ret != KErrNone)
 				{
-				LOGSMSPROT2("WARNING! CSmsProtocol::ProcessCompleteSmsMessagesL left with %d", ret);
+				OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_BINDSMSMESSAGEOBSERVER_2, "WARNING! CSmsProtocol::ProcessCompleteSmsMessagesL left with %d", ret);
 				}
 			}
 		}
@@ -715,7 +712,7 @@
  */
 void CSmsProtocol::RemoveSmsMessageObserver(const MSmsMessageObserver& aObserver)
     {
-    LOGSMSPROT2("CSmsProtocol::RemoveSmsMessageObserver 0x%08x", &aObserver);
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_REMOVESMSMESSAGEOBSERVER_1, "CSmsProtocol::RemoveSmsMessageObserver 0x%08x", &aObserver);
     __ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
     TInt index=ObserverIndex(aObserver);
     iSmsMessageObserverList.Delete(index);
@@ -728,7 +725,7 @@
  */
 void CSmsProtocol::SendSmsMessage(CSmsMessage* aSmsMessage,MSmsMessageObserver& aObserver,TUint aOptions)
 	{
-	LOGSMSPROT2("CSmsProtocol::SendSmsMessage [aObserver=0x%X]", &aObserver);
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_SENDSMSMESSAGE_1, "CSmsProtocol::SendSmsMessage [aObserver=0x%08X]", (TUint) &aObserver);
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver), SmspPanic(ESmspMessageObserverNotFound));
 
 	// Ensure the modem is connected and initialized
@@ -764,7 +761,7 @@
         }
     if( err != KErrNone )
         {
-        LOGSMSPROT4("CSmsProtocol::CheckPoweredUp [err=%d, iModemDetection=%d, IsBackupOrRestoreInProgress=%d]", err, iModemDetection, iBackupRestoreSession->IsBackupOrRestoreInProgress());
+        OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CHECKPOWEREDUP_1, "CSmsProtocol::CheckPoweredUp [err=%d, iModemDetection=%d, IsBackupOrRestoreInProgress=%d]", err, iModemDetection, iBackupRestoreSession->IsBackupOrRestoreInProgress());
         }    
     return err;
     }
@@ -782,7 +779,7 @@
  */
 void CSmsProtocol::CancelSendSmsMessage(MSmsMessageObserver& aObserver,TBool)
 	{
-	LOGSMSPROT2("CSmsProtocol::CancelSendSmsMessage 0x%08x", &aObserver);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CANCELSENDSMSMESSAGE_1, "CSmsProtocol::CancelSendSmsMessage 0x%08x", &aObserver);
 
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 
@@ -795,7 +792,7 @@
  */
 void CSmsProtocol::EnumeratePhone(MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::EnumeratePhone");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ENUMERATEPHONE_1, "CSmsProtocol::EnumeratePhone");
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 
 	// Ensure the modem is connected and initialized
@@ -826,7 +823,7 @@
  */
 void CSmsProtocol::CancelEnumeratePhone(MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::CancelEnumeratePhone");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CANCELENUMERATEPHONE_1, "CSmsProtocol::CancelEnumeratePhone");
 
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver), SmspPanic(ESmspMessageObserverNotFound));
 	__ASSERT_DEBUG(iPhoneEnumerationObserver==NULL || &aObserver==iPhoneEnumerationObserver, SmspPanic(ESmspMessageWrongObserver));
@@ -855,7 +852,7 @@
  */
 void CSmsProtocol::WriteSmsMessage(CSmsMessage* aSmsMessage,MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::WriteSmsMessage");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_WRITESMSMESSAGE_1, "CSmsProtocol::WriteSmsMessage");
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 
 	const TInt err = CheckPoweredUp();
@@ -874,7 +871,7 @@
 
 void CSmsProtocol::CancelWriteSmsMessage(MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::CancelWriteSmsMessage()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CANCELWRITESMSMESSAGE_1, "CSmsProtocol::CancelWriteSmsMessage()");
 
 	if (iWriteQueue != NULL)
 		iWriteQueue->CancelObserver(aObserver);
@@ -893,7 +890,7 @@
  */
 void CSmsProtocol::DeleteSmsMessage(CSmsMessage* aSmsMessage,MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::DeleteSmsMessage");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DELETESMSMESSAGE_1, "CSmsProtocol::DeleteSmsMessage");
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 
 	// Ensure the modem is connected and initialized
@@ -921,7 +918,7 @@
  */
 void CSmsProtocol::CancelDeleteSmsMessage(MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::CancelDeleteSmsMessage");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CANCELDELETESMSMESSAGE_1, "CSmsProtocol::CancelDeleteSmsMessage");
 
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 
@@ -942,7 +939,7 @@
  */
 void CSmsProtocol::ReadSmsParameters(MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::ReadSmsParameters");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_READSMSPARAMETERS_1, "CSmsProtocol::ReadSmsParameters");
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 	TInt ret = CheckPoweredUp();
 
@@ -976,7 +973,7 @@
  */
 void CSmsProtocol::CancelReadSmsParams()
 	{
-	LOGSMSPROT1("CSmsProtocol::CancelReadSmsParams");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CANCELREADSMSPARAMS_1, "CSmsProtocol::CancelReadSmsParams");
 
 	if(iSmsReadParams != NULL)
 		iSmsReadParams->Cancel();
@@ -996,7 +993,7 @@
  */
 void CSmsProtocol::WriteSmsParameters(CMobilePhoneSmspList* aMobilePhoneSmspList,MSmsMessageObserver& aObserver)
 	{
-	LOGSMSPROT1("CSmsProtocol::WriteSmsParameters");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_WRITESMSPARAMETERS_1, "CSmsProtocol::WriteSmsParameters");
 	__ASSERT_DEBUG(ObserverIsPresent(aObserver),SmspPanic(ESmspMessageObserverNotFound));
 
 	TInt ret = CheckPoweredUp();
@@ -1042,7 +1039,7 @@
  */
 void CSmsProtocol::CancelWriteSmsParams()
 	{
-	LOGSMSPROT1("CSmsProtocol::CancelWriteSmsParams");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CANCELWRITESMSPARAMS_1, "CSmsProtocol::CancelWriteSmsParams");
 
 	if(iSmsWriteParams != NULL)
 		iSmsWriteParams->Cancel();
@@ -1073,7 +1070,7 @@
 TInt CSmsProtocol::ProcessMessageL(const CSmsMessage& aSmsMessage,const TSmsAddr* aOriginalSmsAddr,
 		const CSmsMessage* /*aOriginalSmsMessage*/,TDes& aDes)
 	{
-	LOGSMSPROT1("CSmsProtocol::ProcessMessage");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_PROCESSMESSAGEL_1, "CSmsProtocol::ProcessMessage");
 
 	MSmsMessageObserver* observer=NULL;
 	if (aOriginalSmsAddr!=NULL)
@@ -1092,7 +1089,7 @@
 		observer = MatchSmsMessageToObserver(aSmsMessage);
 		}
 
-	LOGSMSPROT2("CSmsProtocol::ProcessMessage [observer=0x%08x]",observer);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_PROCESSMESSAGEL_2, "CSmsProtocol::ProcessMessage [observer=0x%08x]",observer);
 	TInt ret=KErrNone;
 
 	if (observer!=NULL)
@@ -1142,13 +1139,13 @@
  */
 void CSmsProtocol::DeletePDUs(const CArrayFix<TGsmSmsSlotEntry>& aSlotArray, MSmsMessageObserver* aObserver)
 	{
-	LOGSMSPROT3("CSmsProtocol::DeletePDUs [count=%d aObserver=0x%08X", aSlotArray.Count(), aObserver);
-	__ASSERT_DEBUG(aSlotArray.Count() != 0, SmspPanic(KSmspSlotArrayEmpty));
+    OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DELETEPDUS_1, "CSmsProtocol::DeletePDUs [count=%d aObserver=0x%08X", aSlotArray.Count(), (TUint)aObserver);
+    __ASSERT_DEBUG(aSlotArray.Count() != 0, SmspPanic(KSmspSlotArrayEmpty));
 
-	for(TInt i=0; i< aSlotArray.Count() ;i++)
-		{
-		LOGSMSPROT3("CSmsProtocol::DeletePDUs index: %d store %S", aSlotArray[i].iIndex, &aSlotArray[i].iStore);
-		}
+    for(TInt i=0; i< aSlotArray.Count() ;i++)
+        {
+        OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DELETEPDUS_2, "CSmsProtocol::DeletePDUs index: %d store %S", aSlotArray[i].iIndex, aSlotArray[i].iStore);
+        }
 
 	if (iDeleteQueue != NULL && aSlotArray.Count() != 0)
 		{
@@ -1166,8 +1163,7 @@
 void CSmsProtocol::ModemNotificationCompleted(TInt aStatus,
 											  RPhone::TModemDetection aNewState)
 	{
-	LOGSMSPROT3("CSmsProtocol::ModemNotificationCompleted(): aStatus=%d, aNewState=%d",
-				aStatus, aNewState);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MODEMNOTIFICATIONCOMPLETED_1, "CSmsProtocol::ModemNotificationCompleted(): aStatus=%d, aNewState=%d",aStatus, aNewState);
 
 	TBool stateChanged = EFalse;
 
@@ -1181,7 +1177,7 @@
 			case RPhone::EDetectedNotPresent:
 			case RPhone::EDetectedUnknown:
 				{
-				LOGSMSPROT1("RPhone::EDetectedNotPresent: [OFF -> ON]");
+				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MODEMNOTIFICATIONCOMPLETED_2, "RPhone::EDetectedNotPresent: [OFF -> ON]");
 				if (aNewState==RPhone::EDetectedPresent)
 					{
 					// There is a new modem connection
@@ -1195,7 +1191,7 @@
 			//
 			case RPhone::EDetectedPresent:
 				{
-				LOGSMSPROT1("RPhone::EDetectedPresent: [ON -> OFF]");
+				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MODEMNOTIFICATIONCOMPLETED_3, "RPhone::EDetectedPresent: [ON -> OFF]");
 				if (aNewState!=RPhone::EDetectedPresent)
 					{
 					// Ah, lost our modem - cancel outstanding operations
@@ -1230,7 +1226,7 @@
  * Called when the Disk Space Monitor state has changed.
  */
 	{
-	LOGSMSPROT2("CSmsProtocol::DiskSpaceMonitorStateChange(): aStatus=%d", aStatus);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DISKSPACEMONITORSTATECHANGE_1, "CSmsProtocol::DiskSpaceMonitorStateChange(): aStatus=%d", aStatus);
 
 	RProperty::Set(KUidPSSMSStackCategory, KUidPSSMSStackDiskSpaceMonitorKey, aStatus);
 	} // CSmsProtocol::DiskSpaceMonitorStateChange
@@ -1243,22 +1239,22 @@
  */
 void CSmsProtocol::MessageSendCompleted(TInt aStatus)
 	{
-	LOGSMSPROT3("*** CSmsProtocol::MessageSendCompleted [aStatus=%d iNumSegmentationStoreAccesses=%d]", aStatus, iNumSegmentationStoreAccesses);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MESSAGESENDCOMPLETED_1, "*** CSmsProtocol::MessageSendCompleted [aStatus=%d iNumSegmentationStoreAccesses=%d]", aStatus, iNumSegmentationStoreAccesses);
     (void) aStatus;
 	iNumSegmentationStoreAccesses++;
 	if (iNumSegmentationStoreAccesses>=KNumSARStoreAccessesBeforePurging)
 		{
-		LOGSMSPROT1("iSegmentationStore->PurgeL Start");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MESSAGESENDCOMPLETED_2, "iSegmentationStore->PurgeL Start");
 		TRAPD(ret, iSegmentationStore->PurgeL(iSmsSettings.KSegmentationLifetimeMultiplier(),EFalse));
 		if(ret!=KErrNone)
 			{
 			// we need to close the file because the function
 			// left with the file opened
 			// iSegmentationStore->CloseFile();
-			LOGSMSPROT2("WARNING! iSegmentationStore->PurgeL left with %d", ret);
+			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MESSAGESENDCOMPLETED_3, "WARNING! iSegmentationStore->PurgeL left with %d", ret);
 			}
 		iNumSegmentationStoreAccesses=0;
-		LOGSMSPROT2("iSegmentationStore->PurgeL End [ret=%d]", ret);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MESSAGESENDCOMPLETED_4, "iSegmentationStore->PurgeL End [ret=%d]", ret);
 		}
 	} // CSmsProtocol::KNumSARStoreAccessesBeforePurging
 
@@ -1270,7 +1266,7 @@
  */
 void CSmsProtocol::PhoneEnumerationCompleted(TInt aStatus)
 	{
-	LOGSMSPROT1("CSmsProtocol::PhoneEnumerationCompleted");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_PHONEENUMERATIONCOMPLETED_1, "CSmsProtocol::PhoneEnumerationCompleted");
 	iPhoneEnumerationObserver->EnumeratePhoneCompleted(aStatus);
 	} // CSmsProtocol::PhoneEnumerationCompleted
 
@@ -1283,7 +1279,7 @@
  */
 void CSmsProtocol::CloseNow()
 	{
-	LOGSMSPROT1("CSmsProtocol::CloseNow");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CLOSENOW_1, "CSmsProtocol::CloseNow");
 	if (iDeleteQueue != NULL && iDeleteQueue->IsActive())
 		SetClosingDown(ETrue);
 	else
@@ -1313,7 +1309,7 @@
  */
 TInt CSmsProtocol::ObserverIndex(const MSmsMessageObserver& aObserver) const
 	{
-	LOGSMSPROT1("CSmsProtocol::ObserverIndex()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_OBSERVERINDEX_1, "CSmsProtocol::ObserverIndex()");
 
 	TInt count=iSmsMessageObserverList.Count();
 	TInt index=0;
@@ -1330,7 +1326,7 @@
  */
 TBool CSmsProtocol::SmsAddrIsAlreadyUsed(const MSmsMessageObserver* aObserver,const TSmsAddr& aSmsAddr)const
 	{
-	LOGSMSPROT1("CSmsProtocol::SmsAddrIsAlreadyUsed()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_SMSADDRISALREADYUSED_1, "CSmsProtocol::SmsAddrIsAlreadyUsed()");
 
 	TBool isduplicate=EFalse;
 	TInt count=iSmsMessageObserverList.Count();
@@ -1415,7 +1411,7 @@
  */
 TInt TKeySmsObserver::Compare(TInt aLeft, TInt aRight) const
 	{
-	LOGSMSPROT3("TKeySmsObserver::Compare [left=%d, right=%d]", aLeft, aRight);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, TKEYSMSOBSERVER_COMPARE_1, "TKeySmsObserver::Compare [left=%d, right=%d]", aLeft, aRight);
 
 	const TInt lhptr = -1; // Left higher priority than right
 	const TInt rhptl = 1; // Right higher priority than left
@@ -1458,7 +1454,7 @@
  */
 void CSmsProtocol::OrderSmsMessageObserver(const MSmsMessageObserver& /*aObserver*/)
 	{
-	LOGSMSPROT1("CSmsProtocol::OrderSmsMessageObserver()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ORDERSMSMESSAGEOBSERVER_1, "CSmsProtocol::OrderSmsMessageObserver()");
 
 	TKeySmsObserver smsObsKey;
 #ifdef _DEBUG
@@ -1477,7 +1473,7 @@
  */
 MSmsMessageObserver* CSmsProtocol::MatchSmsMessageToObserver(const CSmsMessage& aSmsMessage)
 	{
-	LOGSMSPROT1("CSmsProtocol::MatchSmsMessageToObserver()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MATCHSMSMESSAGETOOBSERVER_1, "CSmsProtocol::MatchSmsMessageToObserver()");
 
 	TInt count=iSmsMessageObserverList.Count();
 	for (TInt i=0;i<count;i++)
@@ -1497,7 +1493,7 @@
  */
 MSmsMessageObserver* CSmsProtocol::MatchSmsAddressToObserver(const TSmsAddr& aAddr)
 	{
-	LOGSMSPROT1("CSmsProtocol::MatchSmsAddressToObserver()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MATCHSMSADDRESSTOOBSERVER_1, "CSmsProtocol::MatchSmsAddressToObserver()");
 
 	TInt count=iSmsMessageObserverList.Count();
 	for (TInt i=0;i<count;i++)
@@ -1517,7 +1513,7 @@
  */
 TBool CSmsProtocol::IsMatch(const TSmsAddr& aSmsAddr, const CSmsMessage& aSmsMessage)
 	{
-	LOGSMSPROT1("CSmsProtocol::IsMatch()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ISMATCH_1, "CSmsProtocol::IsMatch()");
 
 	TSmsAddrFamily family = aSmsAddr.SmsAddrFamily();
 
@@ -1573,7 +1569,7 @@
 
 		case (ESmsAddrStatusReport):
 			{
-			LOGSMSPROT1("TSmsDataCodingScheme::ESmsDCSMessageWaitingIndicationDiscardMessage:");
+			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ISMATCH_2, "TSmsDataCodingScheme::ESmsDCSMessageWaitingIndicationDiscardMessage:");
 			if (aSmsMessage.Type() == CSmsPDU::ESmsStatusReport)
 				return ETrue;
 			}
@@ -1616,7 +1612,7 @@
  */
 TBool CSmsProtocol::MatchApplicationPort(const CSmsMessage& aSmsMessage,TUint aPort,TBool a16Bit)
 	{
-	LOGSMSPROT1("CSmsProtocol::MatchApplicationPort");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MATCHAPPLICATIONPORT_1, "CSmsProtocol::MatchApplicationPort");
 
 	if (!aSmsMessage.SmsPDU().UserDataPresent())
 		return EFalse;
@@ -1640,7 +1636,7 @@
  */
 TBool CSmsProtocol::MatchInformationElement(const CSmsMessage& aSmsMessage, CSmsInformationElement::TSmsInformationElementIdentifier aIeVal)
 	{
-	LOGSMSPROT1("CSmsProtocol::MatchInformationElement");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MATCHINFORMATIONELEMENT_1, "CSmsProtocol::MatchInformationElement");
 
 	if (!aSmsMessage.SmsPDU().UserDataPresent())
 		return EFalse;
@@ -1666,7 +1662,7 @@
  */
 void CSmsProtocol::ProcessCompleteSmsMessagesL()
 	{
-	LOGSMSPROT1("CSmsProtocol::ProcessCompleteSmsMessagesL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_PROCESSCOMPLETESMSMESSAGESL_1, "CSmsProtocol::ProcessCompleteSmsMessagesL");
 
 	if(iPhoneEnumerationObserver) return;
 
@@ -1684,11 +1680,11 @@
  */
 void CSmsProtocol::MessageReadedSuccessfully()
 	{
-	LOGSMSPROT1("CSmsProtocol::MessageReadedSuccessfully");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MESSAGEREADEDSUCCESSFULLY_1, "CSmsProtocol::MessageReadedSuccessfully");
 	TRAPD(ret,ProcessCompleteSmsMessagesL());
 	if(ret!=KErrNone)
 		{
-		LOGSMSPROT2("WARNING! CSmsProtocol::ProcessCompleteSmsMessagesL left with %d", ret);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MESSAGEREADEDSUCCESSFULLY_2, "WARNING! CSmsProtocol::ProcessCompleteSmsMessagesL left with %d", ret);
 		}
 
 	iNumReassemblyStoreAccesses++;
@@ -1698,7 +1694,7 @@
 
 		if(ret!=KErrNone)
 			{
-			LOGSMSPROT2("WARNING! iReassemblyStore->PurgeL left with %d", ret);
+			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_MESSAGEREADEDSUCCESSFULLY_3, "WARNING! iReassemblyStore->PurgeL left with %d", ret);
 			}
 
 		iNumReassemblyStoreAccesses=0;
@@ -1713,10 +1709,10 @@
  */
 void CSmsProtocol::DeleteSMSFromReaStoreL(const CSmsMessage& aSmsMessage)
 	{
-	LOGSMSPROT1("CSmsProtocol::DeleteSMSFromReaStoreL entry");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DELETESMSFROMREASTOREL_1, "CSmsProtocol::DeleteSMSFromReaStoreL entry");
 	if (aSmsMessage.Type() == CSmsPDU::ESmsStatusReport)
 	{
-		LOGSMSPROT1("CSmsProtocol::DeleteSMSFromReaStoreL it's SR");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DELETESMSFROMREASTOREL_2, "CSmsProtocol::DeleteSMSFromReaStoreL it's SR");
 		return;
 	}
 
@@ -1739,7 +1735,7 @@
 					Only in this condition set incomplete message as forwarded
 					which internally will remove the PDUs from pre-allocated file.
 					*/
-					LOGSMSPROT1("CSmsProtocol::DeleteSMSFromReaStoreL Incomplete Message Not last segment");
+					OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DELETESMSFROMREASTOREL_3, "CSmsProtocol::DeleteSMSFromReaStoreL Incomplete Message Not last segment");
 					iReassemblyStore->SetIncompleteMessageForwardedToClientL(aSmsMessage);
 					return;
 					}
@@ -1748,7 +1744,7 @@
 		}
 	iReassemblyStore->DeleteMessageL(aSmsMessage, ETrue);
 
-	LOGSMSPROT1("CSmsProtocol::DeleteSMSFromReaStoreL exit");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DELETESMSFROMREASTOREL_4, "CSmsProtocol::DeleteSMSFromReaStoreL exit");
 	} // CSmsProtocol::DeleteSMSFromReaStoreL
 
 
@@ -1758,15 +1754,15 @@
  */
 void CSmsProtocol::NotifyMessageObservers(TInt aStatus)
 	{
-	LOGSMSPROT1("CSmsProtocol::NotifyMessageObservers");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NOTIFYMESSAGEOBSERVERS_1, "CSmsProtocol::NotifyMessageObservers");
 
 	TInt count=iSmsMessageObserverList.Count();
-	LOGSMSPROT3("CSmsProtocol::NotifyMessageObservers [count=%d, aStatus=%d]",count, aStatus);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NOTIFYMESSAGEOBSERVERS_2, "CSmsProtocol::NotifyMessageObservers [count=%d, aStatus=%d]",count, aStatus);
 	for (TInt index=0; index<count; index++)
 		{
 		MSmsMessageObserver* observer=iSmsMessageObserverList[index];
 		TSmsAddrFamily fam = observer->GetLocalAddress().SmsAddrFamily();
-	    LOGSMSPROT2("CSmsProtocol::NotifyMessageObservers [family=%d]", fam);
+	    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NOTIFYMESSAGEOBSERVERS_3, "CSmsProtocol::NotifyMessageObservers [family=%d]", fam);
 		switch (fam)
 			{
 			case ESmsAddrMessageIndication:
@@ -1794,7 +1790,7 @@
 
 void CSmsProtocol::PowerUp()
 	{
-	LOGSMSPROT2("CSmsProtocol::PowerUp [iState=%d]", iState);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_POWERUP_1, "CSmsProtocol::PowerUp [iState=%d]", iState);
 	__ASSERT_DEBUG(iState == EPoweredDown, SmspPanic(KSmspPanicUnexpectedState));
 
 	if (iState == EPoweredDown)
@@ -1803,7 +1799,7 @@
 
 		if (err != KErrNone)
 			{
-			LOGSMSPROT3("WARNING: CSmsProtocol::DoPowerUpL left [err=%d iState=%d]", err, iState);
+			OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_POWERUP_2, "WARNING: CSmsProtocol::DoPowerUpL left [err=%d iState=%d]", err, iState);
 			__ASSERT_DEBUG(iState == EPoweredDown, SmspPanic(KSmspPanicUnexpectedState));
 			PowerDown();
 			}
@@ -1822,24 +1818,24 @@
  */
 void CSmsProtocol::DoPowerUpL()
 	{
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_1, "CSmsProtocol::DoPowerUpL");
 	__ASSERT_DEBUG(iModemDetection==RPhone::EDetectedPresent,SmspPanic(KSmspPhoneHasNotTurnedOn));
 
 	//Open the segmentation and reassembly stores
 
 	iReassemblyStore->OpenStoreL();
 	iSegmentationStore->OpenStoreL();
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL->PurgeL Start");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_2, "CSmsProtocol::DoPowerUpL->PurgeL Start");
 	iReassemblyStore->PurgeL(iSmsSettings.ReassemblyLifetime(), ETrue);
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL->PurgeL End");
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL->PurgeL Start");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_3, "CSmsProtocol::DoPowerUpL->PurgeL End");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_4, "CSmsProtocol::DoPowerUpL->PurgeL Start");
 	iSegmentationStore->PurgeL(iSmsSettings.KSegmentationLifetimeMultiplier(),EFalse);
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL->PurgeL End");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_5, "CSmsProtocol::DoPowerUpL->PurgeL End");
 
 	// Connect to ETEL and load the TSY
 	User::LeaveIfError(iTelServer.Connect());
 	User::LeaveIfError(iTelServer.LoadPhoneModule(iGsmTsyName));
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL  Connected to Etel");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_6, "CSmsProtocol::DoPowerUpL  Connected to Etel");
 
 	// Find the phone corresponding to this TSY and open a number of handles on it
 	TInt numPhones;
@@ -1864,7 +1860,7 @@
 		User::LeaveIfError(iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorBasic));
 	User::LeaveIfError(iSmsMessaging.Open(iGsmPhone));
 
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL  Opened TSY handles");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_7, "CSmsProtocol::DoPowerUpL  Opened TSY handles");
 
 	if (iSmsPhoneEnumeration == NULL)
 		iSmsPhoneEnumeration=CSmsPhoneEnumeration::NewL(*this, iSmsSettings, *iReassemblyStore, *iSegmentationStore, iEnumerationPhone, KSmsSessionPriority, *iSmsMonitorDiskSpace);
@@ -1878,10 +1874,10 @@
 	// Start state machines
 	iSmsPhoneInitialization->Start();
 
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL  Started state machines");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_8, "CSmsProtocol::DoPowerUpL  Started state machines");
 
 	NotifyMessageObservers(KIoctlSelectModemPresent);
-	LOGSMSPROT1("CSmsProtocol::DoPowerUpL  Notified message observers");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_DOPOWERUPL_9, "CSmsProtocol::DoPowerUpL  Notified message observers");
 
 
 	// Process any waiting messages
@@ -1902,7 +1898,7 @@
  */
 void CSmsProtocol::PowerDown()
     {
-    LOGSMSPROT1("CSmsProtocol::PowerDown");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_POWERDOWN_1, "CSmsProtocol::PowerDown");
     
     iSetBearer->Cancel();
     iReceiveMode->Cancel();
@@ -1933,21 +1929,21 @@
     delete iDeleteQueue; //must be deleted because uses iSmsMessaging which is soon closed
     iDeleteQueue = NULL;
     
-    LOGSMSPROT1("CSmsProtocol::PowerDown  Cancelled state machines");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_POWERDOWN_2, "CSmsProtocol::PowerDown  Cancelled state machines");
     
     NotifyMessageObservers(KIoctlSelectModemNotPresent);
-    LOGSMSPROT1("CSmsProtocol::PowerDown  Notified message observers");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_POWERDOWN_3, "CSmsProtocol::PowerDown  Notified message observers");
     
     // Close TSY handles
     iSmsMessaging.Close();
     iGsmPhone.Close();
     iEnumerationPhone.Close();
     iWritePhone.Close();
-    LOGSMSPROT1("CSmsProtocol::PowerDown  Closed TSY handles");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_POWERDOWN_4, "CSmsProtocol::PowerDown  Closed TSY handles");
     
     // Disconnect from Etel
     iTelServer.Close();
-    LOGSMSPROT1("CSmsProtocol::PowerDown  Disconnected from Etel");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_POWERDOWN_5, "CSmsProtocol::PowerDown  Disconnected from Etel");
     
     iReassemblyStore->Close();
     iSegmentationStore->Close();
@@ -1963,7 +1959,7 @@
     // (rather than the client) and the PDUs are still being deleted 
     // when last client disconnects.
     BULLSEYE_OFF
-    LOGSMSPROT1("CSmsProtocol::CloseNowWrap()");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_CLOSENOWWRAP_1, "CSmsProtocol::CloseNowWrap()");
     
     if( iDeleteQueue == NULL || !iDeleteQueue->IsActive() )
         {
@@ -1974,13 +1970,13 @@
 
 void CSmsProtocol::HandleBackupOrRestoreStartingL()
     {
-    LOGSMSPROT2("CSmsProtocol::HandleBackupOrRestoreStartingL [ModemState=%d]",  iSmsModemNotification->ModemState());
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_HANDLEBACKUPORRESTORESTARTINGL_1, "CSmsProtocol::HandleBackupOrRestoreStartingL [ModemState=%d]",  iSmsModemNotification->ModemState());
     PowerDown();
     }
 
 void CSmsProtocol::HandleBackupOrRestoreCompleteL()
     {
-    LOGSMSPROT2("CSmsProtocol::HandleBackupOrRestoreCompleteL [ModemState=%d]", iSmsModemNotification->ModemState());
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_HANDLEBACKUPORRESTORECOMPLETEL_1, "CSmsProtocol::HandleBackupOrRestoreCompleteL [ModemState=%d]", iSmsModemNotification->ModemState());
     
     if (iModemDetection == RPhone::EDetectedPresent)
         {
@@ -1993,7 +1989,7 @@
  */
 TBool CSmsProtocol::AllocateLocalAddress(TSmsAddr& aAddr)
 	{
-    LOGSMSPROT1("CSmsProtocol::AllocateLocalAddressL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ALLOCATELOCALADDRESS_1, "CSmsProtocol::AllocateLocalAddressL");
 
 	TBool found=EFalse;
 	TUint count=0,attempts=0;
@@ -2041,7 +2037,7 @@
  */
 TBool CSmsProtocol::IsAppPortSMS(const CSmsMessage& aSmsMessage)
 	{
-	LOGSMSPROT1("CSmsProtocol::IsAppPortSMS()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_ISAPPPORTSMS_1, "CSmsProtocol::IsAppPortSMS()");
 
 	TSmsAddr addr;
 	addr.SetSmsAddrFamily(ESmsAddrMatchIEI);
@@ -2071,7 +2067,7 @@
 
 const RMobilePhone::TMobilePhoneNetworkInfoV1& CSmsProtocol::NetworkInfo() const
 	{
-	LOGSMSPROT1("CSmsProtocol::NetworkInfo()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NETWORKINFO_1, "CSmsProtocol::NetworkInfo()");
 
 	return iSmsPhoneInitialization->NetworkInfo();
 	} // CSmsProtocol::NetworkInfo
@@ -2079,7 +2075,7 @@
 
 TBool CSmsProtocol::NetworkInfoAvailable() const
 	{
-	LOGSMSPROT1("CSmsProtocol::NetworkInfoAvailable()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOL_NETWORKINFOAVAILABLE_1, "CSmsProtocol::NetworkInfoAvailable()");
 
 	return iSmsPhoneInitialization->NetworkInfoAvailable();
 	} // CSmsProtocol::NetworkInfoAvailable
@@ -2095,7 +2091,7 @@
  */
 CSmsProtocolBootTimer* CSmsProtocolBootTimer::NewL(CSmsProtocol& aSmsProtocol)
     {
-    LOGSMSPROT1("CSmsProtocolBootTimer::NewL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLBOOTTIMER_NEWL_1, "CSmsProtocolBootTimer::NewL");
     
     CSmsProtocolBootTimer* self = new(ELeave) CSmsProtocolBootTimer(aSmsProtocol);
     CleanupStack::PushL(self);
@@ -2117,7 +2113,7 @@
  */
 void CSmsProtocolBootTimer::Start(const TTimeIntervalMicroSeconds32& aTimeIntervalMicroSeconds32)
 	{
-	LOGSMSPROT1("CSmsProtocolBootTimer::Start");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLBOOTTIMER_START_1, "CSmsProtocolBootTimer::Start");
 	After(aTimeIntervalMicroSeconds32);
 	}
 
@@ -2135,6 +2131,6 @@
  */
 void CSmsProtocolBootTimer::RunL()
     {
-    LOGSMSPROT2("CSmsProtocolBootTimer::RunL [iStatus=%d]", iStatus.Int() );
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPROTOCOLBOOTTIMER_RUNL_1, "CSmsProtocolBootTimer::RunL [iStatus=%d]", iStatus.Int() );
     iSmsProtocol.MessageReadedSuccessfully();
     }