diff -r c1f20ce4abcf -r 3e88ff8f41d5 kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp --- a/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.cpp Tue Aug 31 16:34:26 2010 +0300 +++ b/kerneltest/e32test/usbho/t_usbdi/src/UsbClientStateWatcher.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" @@ -17,10 +17,6 @@ // #include "UsbClientStateWatcher.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "UsbClientStateWatcherTraces.h" -#endif #include #include #include @@ -32,12 +28,10 @@ CUsbClientStateWatcher* CUsbClientStateWatcher::NewL(RDevUsbcClient& aClientDriver,MUsbClientStateObserver& aStateObserver) { - OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_NEWL_ENTRY, 0 ); CUsbClientStateWatcher* self = new (ELeave) CUsbClientStateWatcher(aClientDriver,aStateObserver); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_NEWL_EXIT, ( TUint )( self ) ); return self; } @@ -47,41 +41,33 @@ iClientDriver(aClientDriver), iStateObserver(aStateObserver) { - OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY, this ); CActiveScheduler::Add(this); - OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT, this ); } CUsbClientStateWatcher::~CUsbClientStateWatcher() { - OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_ENTRY_DUP01, this ); + LOG_FUNC Cancel(); - OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CUSBCLIENTSTATEWATCHER_EXIT_DUP01, this ); } void CUsbClientStateWatcher::ConstructL() { - OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_ENTRY, this ); - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_CONSTRUCTL, " Watching state of device"); + RDebug::Printf(" Watching state of device"); iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); - OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_CONSTRUCTL_EXIT, this ); } void CUsbClientStateWatcher::DoCancel() { - OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_DOCANCEL_ENTRY, this ); // Cancel device status notification iClientDriver.AlternateDeviceStatusNotifyCancel(); - OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_DOCANCEL_EXIT, this ); } void CUsbClientStateWatcher::RunL() { - OstTraceFunctionEntry1( CUSBCLIENTSTATEWATCHER_RUNL_ENTRY, this ); // Retrieve the asynchronous completion code TInt completionCode(iStatus.Int()); @@ -97,42 +83,42 @@ switch(iState) { case EUsbcDeviceStateUndefined: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL, " Not attached"); + RDebug::Printf(" Not attached"); break; case EUsbcDeviceStateAttached: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP01, " Attached to host but not powered"); + RDebug::Printf(" Attached to host but not powered"); break; case EUsbcDeviceStatePowered: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP02, " Attached and powered but no reset"); + RDebug::Printf(" Attached and powered but no reset"); break; case EUsbcDeviceStateDefault: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP03, " Reset but not addressed"); + RDebug::Printf(" Reset but not addressed"); break; case EUsbcDeviceStateAddress: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP04, " Addressed but not configured"); + RDebug::Printf(" Addressed but not configured"); break; case EUsbcDeviceStateConfigured: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP05, " Fully configured"); + RDebug::Printf(" Fully configured"); break; case EUsbcDeviceStateSuspended: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP06, " Suspended"); + RDebug::Printf(" Suspended"); break; case EUsbcNoState: //follow through default: - OstTrace0(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP07, " Not specified"); + RDebug::Printf(" Not specified"); break; } } else { - OstTrace1(TRACE_NORMAL, CUSBCLIENTSTATEWATCHER_RUNL_DUP08, " Notification error %d",completionCode); + RDebug::Printf(" Notification error %d",completionCode); } // Device state change @@ -142,15 +128,12 @@ // Keep asking to be informed for status notifications iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); - OstTraceFunctionExit1( CUSBCLIENTSTATEWATCHER_RUNL_EXIT, this ); } TInt CUsbClientStateWatcher::RunError(TInt aError) { - OstTraceFunctionEntryExt( CUSBCLIENTSTATEWATCHER_RUNERROR_ENTRY, this ); aError = KErrNone; - OstTraceFunctionExitExt( CUSBCLIENTSTATEWATCHER_RUNERROR_EXIT, this, aError ); return aError; } @@ -162,12 +145,10 @@ CAlternateInterfaceSelectionWatcher* CAlternateInterfaceSelectionWatcher::NewL( RDevUsbcClient& aClientDriver,MAlternateSettingObserver& aObserver) { - OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_ENTRY, 0 ); CAlternateInterfaceSelectionWatcher* self = new (ELeave) CAlternateInterfaceSelectionWatcher(aClientDriver,aObserver); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_NEWL_EXIT, ( TUint )( self ) ); return self; } @@ -178,43 +159,38 @@ iClientDriver(aClientDriver), iObserver(aObserver) { - OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY, this ); CActiveScheduler::Add(this); - OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT, this ); } CAlternateInterfaceSelectionWatcher::~CAlternateInterfaceSelectionWatcher() { - OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_ENTRY_DUP01, this ); + LOG_FUNC Cancel(); - OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CALTERNATEINTERFACESELECTIONWATCHER_EXIT_DUP01, this ); } void CAlternateInterfaceSelectionWatcher::ConstructL() { - OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_ENTRY, this ); + LOG_FUNC iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); - OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_CONSTRUCTL_EXIT, this ); } void CAlternateInterfaceSelectionWatcher::DoCancel() { - OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_ENTRY, this ); + LOG_FUNC iClientDriver.AlternateDeviceStatusNotifyCancel(); - OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_DOCANCEL_EXIT, this ); } void CAlternateInterfaceSelectionWatcher::RunL() { - OstTraceFunctionEntry1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_ENTRY, this ); + LOG_FUNC TInt completionCode(iStatus.Int()); @@ -225,15 +201,13 @@ // Keep asking to be informed for status notifications iClientDriver.AlternateDeviceStatusNotify(iStatus,iState); SetActive(); - OstTraceFunctionExit1( CALTERNATEINTERFACESELECTIONWATCHER_RUNL_EXIT, this ); } TInt CAlternateInterfaceSelectionWatcher::RunError(TInt aError) { - OstTraceFunctionEntryExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_ENTRY, this ); + LOG_FUNC - OstTraceFunctionExitExt( CALTERNATEINTERFACESELECTIONWATCHER_RUNERROR_EXIT, this, KErrNone ); return KErrNone; }