usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/ActiveWriter.cpp
branchRCL_3
changeset 15 f92a4f87e424
parent 0 c9bc50fca66e
child 16 012cc2ee6408
--- a/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/ActiveWriter.cpp	Thu Jul 15 20:42:20 2010 +0300
+++ b/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/ActiveWriter.cpp	Tue Aug 31 17:01:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* 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"
@@ -22,11 +22,11 @@
 #include "AcmPanic.h"
 #include "WriteObserver.h"
 #include "AcmUtils.h"
-#include <usb/usblogger.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "ActiveWriterTraces.h"
+#endif
 
-#ifdef __FLOG_ACTIVE
-_LIT8(KLogComponent, "ECACM");
-#endif
 
 CActiveWriter::CActiveWriter(MWriteObserver& aParent, RDevUsbcClient& aLdd, TEndpointNumber aEndpoint)
  :	CActive(KEcacmAOPriority), 
@@ -44,7 +44,9 @@
  * @param aEndpoint The endpoint to write to.
  */
 	{
+	OstTraceFunctionEntry0( CACTIVEWRITER_CACTIVEWRITER_CONS_ENTRY );
 	CActiveScheduler::Add(this);
+	OstTraceFunctionExit0( CACTIVEWRITER_CACTIVEWRITER_CONS_EXIT );
 	}
 
 CActiveWriter::~CActiveWriter()
@@ -52,9 +54,9 @@
  * Destructor.
  */
 	{
-	LOG_FUNC
-
+	OstTraceFunctionEntry0( CACTIVEWRITER_CACTIVEWRITER_DES_ENTRY );
 	Cancel();
+	OstTraceFunctionExit0( CACTIVEWRITER_CACTIVEWRITER_DES_EXIT );
 	}
 
 CActiveWriter* CActiveWriter::NewL(MWriteObserver& aParent, 
@@ -70,9 +72,9 @@
  * @return Ownership of a new CActiveWriter object.
  */
 	{
-	LOG_STATIC_FUNC_ENTRY
-
+	OstTraceFunctionEntry0( CACTIVEWRITER_NEWL_ENTRY );
 	CActiveWriter* self = new(ELeave) CActiveWriter(aParent, aLdd, aEndpoint);
+	OstTraceFunctionExit0( CACTIVEWRITER_NEWL_EXIT );
 	return self;
 	}
 
@@ -87,8 +89,8 @@
  * @param aZlp Whether ZLP termination may be required.
  */
 	{
-	LOGTEXT(_L8(">>CActiveWriter::Write"));
-
+	OstTraceFunctionEntry0( CACTIVEWRITER_WRITE_ENTRY );
+	
 	if ( aZlp )
 		{
 		// the driver can be relied on to correctly handle appended ZLPs
@@ -109,7 +111,7 @@
 			{
 			iLdd.Write(iStatus, iEndpoint, aDes, aLen, EFalse);
 			iWritingState = ECompleteMessage;
-			LOGTEXT2(_L8("CActiveWriter::Writing %d bytes"), aLen);
+			OstTrace1( TRACE_NORMAL, CACTIVEWRITER_WRITE, "CActiveWriter::Write;Writing %d bytes", aLen );
 			}
 		else
 			{
@@ -125,12 +127,12 @@
 			iLdd.Write(iStatus, iEndpoint, iFirstPortion, aLen-1, EFalse);
 			
 			iWritingState = EFirstMessagePart;
-			LOGTEXT3(_L8("CActiveWriter::Writing %d bytes of the %d"), aLen-1, aLen);
+			OstTraceExt2( TRACE_NORMAL, CACTIVEWRITER_WRITE_DUP1, 
+					"CActiveWriter::Write;Writing %d bytes of the %d", aLen-1, aLen );
 			}
 		}
 	SetActive();
-
-	LOGTEXT(_L8("<<CActiveWriter::Write"));
+	OstTraceFunctionExit0( CACTIVEWRITER_WRITE_EXIT );
 	}
 
 void CActiveWriter::DoCancel()
@@ -138,9 +140,9 @@
  * Cancel an outstanding write.
  */
 	{
-	LOG_FUNC
-
+	OstTraceFunctionEntry0( CACTIVEWRITER_DOCANCEL_ENTRY );
 	iLdd.WriteCancel(iEndpoint);
+	OstTraceFunctionExit0( CACTIVEWRITER_DOCANCEL_EXIT );
 	}
 
 void CActiveWriter::RunL()
@@ -149,8 +151,8 @@
  * parent class of the completion.
  */
 	{
-	LOG_LINE
-	LOGTEXT2(_L8(">>CActiveWriter::RunL iStatus=%d"), iStatus.Int());
+	OstTraceFunctionEntry0( CACTIVEWRITER_RUNL_ENTRY );
+	OstTrace1( TRACE_NORMAL, CACTIVEWRITER_RUNL, "CActiveWriter::RunL;iStatus=%d", iStatus.Int() );
 	
 	if ( iWritingState == EFirstMessagePart )
 		{
@@ -159,8 +161,8 @@
 			// now send the second part..
 			iLdd.Write(iStatus, iEndpoint, iSecondPortion, iSecondPortion.Length(), EFalse);
 			iWritingState = EFinalMessagePart;
-			LOGTEXT(_L8("CActiveWriter::Writing 1 byte to complete original nx64 byte message"));
-
+			OstTrace0( TRACE_NORMAL, CACTIVEWRITER_RUNL_DUP1, 
+					"CActiveWriter::RunL;Writing 1 byte to complete original nx64 byte message" );
 			SetActive();
 			}
 		else
@@ -175,7 +177,7 @@
 		iParent.WriteCompleted(iStatus.Int());
 		}
 		
-	LOGTEXT(_L8("<<CActiveWriter::RunL"));
+	OstTraceFunctionExit0( CACTIVEWRITER_RUNL_EXIT );
 	}
 
 //