telephonyserverplugins/simatktsy/src/CSatNotifySendSm.cpp
branchRCL_3
changeset 19 630d2f34d719
parent 0 3553901f7fa8
child 20 07a122eea281
--- a/telephonyserverplugins/simatktsy/src/CSatNotifySendSm.cpp	Thu Aug 19 11:03:36 2010 +0300
+++ b/telephonyserverplugins/simatktsy/src/CSatNotifySendSm.cpp	Tue Aug 31 16:23:08 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -20,6 +20,12 @@
 
 
 //INCLUDES
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "CSatNotifySendSmTraces.h"
+#endif
+
 #include <satcs.h>                  // Etel SAT IPC definitions
 #include "CSatTsy.h"                // Tsy class header
 #include "CSatNotifySendSm.h"       // Tsy class header
@@ -27,7 +33,6 @@
 #include "CBerTlv.h"                // Ber Tlv data handling
 #include "TTlv.h"					// TTlv class
 #include "CSatDataPackage.h"        // Parameter packing 
-#include "TfLogger.h"               // For TFLOGSTRING
 #include "TSatUtility.h"            // Utilities
 #include "CSatTsyReqHandleStore.h"  // Request handle class
 #include "cmmmessagemanagerbase.h"  // Message manager class for forwarding req.
@@ -42,13 +47,13 @@
         CSatNotificationsTsy* aNotificationsTsy 
         )
     {
-    TFLOGSTRING("CSAT: CSatNotifySendSm::NewL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_NEWL_1, "CSAT: CSatNotifySendSm::NewL");
    	CSatNotifySendSm* const satNotifySendSm = 
         new ( ELeave ) CSatNotifySendSm( aNotificationsTsy );
     CleanupStack::PushL( satNotifySendSm );
     satNotifySendSm->ConstructL();
     CleanupStack::Pop( satNotifySendSm );
-    TFLOGSTRING("CSAT: CSatNotifySendSm::NewL, end of method");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_NEWL_2, "CSAT: CSatNotifySendSm::NewL, end of method");
     return satNotifySendSm;
     }
 
@@ -62,7 +67,7 @@
 		// None
         )
     {
-    TFLOGSTRING("CSAT: CSatNotifySendSm::~CSatNotifySendSm");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_DTOR_1, "CSAT: CSatNotifySendSm::~CSatNotifySendSm");
     }
     
 // -----------------------------------------------------------------------------
@@ -88,7 +93,7 @@
         // None
         )
     {
-    TFLOGSTRING("CSAT: CSatNotifySendSm::ConstructL, does nothing");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CONSTRUCTL_1, "CSAT: CSatNotifySendSm::ConstructL, does nothing");
     }
     
 // -----------------------------------------------------------------------------
@@ -102,7 +107,7 @@
         const TDataPackage& aPackage
         )
     {
-    TFLOGSTRING("CSAT: CSatNotifySendSm::Notify");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_NOTIFY_1, "CSAT: CSatNotifySendSm::Notify");
     // Save data pointer to client side for completion
     iSendSmV1Pckg = reinterpret_cast<RSat::TSendSmV1Pckg*>( 
         aPackage.Des1n() );
@@ -124,7 +129,7 @@
         const TTsyReqHandle aTsyReqHandle 
         )
     {
-    TFLOGSTRING("CSAT: CSatNotifySendSm::CancelNotification");   
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CANCELNOTIFICATION_1, "CSAT: CSatNotifySendSm::CancelNotification");
     // Reset the request handle
     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
         ResetTsyReqHandle( CSatTsy::ESatNotifySendSmPCmdReqType );
@@ -147,7 +152,7 @@
         TInt aErrorCode                 
         )
     {
-    TFLOGSTRING("CSAT: CSatNotifySendSm::CompleteNotifyL");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_COMPLETENOTIFYL_1, "CSAT: CSatNotifySendSm::CompleteNotifyL");
     TInt ret( KErrNone );
 	TBuf<1> additionalInfo;
 	// Unpack parameters
@@ -195,8 +200,7 @@
 				
 				if ( KErrCorrupt == ret )
 					{
-					TFLOGSTRING("CSAT: CSatNotifySendSm::CompleteNotifyL,\
-					    Invalid data");
+					OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_COMPLETENOTIFYL_2, "CSAT: CSatNotifySendSm::CompleteNotifyL, Invalid data");
 					additionalInfo.Zero();
                     additionalInfo.Append( KNoCause );
 					CreateTerminalRespL( pCmdNumber, 
@@ -221,8 +225,7 @@
 						ret = PackSms( smsTpdu, sendSmV1.iSmsTpdu );
 						if ( KErrNone != ret )
 							{
-							TFLOGSTRING("CSAT: CSatNotifySendSm::\
-							    CompleteNotifyL, Invalid TPDU");
+							OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_COMPLETENOTIFYL_3, "CSAT: CSatNotifySendSm::CompleteNotifyL, Invalid TPDU");
 							// TPDU is invalid or packing cannot be requested 
 							// if tpdu is something else than SMS-SUBMIT
 							additionalInfo.Zero();
@@ -238,8 +241,7 @@
 						}
 					else
 						{
-						TFLOGSTRING("CSAT: CSatNotifySendSm::CompleteNotifyL,\
-						    Packing not required");
+						OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_COMPLETENOTIFYL_4, "CSAT: CSatNotifySendSm::CompleteNotifyL, Packing not required");
 						}
 					}
 				else
@@ -249,8 +251,7 @@
 				}
 			else
 				{
-				TFLOGSTRING("CSAT: CSatNotifySendSm::CompleteNotifyL,\
-				    Missing TPDU");
+				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_COMPLETENOTIFYL_5, "CSAT: CSatNotifySendSm::CompleteNotifyL, Missing TPDU");
 				// TPdu is missing, returning response immediately
 				additionalInfo.Zero();
                 additionalInfo.Append( KNoCause );
@@ -277,8 +278,7 @@
         } // End of if ( CSatTsy::ESatReqHandleUnknown != reqHandle )
 	else
 		{
-		TFLOGSTRING("CSAT: CSatNotifySendSm::CompleteNotifyL,\
-		    Request not ongoing");
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_COMPLETENOTIFYL_6, "CSAT: CSatNotifySendSm::CompleteNotifyL, Request not ongoing");
 		// Request not on, returning response immediately
 		additionalInfo.Zero();
         additionalInfo.Append( KNoCause );       
@@ -298,7 +298,7 @@
         TDes8* aRsp 
         )
     {  
-    TFLOGSTRING( "CSAT::CSatNotifySendSm::TerminalResponseL" );
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_TERMINALRESPONSEL_1,  "CSAT::CSatNotifySendSm::TerminalResponseL" );
     
     TInt ret( KErrNone );
     TBuf<1> additionalInfo;
@@ -307,8 +307,7 @@
     RSat::TSendSmRspV1& rspV1 = ( *aRspPckg ) ();
     // Get Proactive command number
     TUint8 pCmdNumber( rspV1.PCmdNumber() );
-    TFLOGSTRING2( "CSAT::CSatNotifySendSm::TerminalResponseL: GeneralResult: \
-        %d", static_cast<TUint8>( rspV1.iGeneralResult ) );
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_TERMINALRESPONSEL_2,  "CSAT::CSatNotifySendSm::TerminalResponseL: GeneralResult: %d", static_cast<TUint8>( rspV1.iGeneralResult ) );
 
     // Check that general result value is valid
     if ( ( RSat::KSuccess != rspV1.iGeneralResult ) && 
@@ -319,8 +318,7 @@
          ( RSat::KModifiedByCallControl != rspV1.iGeneralResult ) && 
          ( RSat::KSuccessRequestedIconNotDisplayed != rspV1.iGeneralResult ) )        
         {
-        TFLOGSTRING( "CSAT::CSatNotifySendSm::TerminalResponseL,\
-            Invalid General result" );
+        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_TERMINALRESPONSEL_3,  "CSAT::CSatNotifySendSm::TerminalResponseL, Invalid General result" );
         // Invalid general result
         ret = KErrCorrupt;
         }
@@ -334,8 +332,7 @@
         // Check the length of additional info
         if ( 0 == rspV1.iAdditionalInfo.Length() )
             {
-            TFLOGSTRING( "CSAT::CSatNotifySendSm::TerminalResponseL,\
-                Invalid Additional Info" );
+            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_TERMINALRESPONSEL_4,  "CSAT::CSatNotifySendSm::TerminalResponseL, Invalid Additional Info" );
             // No info
             ret = KErrCorrupt;
             }
@@ -371,7 +368,7 @@
         TDesC16& aAdditionalInfo		
 		)
     {
-    TFLOGSTRING( "CSAT::CSatNotifySendSm::CreateTerminalRespL" );
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CREATETERMINALRESPL_1,  "CSAT::CSatNotifySendSm::CreateTerminalRespL" );
     // Create and append response data
     TTlv tlvSpecificData;
     // Create General Result TLV here
@@ -386,8 +383,7 @@
         {
 		if( aAdditionalInfo.Length() > 0 )
 	        {
-	        TFLOGSTRING( "CSAT::CSatNotifySendSm::CreateTerminalRespL,\
-	            Unsuccessful result" );
+	        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CREATETERMINALRESPL_2,  "CSAT::CSatNotifySendSm::CreateTerminalRespL, Unsuccessful result" );
 	        // If there is ME, Network or SMS error, append additional info
 	        tlvSpecificData.AddByte( static_cast<TUint8>( aAdditionalInfo[0] ) );
 	        }
@@ -419,7 +415,7 @@
 		RSat::TSendSmV1& aSendSmV1
 		)
 	{
-	TFLOGSTRING( "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData" );
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_SETALPHAIDANDADDRESSDATA_1,  "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData" );
 	TInt returnValue;
 	TPtrC8 sourceString; // Used in unicode conversions
 	// Alpha id string (optional)
@@ -447,15 +443,13 @@
 			}
 		else
 			{
-			TFLOGSTRING( "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData,\
-			    Alpha ID is NULL" );
+			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_SETALPHAIDANDADDRESSDATA_2,  "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData, Alpha ID is NULL" );
 			aSendSmV1.iAlphaId.iStatus = RSat::EAlphaIdNull;
 			}
 		}
 	else 
 		{
-		TFLOGSTRING( "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData,\
-		    Alpha ID not present" );
+		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_SETALPHAIDANDADDRESSDATA_3,  "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData, Alpha ID not present" );
 		aSendSmV1.iAlphaId.iStatus = RSat::EAlphaIdNotPresent;
 		}
 	// The address data object holds the RP_Destination_Address of the Service 
@@ -491,13 +485,11 @@
 				// Converting back to ASCII format
 				TSatUtility::BCDToAscii( sourceString, tempScaNumber );
 				aSendSmV1.iAddress.iTelNumber.Copy( tempScaNumber );
-				TFLOGSTRING2("CSAT: SendSm, SCA number: %S", 
-					&aSendSmV1.iAddress.iTelNumber );
+				OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_SETALPHAIDANDADDRESSDATA_4, "CSAT: SendSm, SCA number: %S", aSendSmV1.iAddress.iTelNumber );
 				}
        		else
       			{
-      			TFLOGSTRING( "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData\
-      			    Address TLV found, TON/NPI present, but number epmpty" );
+      			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_SETALPHAIDANDADDRESSDATA_5,  "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData Address TLV found, TON/NPI present, but number epmpty" );
         		// Address TLV found, TON/NPI present, but number epmpty.
        			aSendSmV1.iAddress.iTypeOfNumber = RSat::EUnknownNumber;
         		aSendSmV1.iAddress.iNumberPlan = RSat::EUnknownNumberingPlan;
@@ -505,8 +497,7 @@
 		    }
 		else
 		    {
-		    TFLOGSTRING( "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData\
-		        Address TLV found, but the Value part doesn't exist");
+		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_SETALPHAIDANDADDRESSDATA_6,  "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData Address TLV found, but the Value part doesn't exist");
 		    // Address TLV found, but the Value part doesn't exist
 		    aSendSmV1.iAddress.iTypeOfNumber = RSat::EUnknownNumber;
 		    aSendSmV1.iAddress.iNumberPlan = RSat::EUnknownNumberingPlan;
@@ -514,8 +505,7 @@
 		}
 	else
 	    {
-	    TFLOGSTRING( "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData\
-	        Address TLV not found");
+	    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_SETALPHAIDANDADDRESSDATA_7,  "CSAT::CSatNotifySendSm::SetAlphaIdAndAddressData Address TLV not found");
 	    // Address TLV not found
 	    aSendSmV1.iAddress.iTypeOfNumber = RSat::ETypeOfNumberNotSet;
 	    aSendSmV1.iAddress.iNumberPlan = RSat::ENumberingPlanNotSet;  
@@ -532,7 +522,7 @@
 	    TPtrC8 aTpdu    
 	    )
     {
-    TFLOGSTRING( "CSAT::CSatNotifySendSm::CheckTpdu");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CHECKTPDU_1,  "CSAT::CSatNotifySendSm::CheckTpdu");
     TInt ret( KErrNone );
 
     if ( KSATSmsMTISubmitOrSubmitReport == ( aTpdu[0] & KMask3 ) ) 
@@ -545,8 +535,7 @@
         
         if ( !dcs && KSmsMaxSize < tpUdl )
             {
-            TFLOGSTRING( "CSAT::CSatNotifySendSm::CheckTpdu,\
-                False DCS Length");
+            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CHECKTPDU_2,  "CSAT::CSatNotifySendSm::CheckTpdu, False DCS Length");
             // DCS is 7-bit and message is over 160 bytes, set ret to corrupt
             ret = KErrCorrupt;
             }
@@ -554,15 +543,13 @@
         	iTerminalRespData.iCommandDetails[KCommandQualifier] ) )
             && ( KSmsMaxSizeWithoutPacking < tpUdl && dcs ) )
             {
-            TFLOGSTRING( "CSAT::CSatNotifySendSm::CheckTpdu,\
-                TP-UD Too long without packing");
+            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CHECKTPDU_3,  "CSAT::CSatNotifySendSm::CheckTpdu, TP-UD Too long without packing");
             // TP-UD is too long without packing
             ret = KErrCorrupt;
             }
         else if ( ( KSmsMaxSize < tpUdl ) && dcs )
             {
-            TFLOGSTRING( "CSAT::CSatNotifySendSm::CheckTpdu,\
-                TP-UD is too long even with packing");
+            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CHECKTPDU_4,  "CSAT::CSatNotifySendSm::CheckTpdu, TP-UD is too long even with packing");
             // TP-UD is too long even with packing
             ret = KErrCorrupt;
             }
@@ -576,8 +563,7 @@
         // SMS-COMMAND
         if ( KSMSCommandMaxSize < GetTpUdl( aTpdu ) )
             {
-            TFLOGSTRING( "CSAT::CSatNotifySendSm::CheckTpdu,\
-                False SMS Command length");
+            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_CHECKTPDU_5,  "CSAT::CSatNotifySendSm::CheckTpdu, False SMS Command length");
             ret = KErrCorrupt;
             }
 		else
@@ -600,7 +586,7 @@
 	    TPtrC8 aTpdu  
 	    )
     {
-    TFLOGSTRING( "CSAT::CSatNotifySendSm::GetTpUdl");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_GETTPUDL_1,  "CSAT::CSatNotifySendSm::GetTpUdl");
     TUint8 ret( 0 );
     if ( KSATSmsMTISubmitOrSubmitReport == ( aTpdu[0] & KMask3 ) )
         {
@@ -675,7 +661,7 @@
 	    TPtrC8 aTpdu 
 	    )
     {
-    TFLOGSTRING( "CSAT::CSatNotifySendSm::GetTpDcs");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_GETTPDCS_1,  "CSAT::CSatNotifySendSm::GetTpDcs");
     TUint8 retValue( NULL );
     if ( KSATSmsMTISubmitOrSubmitReport == ( aTpdu[0] & KMask3 ) )
         {
@@ -711,7 +697,7 @@
 	    TTpdu& aSendSm  
 	    )
     {
-    TFLOGSTRING( "CSAT::CSatNotifySendSm::PackSms");
+    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_PACKSMS_1,  "CSAT::CSatNotifySendSm::PackSms");
     // See 3GPP TS 23.040 and TS 23.038: 
     // Packing of Basic elements of the SMS SUBMIT type
     TInt ret( KErrNone );
@@ -797,7 +783,7 @@
             }
         else
             {
-            TFLOGSTRING( "CSAT::CSatNotifySendSm::PackSms, No headers");
+            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_PACKSMS_2,  "CSAT::CSatNotifySendSm::PackSms, No headers");
             // No headers, lets pack all the characters in SMS message
             TBool endOfTPDU( EFalse );
             TUint8 move( 0 );
@@ -843,7 +829,7 @@
                     }
                 else
                     {
-                    TFLOGSTRING( "CSAT::CSatNotifySendSm::PackSms, Corrupted");
+                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSENDSM_PACKSMS_3,  "CSAT::CSatNotifySendSm::PackSms, Corrupted");
                     ret = KErrCorrupt;
                     break;
                     }