kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp
changeset 259 57b9594f5772
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp	Wed Aug 18 11:08:29 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/Ep0Reader.cpp	Thu Sep 02 21:54:16 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -16,28 +16,36 @@
 
 #include "Ep0Reader.h"
 #include "testdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "Ep0ReaderTraces.h"
+#endif
 
 namespace NUnitTesting_USBDI
 	{
 	
 CDeviceEndpoint0* CDeviceEndpoint0::NewL(MRequestHandler& aRequestHandler)
 	{
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_NEWL_ENTRY, ( TUint )&( aRequestHandler ) );
 	CDeviceEndpoint0* self = new (ELeave) CDeviceEndpoint0();
 	CleanupStack::PushL(self);
 	self->ConstructL(aRequestHandler);
 	CleanupStack::Pop(self);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_NEWL_EXIT, ( TUint )( self ) );
 	return self;
 	}
 	
 	
 CDeviceEndpoint0::CDeviceEndpoint0()
 	{
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY, this );
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT, this );
 	}	
 	
 	
 CDeviceEndpoint0::~CDeviceEndpoint0()
 	{
-	LOG_FUNC
+    OstTraceFunctionEntry1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_ENTRY_DUP01, this );
 
 	// Destroy the reader/writer
 	delete iEndpoint0Writer; 
@@ -45,16 +53,17 @@
 	
 	// Close channel to the driver
 	iClientDriver.Close();
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_CDEVICEENDPOINT0_EXIT_DUP01, this );
 	}
 	
 	
 void CDeviceEndpoint0::ConstructL(MRequestHandler& aRequestHandler)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_CONSTRUCTL_ENTRY, this );
 	TInt err(iClientDriver.Open(0));
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
+		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_CONSTRUCTL, "<Error %d> Unable to open a channel to USB client driver",err);
 		User::Leave(err);
 		}
 	
@@ -63,12 +72,13 @@
 	
 	// Create the writer of data on device endpoint 0
 	iEndpoint0Writer = new (ELeave) CEndpointWriter(iClientDriver,EEndpoint0);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_CONSTRUCTL_EXIT, this );
 	}
 
 	
 TInt CDeviceEndpoint0::Start()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_START_ENTRY, this );
 	
 	// Make this channel to the driver able to get device directed ep0 requests
 	TInt err(iClientDriver.SetDeviceControl());
@@ -76,20 +86,22 @@
 	// Check operation success
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to obtain device control",err);
+		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_START, "<Error %d> Unable to obtain device control",err);
+		OstTraceFunctionExitExt( CDEVICEENDPOINT0_START_EXIT, this, err );
 		return err;
 		}
 		
 	// Start reading for requests from host
 	TRAP(err,iEndpoint0Reader->ReadRequestsL());
 	
+	OstTraceFunctionExitExt( CDEVICEENDPOINT0_START_EXIT_DUP01, this, err );
 	return err;
 	}
 
 
 TInt CDeviceEndpoint0::Stop()
 	{
-	LOG_FUNC
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_STOP_ENTRY, this );
 	// Cancel the data reader and writer
 	iEndpoint0Writer->Cancel();
 	iEndpoint0Reader->Cancel();
@@ -98,26 +110,32 @@
 	TInt err(iClientDriver.ReleaseDeviceControl());
 	if(err != KErrNone)
 		{
-		RDebug::Printf("<Error %d> Unable to release device control",err);
+		OstTrace1(TRACE_NORMAL, CDEVICEENDPOINT0_STOP, "<Error %d> Unable to release device control",err);
 		}
+	OstTraceFunctionExitExt( CDEVICEENDPOINT0_STOP_EXIT, this, err );
 	return err;
 	}
 
 
 void CDeviceEndpoint0::SendData(const TDesC8& aData)
 	{
-	LOG_FUNC
+	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_SENDDATA_ENTRY, this );
 	iEndpoint0Writer->Write(aData, ETrue);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_SENDDATA_EXIT, this );
 	}
 
 TInt CDeviceEndpoint0::SendDataSynchronous(const TDesC8& aData)
 	{
-	LOG_FUNC
-	return iEndpoint0Writer->WriteSynchronous(aData, ETrue);
+	OstTraceFunctionEntryExt( CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_ENTRY, this );
+	TInt ret = iEndpoint0Writer->WriteSynchronous(aData, ETrue);
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_SENDDATASYNCHRONOUS_EXIT, this );
+	return ret;
 	}
 
 CControlEndpointReader& CDeviceEndpoint0::Reader()
 	{
+	OstTraceFunctionEntry1( CDEVICEENDPOINT0_READER_ENTRY, this );
+	OstTraceFunctionExit1( CDEVICEENDPOINT0_READER_EXIT, this );
 	return *iEndpoint0Reader;
 	}