diff -r c1f20ce4abcf -r 3e88ff8f41d5 kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp --- a/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp Tue Aug 31 16:34:26 2010 +0300 +++ b/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp Wed Sep 01 12:34:56 2010 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2009 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" @@ -25,10 +25,6 @@ #include "controltransferrequests.h" #include "testinterfacebase.h" #include "PBASE-T_USBDI-0486.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "TestDeviceBaseTraces.h" -#endif #include namespace NUnitTesting_USBDI @@ -41,8 +37,6 @@ iConnectTimer(NULL), iWakeupTimer(NULL), iAuxBuffer(NULL) { - OstTraceFunctionEntry1( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY, this ); - OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT, this ); } RUsbTestDevice::RUsbTestDevice(CBaseTestCase* aTestCase) @@ -52,29 +46,25 @@ iConnectTimer(NULL), iWakeupTimer(NULL), iAuxBuffer(NULL) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP01, this ); + LOG_FUNC iTestCase = aTestCase; - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_RUSBTESTDEVICE, "iTestCase = %d", iTestCase); - OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP01, this ); + RDebug::Printf("iTestCase = %d", iTestCase); } void RUsbTestDevice::ResetState() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_RESETSTATE_ENTRY, this ); iCurrentState = EUsbcDeviceStateUndefined; - OstTraceFunctionExit1( RUSBTESTDEVICE_RESETSTATE_EXIT, this ); } RUsbTestDevice::~RUsbTestDevice() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_RUSBTESTDEVICE_ENTRY_DUP02, this ); + LOG_FUNC - OstTraceFunctionExit1( RUSBTESTDEVICE_RUSBTESTDEVICE_EXIT_DUP02, this ); } void RUsbTestDevice::Close() { -OstTraceFunctionEntry1( RUSBTESTDEVICE_CLOSE_ENTRY, this ); + LOG_FUNC delete iWakeupTimer; delete iConnectTimer; @@ -95,44 +85,41 @@ TInt r = RProperty::Define(KWordOfDeathCat, KWordOfDeathKey, RProperty::EInt,KAllowAllPolicy, KAllowAllPolicy, 0); if(r != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_CLOSE, "Could not create the WordOfDeath P&S (%d)", r); + RDebug::Print(_L("Could not create the WordOfDeath P&S (%d)"), r); } - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_CLOSE_DUP01, "killing t_usbhost_usbman.exe"); + RDebug::Printf("killing t_usbhost_usbman.exe"); RProperty::Set(KWordOfDeathCat, KWordOfDeathKey, KErrAbort); // Send the word of death User::After(1000000); //allow time for t_usbhost_usbman.exe to clean up } - OstTraceFunctionExit1( RUSBTESTDEVICE_CLOSE_EXIT, this ); } void RUsbTestDevice::SubscribeToReports(TRequestStatus& aObserverStatus) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_SUBSCRIBETOREPORTS_ENTRY, this ); + LOG_FUNC // Signal the request as pending iObserverStatus = &aObserverStatus; *iObserverStatus = KRequestPending; - OstTraceFunctionExit1( RUSBTESTDEVICE_SUBSCRIBETOREPORTS_EXIT, this ); } void RUsbTestDevice::CancelSubscriptionToReports() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_ENTRY, this ); + LOG_FUNC // Signal the request as cancelled User::RequestComplete(iObserverStatus,KErrCancel); - OstTraceFunctionExit1( RUSBTESTDEVICE_CANCELSUBSCRIPTIONTOREPORTS_EXIT, this ); } void RUsbTestDevice::OpenL() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_OPENL_ENTRY, this ); + LOG_FUNC TInt err = KErrNone; - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL, "starting t_usbhost_usbman.exe"); + RDebug::Printf("starting t_usbhost_usbman.exe"); TInt r = iOtgUsbMan.Create(_L("t_usbhost_usbman.exe"), _L("client")); gtest(r == KErrNone); iOtgUsbMan.Resume(); @@ -143,7 +130,7 @@ err = iClientDriver.Open(0); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP01, " Unable to open a channel to USB client driver",err); + RDebug::Printf(" Unable to open a channel to USB client driver",err); User::Leave(err); } @@ -151,7 +138,7 @@ err = iClientDriver.DeviceDisconnectFromHost(); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP02, " unable to disconnect device from host",err); + RDebug::Printf(" unable to disconnect device from host",err); User::Leave(err); } @@ -169,29 +156,28 @@ _LIT8(KYes, "yes"); _LIT8(KNo, "no"); User::LeaveIfError(iClientDriver.DeviceCaps(iDeviceCaps)); - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP03, "------ USB device capabilities -------"); - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP04, "Number of endpoints: %d",iDeviceCaps().iTotalEndpoints); - OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP05, "Supports Software-Connect: %s",iDeviceCaps().iConnect ? KYes() : KNo()); - OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP06, "Device is Self-Powered: %S",iDeviceCaps().iSelfPowered ? KYes() : KNo()); - OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP07, "Supports Remote-Wakeup: %S",iDeviceCaps().iRemoteWakeup ? KYes() : KNo()); - OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP08, "Supports High-speed: %S",iDeviceCaps().iHighSpeed ? KYes() : KNo()); - OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP09, "Supports unpowered cable detection: %S",(iDeviceCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? KYes() : KNo()); - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_OPENL_DUP10, "--------------------------------------"); + RDebug::Printf("------ USB device capabilities -------"); + RDebug::Printf("Number of endpoints: %d",iDeviceCaps().iTotalEndpoints); + RDebug::Printf("Supports Software-Connect: %S",iDeviceCaps().iConnect ? &KYes() : &KNo()); + RDebug::Printf("Device is Self-Powered: %S",iDeviceCaps().iSelfPowered ? &KYes() : &KNo()); + RDebug::Printf("Supports Remote-Wakeup: %S",iDeviceCaps().iRemoteWakeup ? &KYes() : &KNo()); + RDebug::Printf("Supports High-speed: %S",iDeviceCaps().iHighSpeed ? &KYes() : &KNo()); + RDebug::Printf("Supports unpowered cable detection: %S",(iDeviceCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_CableDetectWithoutPower) ? &KYes() : &KNo()); + RDebug::Printf("--------------------------------------"); - OstTraceFunctionExit1( RUSBTESTDEVICE_OPENL_EXIT, this ); } TInt RUsbTestDevice::SetClassCode(TUint8 aClassCode,TUint8 aSubClassCode,TUint8 aDeviceProtocol) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETCLASSCODE_ENTRY, this ); + LOG_FUNC // Get Device descriptor TBuf8 deviceDescriptor; TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor)); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCLASSCODE, " Unable to obtain device descriptor",err); + RDebug::Printf(" Unable to obtain device descriptor",err); } else { @@ -202,24 +188,23 @@ err = iClientDriver.SetDeviceDescriptor(deviceDescriptor); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCLASSCODE_DUP01, " Unable to set the device dsecriptor",err); + RDebug::Printf(" Unable to set the device dsecriptor",err); } } - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETCLASSCODE_EXIT, this, err ); return err; } TInt RUsbTestDevice::SetUsbSpecification(TUint16 aSpecification) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETUSBSPECIFICATION_ENTRY, this ); + LOG_FUNC // Get Device descriptor TBuf8 deviceDescriptor; TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor)); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETUSBSPECIFICATION, " Unable to obtain device descriptor",err); + RDebug::Printf(" Unable to obtain device descriptor",err); } else { @@ -236,24 +221,23 @@ err = iClientDriver.SetDeviceDescriptor(deviceDescriptor); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETUSBSPECIFICATION_DUP01, " Unable to set the device dsecriptor",err); + RDebug::Printf(" Unable to set the device dsecriptor",err); } } - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETUSBSPECIFICATION_EXIT, this, err ); return err; } TInt RUsbTestDevice::SetVendor(TUint16 aVendorId) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETVENDOR_ENTRY, this ); + LOG_FUNC // Get Device descriptor TBuf8 deviceDescriptor; TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor)); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETVENDOR, " Unable to obtain device descriptor",err); + RDebug::Printf(" Unable to obtain device descriptor",err); } else { @@ -265,10 +249,9 @@ err = iClientDriver.SetDeviceDescriptor(deviceDescriptor); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETVENDOR_DUP01, " Unable to set the device descriptor",err); + RDebug::Printf(" Unable to set the device descriptor",err); } } - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETVENDOR_EXIT, this, err ); return err; } @@ -276,14 +259,14 @@ TInt RUsbTestDevice::SetProduct(TUint16 aProductId,const TDesC16& aProductString, const TDesC16& aManufacturerString,const TDesC16& aSerialNumberString) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETPRODUCT_ENTRY, this ); + LOG_FUNC // Get Device descriptor TBuf8 deviceDescriptor; TInt err(iClientDriver.GetDeviceDescriptor(deviceDescriptor)); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT, " Unable to obtain device descriptor",err); + RDebug::Printf(" Unable to obtain device descriptor",err); } else { @@ -295,19 +278,17 @@ err = iClientDriver.SetDeviceDescriptor(deviceDescriptor); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP01, " Unable to set the device dsecriptor",err); - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT, this, err ); + RDebug::Printf(" Unable to set the device dsecriptor",err); return err; } - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP02, "Product Identity set"); + RDebug::Printf("Product Identity set"); // Product string err = iClientDriver.SetProductStringDescriptor(aProductString); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP03, " Unable to set product string descriptor",err); - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP01, this, err ); + RDebug::Printf(" Unable to set product string descriptor",err); return err; } @@ -315,8 +296,7 @@ err = iClientDriver.SetManufacturerStringDescriptor(aManufacturerString); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP04, " Unable to set the manufacturer string descriptor",err); - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP02, this, err ); + RDebug::Printf(" Unable to set the manufacturer string descriptor",err); return err; } @@ -324,61 +304,55 @@ err = iClientDriver.SetSerialNumberStringDescriptor(aSerialNumberString); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETPRODUCT_DUP05, " Unable to set the serial number string descriptor",err); - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP03, this, err ); + RDebug::Printf(" Unable to set the serial number string descriptor",err); return err; } } - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETPRODUCT_EXIT_DUP04, this, KErrNone ); return KErrNone; } TInt RUsbTestDevice::SetConfigurationString(const TDesC16& aConfigString) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_SETCONFIGURATIONSTRING_ENTRY, this ); + LOG_FUNC TInt err(iClientDriver.SetConfigurationStringDescriptor(aConfigString)); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SETCONFIGURATIONSTRING, " Unable to set configuration string descriptor",err); + RDebug::Printf(" Unable to set configuration string descriptor",err); } - OstTraceFunctionExitExt( RUSBTESTDEVICE_SETCONFIGURATIONSTRING_EXIT, this, err ); return err; } void RUsbTestDevice::AddInterface(CInterfaceBase* aInterface) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_ADDINTERFACE_ENTRY, this ); + LOG_FUNC // Add the interface to the device TInt err = iInterfaces.Append(aInterface); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_ADDINTERFACE, " Unable to add interface",err); + RDebug::Printf(" Unable to add interface",err); return ReportError(err); } - OstTraceFunctionExit1( RUSBTESTDEVICE_ADDINTERFACE_EXIT, this ); } CInterfaceBase& RUsbTestDevice::Interface(TInt aIndex) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_INTERFACE_ENTRY, this ); - OstTraceFunctionExit1( RUSBTESTDEVICE_INTERFACE_EXIT, this ); return *iInterfaces[aIndex]; } void RUsbTestDevice::SoftwareConnect() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_SOFTWARECONNECT_ENTRY, this ); + LOG_FUNC TInt err(iClientDriver.PowerUpUdc()); if((err != KErrNone) && (err != KErrNotReady)) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT, " Power Up Udc",err); + RDebug::Printf(" Power Up Udc",err); ReportError(err); } @@ -387,63 +361,60 @@ err = iClientDriver.DeviceConnectToHost(); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT_DUP01, " Unable to connect to the host",err); + RDebug::Printf(" Unable to connect to the host",err); ReportError(err); } } else { - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWARECONNECT_DUP02, "Please connect device to Host"); + RDebug::Printf("Please connect device to Host"); } - OstTraceFunctionExit1( RUSBTESTDEVICE_SOFTWARECONNECT_EXIT, this ); } void RUsbTestDevice::SoftwareDisconnect() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_SOFTWAREDISCONNECT_ENTRY, this ); + LOG_FUNC if(iDeviceCaps().iConnect) { TInt err(iClientDriver.DeviceDisconnectFromHost()); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWAREDISCONNECT, " Unable to disconnect from the host",err); + RDebug::Printf(" Unable to disconnect from the host",err); ReportError(err); } } else { - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_SOFTWAREDISCONNECT_DUP01, "Please disconnect device from Host"); + RDebug::Printf("Please disconnect device from Host"); } - OstTraceFunctionExit1( RUSBTESTDEVICE_SOFTWAREDISCONNECT_EXIT, this ); } void RUsbTestDevice::RemoteWakeup() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_REMOTEWAKEUP_ENTRY, this ); + LOG_FUNC if(iDeviceCaps().iConnect) { TInt err(iClientDriver.SignalRemoteWakeup()); if(err != KErrNone) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP, " Unable to perform a remote wakeup",err); + RDebug::Printf(" Unable to perform a remote wakeup",err); ReportError(err); } } else { - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP_DUP01, "remote wakeup not supported"); + RDebug::Printf("remote wakeup not supported"); } - OstTraceFunctionExit1( RUSBTESTDEVICE_REMOTEWAKEUP_EXIT, this ); } TInt RUsbTestDevice::ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex, TUint16 aDataReqLength,const TDesC8& aPayload) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_PROCESSREQUESTL_ENTRY, this ); + LOG_FUNC if(aRequest == KVendorEmptyRequest) { @@ -460,7 +431,7 @@ } else if(aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL, "**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this); + RDebug::Printf("**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this); // Handle a reconnect requests from the host AcknowledgeRequestReceived(); @@ -474,12 +445,11 @@ iTestCaseT_USBDI_0486->TestDeviceC()->OpenL(KTestDeviceC_SN); // Connect the device to the host iTestCaseT_USBDI_0486->TestDeviceC()->SoftwareConnect(); - OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT, this, KErrAbort ); return KErrAbort; } else if(aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP01, "**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this); + RDebug::Printf("**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this); // Handle a reconnect requests from the host AcknowledgeRequestReceived(); @@ -498,7 +468,6 @@ // Connect the device to the host iTestCaseT_USBDI_0486->TestDeviceD()->SoftwareConnect(); - OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP01, this, KErrAbort ); return KErrAbort; } else if(aRequest == KVendorTestCasePassed) @@ -518,7 +487,7 @@ HBufC16* msg = HBufC16::NewL(aPayload.Length()); msg->Des().Copy(aPayload); - OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP02, " Test case failed: %S",*msg); + RDebug::Printf(" Test case failed: %S",msg); delete msg; msg = 0; ReportError(-aValue); @@ -535,10 +504,10 @@ // Handle a payload request from the host AcknowledgeRequestReceived(); - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP03, "Put payload"); + RDebug::Printf("Put payload"); if(aPayload.Compare(_L8("DEADBEEF")) != 0) { - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP04, " Payload not as expected",KErrCorrupt); + RDebug::Printf(" Payload not as expected",KErrCorrupt); ReportError(KErrCorrupt); } } @@ -546,46 +515,45 @@ { // Handle a payload request to the host - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP05, "Get payload"); + RDebug::Printf("Get payload"); __ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral)); - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP06, "iAuxBuffer = ...."); - OstTraceData(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP56, "", iAuxBuffer->Ptr(), iAuxBuffer->Length()); - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP07, "\n"); + RDebug::Printf("iAuxBuffer = ...."); + RDebug::RawPrint(*iAuxBuffer); + RDebug::Printf("\n"); //Perform synchronous write to EP0 //This allows the subsequent 'Read' request to //take place TInt ret = iDeviceEp0->SendDataSynchronous(*iAuxBuffer); - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP08, "Write (from device callback) executed with error %d", ret); + RDebug::Printf("Write (from device callback) executed with error %d", ret); } else if(aRequest == KVendorUnrespondRequest) { // Do not acknowledge this request - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP09, "Unrespond request: continually NAK the host"); + RDebug::Printf("Unrespond request: continually NAK the host"); } else if(aRequest == KVendorStallRequest) { // Stall the specified endpoint AcknowledgeRequestReceived(); - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP10, "Stalling endpoint %d",aValue); + RDebug::Printf("Stalling endpoint %d",aValue); } else { // Maybe forward to derived classes } - OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP02, this, KErrNone ); return KErrNone; } void RUsbTestDevice::StateChangeL(TUsbcDeviceState aNewState,TInt aChangeCompletionCode) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_STATECHANGEL_ENTRY, this ); + LOG_FUNC - OstTraceExt2(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL, "Client state change to %d err=%d",aNewState,aChangeCompletionCode); + RDebug::Printf("Client state change to %d err=%d",aNewState,aChangeCompletionCode); // Notify the test case of failed state change notification @@ -609,7 +577,7 @@ // The is a state change from EUsbcDeviceStateConfigured to aNewState // so stop reading from control ep0 - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL_DUP01, "Ignoring control ep0"); + RDebug::Printf("Ignoring control ep0"); // Stop reading ep0 directed requests @@ -629,7 +597,7 @@ // Device has now been placed into a fully configured state by the host // so start reading from control ep0 - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_STATECHANGEL_DUP02, "Reading from control ep0"); + RDebug::Printf("Reading from control ep0"); // Start reading ep0 directed requests @@ -650,13 +618,12 @@ // Forward the state change notification to derived classes OnStateChangeL(aNewState); - OstTraceFunctionExit1( RUSBTESTDEVICE_STATECHANGEL_EXIT, this ); } void RUsbTestDevice::StartEp0Reading() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_STARTEP0READING_ENTRY, this ); + LOG_FUNC // Start reading device directed ep0 requests @@ -673,13 +640,12 @@ { iInterfaces[i]->StartEp0Reading(); } - OstTraceFunctionExit1( RUSBTESTDEVICE_STARTEP0READING_EXIT, this ); } void RUsbTestDevice::StopEp0Reading() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_STOPEP0READING_ENTRY, this ); + LOG_FUNC // Stop reading interface directed requests @@ -696,36 +662,33 @@ { return ReportError(err); } - OstTraceFunctionExit1( RUSBTESTDEVICE_STOPEP0READING_EXIT, this ); } void RUsbTestDevice::AcknowledgeRequestReceived() { - OstTraceFunctionEntry1( RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_ENTRY, this ); + LOG_FUNC TInt err(iDeviceEp0->Reader().Acknowledge()); - OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED, "err = %d",err); + RDebug::Printf("err = %d",err); if(err != KErrNone) { ReportError(err); } - OstTraceFunctionExit1( RUSBTESTDEVICE_ACKNOWLEDGEREQUESTRECEIVED_EXIT, this ); } void RUsbTestDevice::ReportError(TInt aCompletionCode) { - OstTraceFunctionEntryExt( RUSBTESTDEVICE_REPORTERROR_ENTRY, this ); - OstTraceExt3(TRACE_NORMAL, RUSBTESTDEVICE_REPORTERROR, "err or aCompletionCode = %d, observer status = %d, KRequestPending = %d", + LOG_FUNC + RDebug::Printf("err or aCompletionCode = %d, observer status = %d, KRequestPending = %d", aCompletionCode, iObserverStatus->Int(), KRequestPending); if(*iObserverStatus == KRequestPending) { - OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REPORTERROR_DUP01, "In complete request"); + RDebug::Printf("In complete request"); User::RequestComplete(iObserverStatus,aCompletionCode); } - OstTraceFunctionExit1( RUSBTESTDEVICE_REPORTERROR_EXIT, this ); }