smsprotocols/smsstack/smsprot/Src/smspbear.cpp
changeset 42 3adadc800673
parent 0 3553901f7fa8
child 66 07a122eea281
--- a/smsprotocols/smsstack/smsprot/Src/smspbear.cpp	Thu May 27 14:05:07 2010 +0300
+++ b/smsprotocols/smsstack/smsprot/Src/smspbear.cpp	Fri Jun 11 14:49:29 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -17,6 +17,12 @@
  @file
 */
 
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "smspbearTraces.h"
+#endif
+
 #include <commsdattypesv1_1.h>
 #include <cdbcols.h>
 #include "smspmain.h"
@@ -38,7 +44,7 @@
  */
 CSmspSetBearer* CSmspSetBearer::NewL(const TSmsSettings& aSmsSettings,RMobileSmsMessaging& aSmsMessaging, TInt aPriority)
 	{
-	LOGSMSPROT2("CSmspSetBearer::NewL aPriority = %d", aPriority);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_NEWL_1, "CSmspSetBearer::NewL aPriority = %d", aPriority);
 
 	CSmspSetBearer* smsSetBearer=new(ELeave) CSmspSetBearer(aSmsSettings,aSmsMessaging, aPriority);
 	CleanupStack::PushL(smsSetBearer);
@@ -54,7 +60,7 @@
  */
 void CSmspSetBearer::ConstructL()
 	{
-	LOGSMSPROT1("CSmspSetBearer::ConstructL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_CONSTRUCTL_1, "CSmspSetBearer::ConstructL()");
 
 	CSmspCommDbEvent::ConstructL();
 
@@ -92,7 +98,7 @@
  */
 void CSmspSetBearer::NotifyBearerSet(TRequestStatus& aStatus)
 	{
-	LOGSMSPROT2("CSmspSetBearer::NotifyBearerSet, aStatus = %d", aStatus.Int());
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_NOTIFYBEARERSET_1, "CSmspSetBearer::NotifyBearerSet, aStatus = %d", aStatus.Int());
 	if (!iBearerSet && IsActive())
 		{
 		Cancel();
@@ -102,12 +108,12 @@
 
 	if (iBearerSet)
 		{
-		LOGSMSPROT1("CSmspSetBearer::NotifyBearerSet RequestComplete called");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_NOTIFYBEARERSET_2, "CSmspSetBearer::NotifyBearerSet RequestComplete called");
 		CSmsuActiveBase::Complete(KErrNone);
 		}
 	else
 		{
-		LOGSMSPROT1("CSmspSetBearer::NotifyBearerSet started");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_NOTIFYBEARERSET_3, "CSmspSetBearer::NotifyBearerSet started");
 		Start();
 		}
 	} // CSmspSetBearer::NotifyBearerSet
@@ -118,7 +124,7 @@
  */
 void CSmspSetBearer::Start()
 	{
-	LOGSMSPROT1("CSmspSetBearer::Start");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_START_1, "CSmspSetBearer::Start");
 	// Cancel any outstanding request
 	TRAPD(err, GetSmsBearerL(iBearer));
 
@@ -126,7 +132,7 @@
 
 	if (err == KErrNone)
 		{
-		LOGSMSPROT2("CSmspSetBearer::GetSmsBearerL() left with %d", err);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_START_2, "CSmspSetBearer::GetSmsBearerL() left with %d", err);
 
 		// Set the previous bearer to the one that has been read
 		// from CommDB so that iPreviousBearer has an initial value
@@ -136,7 +142,7 @@
 		}
 	else
 		{
-		LOGSMSPROT2("CSmspSetBearer::Start failed to get SMS bearer, error = %d", err);
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_START_3, "CSmspSetBearer::Start failed to get SMS bearer, error = %d", err);
 		Complete(err);
 		}
 	} // CSmspSetBearer::Start
@@ -151,7 +157,7 @@
  */
 void CSmspSetBearer::DoRunL()
 	{
-	LOGSMSPROT3("CSmspSetBearer::DoRunL(): iState=%d iStatus=%d", iState, iStatus.Int());
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DORUNL_1, "CSmspSetBearer::DoRunL(): iState=%d iStatus=%d", iState, iStatus.Int());
 
 	switch (iState)
 		{
@@ -170,13 +176,13 @@
 				TRAPD(err, globalSettingsRecord.LoadL(*dbSession));
 				if (err != KErrNone)
 					{
-					LOGSMSPROT2("CSmspSetBearer::DoRunL, could not load global settings, leave error code = %d", err);
+					OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DORUNL_2, "CSmspSetBearer::DoRunL, could not load global settings, leave error code = %d", err);
 					User::Leave(err);
 					}
 
 				iPreviousBearer = iBearer;
 
-				LOGSMSPROT2("CSmspSetBearer::DoRunL Storing previous bearer setting. Previous bearer now = %d", iBearer);
+				OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DORUNL_3, "CSmspSetBearer::DoRunL Storing previous bearer setting. Previous bearer now = %d", iBearer);
 
 				tempBearer = ((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iSMSBearer;
 				iBearer = static_cast<RMobileSmsMessaging::TMobileSmsBearer>(tempBearer);
@@ -204,10 +210,10 @@
 				// (e.g. KErrNotSupported)
 				// Set global setting to previous value,
 				// then complete.
-				LOGSMSPROT3("CSmspSetBearer::DoRunL TSY failed to set MO SMS bearer. status = %d. Bearer = %d", iStatus.Int(), iBearer);
+				OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DORUNL_4, "CSmspSetBearer::DoRunL TSY failed to set MO SMS bearer. status = %d. Bearer = %d", iStatus.Int(), iBearer);
 
 				iBearer = iPreviousBearer;
-				LOGSMSPROT2("CSmspSetBearer::DoRunL Setting bearer back to previous setting. Bearer = %d", iBearer);
+				OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DORUNL_5, "CSmspSetBearer::DoRunL Setting bearer back to previous setting. Bearer = %d", iBearer);
 
 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
 				CMDBSession *dbSession = CMDBSession::NewL(KCDVersion1_2);
@@ -219,7 +225,7 @@
 				TRAPD(err, globalSettingsRecord.LoadL(*dbSession));
 				if (err != KErrNone)
 					{
-					LOGSMSPROT2("CSmspSetBearer::DoRunL could not load global settings, error = %d", err);
+					OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DORUNL_6, "CSmspSetBearer::DoRunL could not load global settings, error = %d", err);
 					User::Leave(err);
 					}
 
@@ -227,7 +233,7 @@
 				TRAP(err, globalSettingsRecord.ModifyL(*dbSession));
 				if (err != KErrNone)
 					{
-					LOGSMSPROT2("CSmspSetBearer::DoRunL could not modify global settings, error = %d", err);
+					OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DORUNL_7, "CSmspSetBearer::DoRunL could not modify global settings, error = %d", err);
 					User::Leave(err);
 					}
 
@@ -256,7 +262,7 @@
  */
 void CSmspSetBearer::DoCancel()
 	{
-	LOGSMSPROT1("CSmspSetBearer::DoCancel");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_DOCANCEL_1, "CSmspSetBearer::DoCancel");
 
 	TimedSetActiveCancel();
 
@@ -313,7 +319,7 @@
  */
 void CSmspSetBearer::GetSmsBearerL(RMobileSmsMessaging::TMobileSmsBearer& aBearer)
 	{
-	LOGSMSPROT1("CSmspSetBearer::GetSmsBearerL()");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_GETSMSBEARERL_1, "CSmspSetBearer::GetSmsBearerL()");
 	
 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
 	CMDBSession* sess = CMDBSession::NewL(KCDVersion1_2);
@@ -331,7 +337,7 @@
 	smsBearerField->LoadL(*sess);
 
 	aBearer = static_cast<RMobileSmsMessaging::TMobileSmsBearer>(static_cast<TUint32>(*smsBearerField));
-	LOGSMSPROT2("CSmspSetBearer::GetSmsBearerL(): aBearer=%d", aBearer);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_GETSMSBEARERL_2, "CSmspSetBearer::GetSmsBearerL(): aBearer=%d", aBearer);
 
 	CleanupStack::PopAndDestroy(smsBearerField);
 	CleanupStack::PopAndDestroy(sess);
@@ -344,7 +350,7 @@
  */
 void CSmspSetBearer::SetSmsBearer()
 	{
-	LOGSMSPROT2("CSmspSetBearer::SetSmsBearer, iBearer = %d", iBearer);
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_SETSMSBEARER_1, "CSmspSetBearer::SetSmsBearer, iBearer = %d", iBearer);
 
 	iBearerSet = EFalse;
 	iState = ESmsSetBearerStateSettingBearer;
@@ -359,7 +365,7 @@
  */
 void CSmspSetBearer::NotifyOnEvent()
 	{
-	LOGSMSPROT1("CSmspSetBearer::NotifyOnEvent");
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSPSETBEARER_NOTIFYONEVENT_1, "CSmspSetBearer::NotifyOnEvent");
 
 	iState = ESmsSetBearerNotifyOnEvent;
 	CSmspCommDbEvent::NotifyOnEvent();