diff -r f92a4f87e424 -r 012cc2ee6408 usbmgmt/usbmgr/usbman/server/SRC/cusbotgwatcher.cpp --- a/usbmgmt/usbmgr/usbman/server/SRC/cusbotgwatcher.cpp Tue Aug 31 17:01:47 2010 +0300 +++ b/usbmgmt/usbmgr/usbman/server/SRC/cusbotgwatcher.cpp Wed Sep 01 12:35:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2009 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" @@ -21,17 +21,16 @@ @file */ -#include #include #include "CUsbScheduler.h" #include "cusbotgwatcher.h" #include "CUsbOtg.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "cusbotgwatcherTraces.h" +#include + +#ifdef __FLOG_ACTIVE +_LIT8(KLogComponent, "USBSVR-OTGWATCHER"); #endif - static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); static _LIT_SECURITY_POLICY_S1(KNetworkControlPolicy,KUsbmanSvrSid,ECapabilityNetworkControl); static _LIT_SECURITY_POLICY_C1(KRequestSessionPolicy,ECapabilityCommDD); @@ -51,9 +50,8 @@ CUsbOtgBaseWatcher::CUsbOtgBaseWatcher(RUsbOtgDriver& aLdd) : CActive(CActive::EPriorityStandard), iLdd(aLdd) { - OstTraceFunctionEntry0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_CONS_ENTRY ); + LOG_FUNC CActiveScheduler::Add(this); - OstTraceFunctionExit0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_CONS_EXIT ); } /** @@ -65,9 +63,8 @@ */ CUsbOtgBaseWatcher::~CUsbOtgBaseWatcher() { - OstTraceFunctionEntry0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_DES_ENTRY ); + LOG_FUNC Cancel(); - OstTraceFunctionExit0( CUSBOTGBASEWATCHER_CUSBOTGBASEWATCHER_DES_EXIT ); } /** @@ -75,9 +72,8 @@ */ void CUsbOtgBaseWatcher::Start() { - OstTraceFunctionEntry0( CUSBOTGBASEWATCHER_START_ENTRY ); + LOG_FUNC Post(); - OstTraceFunctionExit0( CUSBOTGBASEWATCHER_START_EXIT ); } //---------------------------- Id-Pin watcher class --------------------------- @@ -93,13 +89,12 @@ */ CUsbOtgIdPinWatcher* CUsbOtgIdPinWatcher::NewL(RUsbOtgDriver& aLdd) { - OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_NEWL_ENTRY ); + LOG_STATIC_FUNC_ENTRY CUsbOtgIdPinWatcher* self = new (ELeave) CUsbOtgIdPinWatcher(aLdd); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_NEWL_EXIT ); return self; } @@ -113,10 +108,9 @@ */ CUsbOtgIdPinWatcher::~CUsbOtgIdPinWatcher() { - OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_DES_ENTRY ); + LOG_FUNC Cancel(); RProperty::Delete(KUsbOtgIdPinPresentProperty); - OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_DES_EXIT ); } void CUsbOtgIdPinWatcher::ConstructL() @@ -124,7 +118,7 @@ * Performs 2nd phase construction of the OTG object. */ { - OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_CONSTRUCTL_ENTRY ); + LOG_FUNC TInt err = RProperty::Define(KUsbOtgIdPinPresentProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -136,7 +130,6 @@ { User::LeaveIfError(err); } - OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_CONSTRUCTL_EXIT ); } /** @@ -150,8 +143,7 @@ CUsbOtgIdPinWatcher::CUsbOtgIdPinWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_CONS_ENTRY ); - OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_CUSBOTGIDPINWATCHER_CONS_EXIT ); + LOG_FUNC } /** @@ -159,19 +151,14 @@ */ void CUsbOtgIdPinWatcher::RunL() { - OstTraceFunctionEntry0( CUSBOTGIDPINWATCHER_RUNL_ENTRY ); - OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_RUNL, "CUsbOtgIdPinWatcher::RunL;iStatus=%d", iStatus.Int() ); + LOG_FUNC + LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::RunL [iStatus=%d]"), iStatus.Int()); - TInt err = iStatus.Int(); - if(err < 0) - { - OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_RUNL_DUP1, "CUsbOtgIdPinWatcher::RunL;iStatus.Int() with error=%d", err ); - User::Leave(err); - } + LEAVEIFERRORL(iStatus.Int()); Post(); - OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_RUNL_EXIT ); + LOGTEXT(_L8("<>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - failed to set the property value"), iOtgIdPin); } else { - OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP2, - "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] - property is set to 1", iOtgIdPin ); + LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - property is set to 1"), iOtgIdPin); } break; case RUsbOtgDriver::EIdPinBPlug: case RUsbOtgDriver::EIdPinUnknown: if (RProperty::Set(KUidUsbManCategory,KUsbOtgIdPinPresentProperty,EFalse) != KErrNone) { - OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP3, - "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] - failed to set the property value", iOtgIdPin ); + LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - failed to set the property value"), iOtgIdPin); } else { - OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP4, - "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] - property is set to 0", iOtgIdPin ); + LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] - property is set to 0"), iOtgIdPin); } break; default: - OstTrace1( TRACE_NORMAL, CUSBOTGIDPINWATCHER_POST_DUP5, - "CUsbOtgIdPinWatcher::Post; [iOtgIdPin=%d] is unrecognized, re-request QueueOtgIdPinNotification", iOtgIdPin ); + LOGTEXT2(_L8(">>CUsbOtgIdPinWatcher::Post [iOtgIdPin=%d] is unrecognized, re-request QueueOtgIdPinNotification"), iOtgIdPin); break; } SetActive(); - OstTraceFunctionExit0( CUSBOTGIDPINWATCHER_POST_EXIT ); } //----------------------------- VBus watcher class ---------------------------- @@ -244,13 +223,12 @@ */ CUsbOtgVbusWatcher* CUsbOtgVbusWatcher::NewL(RUsbOtgDriver& aLdd) { - OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_NEWL_ENTRY ); + LOG_STATIC_FUNC_ENTRY CUsbOtgVbusWatcher* self = new (ELeave) CUsbOtgVbusWatcher(aLdd); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_NEWL_EXIT ); return self; } @@ -264,11 +242,10 @@ */ CUsbOtgVbusWatcher::~CUsbOtgVbusWatcher() { - OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_DES_ENTRY ); + LOG_FUNC Cancel(); RProperty::Delete(KUsbOtgVBusPoweredProperty); - OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_DES_EXIT ); } void CUsbOtgVbusWatcher::ConstructL() @@ -276,7 +253,7 @@ * Performs 2nd phase construction of the OTG object. */ { - OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_CONSTRUCTL_ENTRY ); + LOG_FUNC TInt err = RProperty::Define(KUsbOtgVBusPoweredProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -288,7 +265,6 @@ { User::LeaveIfError(err); } - OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_CONSTRUCTL_EXIT ); } /** @@ -301,8 +277,7 @@ CUsbOtgVbusWatcher::CUsbOtgVbusWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_CONS_ENTRY ); - OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_CUSBOTGVBUSWATCHER_CONS_EXIT ); + LOG_FUNC } /** @@ -310,19 +285,14 @@ */ void CUsbOtgVbusWatcher::RunL() { - OstTraceFunctionEntry0( CUSBOTGVBUSWATCHER_RUNL_ENTRY ); - OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_RUNL, "CUsbOtgVbusWatcher::RunL;iStatus=%d", iStatus.Int() ); + LOG_FUNC + LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::RunL [iStatus=%d]"), iStatus.Int()); - TInt err = iStatus.Int(); - if(err < 0) - { - OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_RUNL_DUP1, "CUsbOtgVbusWatcher::RunL;iStatus.Int() with error=%d", err ); - User::Leave(err); - } + LEAVEIFERRORL(iStatus.Int()); Post(); - OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_RUNL_EXIT ); + LOGTEXT(_L8("<>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](EVbusHigh) - failed to set the property value"), iOtgVbus); } else { - OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP2, - "CUsbOtgVbusWatcher::Post;[iOtgVbus=%d](EVbusHigh) - property is set to ETrue", iOtgVbus ); + LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](EVbusHigh) - property is set to ETrue"), iOtgVbus); } break; case RUsbOtgDriver::EVbusLow: case RUsbOtgDriver::EVbusUnknown: if (RProperty::Set(KUidUsbManCategory,KUsbOtgVBusPoweredProperty,EFalse) != KErrNone) { - OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP3, - "CUsbOtgVbusWatcher::Post;[iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - failed to set the property value", iOtgVbus ); + LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - failed to set the property value"), iOtgVbus); } else { - OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP4, - "CUsbOtgVbusWatcher::Post;[iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - property is set to EFalse", iOtgVbus ); + LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::Post [iOtgVbus=%d](1 - EVbusLow, 2 - EVbusUnknown) - property is set to EFalse"), iOtgVbus); } break; default: - OstTrace1( TRACE_NORMAL, CUSBOTGVBUSWATCHER_POST_DUP5, - "CUsbOtgVbusWatcher::Post;iOtgVbus=%d] is unrecognized, re-request QueueOtgVbusNotification", iOtgVbus ); + LOGTEXT2(_L8(">>CUsbOtgVbusWatcher::RunL [iOtgVbus=%d] is unrecognized, re-request QueueOtgVbusNotification"), iOtgVbus); break; } SetActive(); - OstTraceFunctionExit0( CUSBOTGVBUSWATCHER_POST_EXIT ); } @@ -396,13 +358,12 @@ */ CUsbOtgStateWatcher* CUsbOtgStateWatcher::NewL(RUsbOtgDriver& aLdd) { - OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_NEWL_ENTRY ); + LOG_STATIC_FUNC_ENTRY CUsbOtgStateWatcher* self = new (ELeave) CUsbOtgStateWatcher(aLdd); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_NEWL_EXIT ); return self; } @@ -416,10 +377,9 @@ */ CUsbOtgStateWatcher::~CUsbOtgStateWatcher() { - OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_DES_ENTRY ); + LOG_FUNC Cancel(); RProperty::Delete(KUsbOtgStateProperty); - OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_DES_EXIT ); } void CUsbOtgStateWatcher::ConstructL() @@ -427,7 +387,7 @@ * Performs 2nd phase construction of the OTG object. */ { - OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_CONSTRUCTL_ENTRY ); + LOG_FUNC TInt err = RProperty::Define(KUsbOtgStateProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -439,7 +399,6 @@ { User::LeaveIfError(err); } - OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_CONSTRUCTL_EXIT ); } /** @@ -453,9 +412,8 @@ CUsbOtgStateWatcher::CUsbOtgStateWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_CONS_ENTRY ); + LOG_FUNC iOtgState = RUsbOtgDriver::EStateReset; - OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_CUSBOTGSTATEWATCHER_CONS_EXIT ); } /** @@ -463,19 +421,14 @@ */ void CUsbOtgStateWatcher::RunL() { - OstTraceFunctionEntry0( CUSBOTGSTATEWATCHER_RUNL_ENTRY ); - OstTrace1( TRACE_NORMAL, CUSBOTGSTATEWATCHER_RUNL, "CUsbOtgStateWatcher::RunL;iStatus.Int()=%d", iStatus.Int() ); + LOG_FUNC + LOGTEXT2(_L8(">>CUsbOtgStateWatcher::RunL [iStatus=%d]"), iStatus.Int()); - TInt err = iStatus.Int(); - if(err < 0) - { - OstTrace1( TRACE_NORMAL, CUSBOTGSTATEWATCHER_RUNL_DUP1, "CUsbOtgStateWatcher::RunL;iStatus.Int() with error=%d", err ); - User::Leave(err); - } + LEAVEIFERRORL(iStatus.Int()); Post(); - OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_RUNL_EXIT ); + LOGTEXT(_L8("<>CUsbOtgStateWatcher::RunL [iStatus=%d], iOtgState = %d"), iStatus.Int(), iOtgState); if (RProperty::Set(KUidUsbManCategory,KUsbOtgStateProperty,(TInt)iOtgState) != KErrNone) { - OstTraceExt2( TRACE_NORMAL, CUSBOTGSTATEWATCHER_POST_DUP2, - "CUsbOtgStateWatcher::Post;[iStatus=%d], iOtgState = %d - failed to set the property", iStatus.Int(), iOtgState ); + LOGTEXT3(_L8(">>CUsbOtgStateWatcher::RunL [iStatus=%d], iOtgState = %d - failed to set the property"), iStatus.Int(), iOtgState); } SetActive(); - OstTraceFunctionExit0( CUSBOTGSTATEWATCHER_POST_EXIT ); } //-------------------------- OTG Events watcher class ------------------------- @@ -526,13 +475,12 @@ CUsbOtgEventWatcher* CUsbOtgEventWatcher::NewL(CUsbOtg& aOwner, RUsbOtgDriver& aLdd, RUsbOtgDriver::TOtgEvent& aOtgEvent) { - OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_NEWL_ENTRY ); + LOG_STATIC_FUNC_ENTRY CUsbOtgEventWatcher* self = new (ELeave) CUsbOtgEventWatcher(aOwner, aLdd, aOtgEvent); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_NEWL_EXIT ); return self; } @@ -546,9 +494,8 @@ */ CUsbOtgEventWatcher::~CUsbOtgEventWatcher() { - OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_DES_ENTRY ); + LOG_FUNC Cancel(); - OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_DES_EXIT ); } void CUsbOtgEventWatcher::ConstructL() @@ -556,8 +503,7 @@ * Performs 2nd phase construction of the OTG object. */ { - OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_CONSTRUCTL_ENTRY ); - OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_CONSTRUCTL_EXIT ); + LOG_FUNC } /** @@ -573,8 +519,7 @@ RUsbOtgDriver::TOtgEvent& aOtgEvent) : CUsbOtgBaseWatcher(aLdd), iOwner(aOwner), iOtgEvent(aOtgEvent) { - OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_CONS_ENTRY ); - OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_CUSBOTGEVENTWATCHER_CONS_EXIT ); + LOG_FUNC } /** @@ -582,17 +527,11 @@ */ void CUsbOtgEventWatcher::RunL() { - OstTraceFunctionEntry0( CUSBOTGEVENTWATCHER_RUNL_ENTRY ); - OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL, "CUsbOtgEventWatcher::RunL;iStatus=%d", iStatus.Int() ); - TInt err = iStatus.Int(); - if(err < 0) - { - OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL_DUP3, "CUsbOtgEventWatcher::RunL;iStatus.Int() with error=%d", err ); - User::Leave(err); - } - - OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL_DUP1, - "CUsbOtgEventWatcher::RunL; - Otg Event reported: %d", (TInt)iOtgEvent ); + LOG_FUNC + LOGTEXT2(_L8(">>CUsbOtgEventWatcher::RunL [iStatus=%d]"), iStatus.Int()); + + LEAVEIFERRORL(iStatus.Int()); + LOGTEXT2(_L8("CUsbOtgEventWatcher::RunL() - Otg Event reported: %d"), (TInt)iOtgEvent); if ( ( iOtgEvent == RUsbOtgDriver::EEventHnpDisabled ) ||( iOtgEvent == RUsbOtgDriver::EEventHnpEnabled ) ||( iOtgEvent == RUsbOtgDriver::EEventSrpInitiated ) @@ -602,14 +541,13 @@ ) { iOwner.NotifyOtgEvent(); - OstTrace1( TRACE_NORMAL, CUSBOTGEVENTWATCHER_RUNL_DUP2, - "CUsbOtgEventWatcher::RunL - The owner is notified about Otg Event = %d", (TInt)iOtgEvent ); + LOGTEXT2(_L8("CUsbOtgEventWatcher::RunL() - The owner is notified about Otg Event = %d"), (TInt)iOtgEvent); } Post(); - OstTraceFunctionExit0( CUSBOTGEVENTWATCHER_RUNL_EXIT ); + LOGTEXT(_L8("<CUsbOtgWatcher::~CUsbOtgWatcher (0x%08x)"), (TUint32) this); Cancel(); } @@ -741,9 +666,8 @@ CUsbOtgWatcher::CUsbOtgWatcher(MUsbOtgObserver& aOwner, RUsbOtgDriver& aLdd, TUint& aOtgMessage) : CActive(CActive::EPriorityStandard), iOwner(aOwner), iLdd(aLdd), iOtgMessage(aOtgMessage) { - OstTraceFunctionEntry0( CUSBOTGWATCHER_CUSBOTGWATCHER_CONS_ENTRY ); + LOG_FUNC CActiveScheduler::Add(this); - OstTraceFunctionExit0( CUSBOTGWATCHER_CUSBOTGWATCHER_CONS_EXIT ); } /** @@ -751,19 +675,17 @@ */ void CUsbOtgWatcher::RunL() { - OstTraceFunctionEntry0( CUSBOTGWATCHER_RUNL_ENTRY ); + LOG_FUNC if (iStatus.Int() != KErrNone) { - OstTrace1( TRACE_NORMAL, CUSBOTGWATCHER_RUNL, "CUsbOtgWatcher::RunL;Error=%d", iStatus.Int() ); - OstTraceFunctionExit0( CUSBOTGWATCHER_RUNL_EXIT ); + LOGTEXT2(_L8("CUsbOtgWatcher::RunL() - Error = %d"), iStatus.Int()); return; } - OstTrace1( TRACE_NORMAL, CUSBOTGWATCHER_RUNL_DUP1, "CUsbOtgWatcher::RunL;Otg Message reported: %d", iOtgMessage ); + LOGTEXT2(_L8("CUsbOtgWatcher::RunL() - Otg Message reported: %d"), iOtgMessage); iOwner.NotifyMessage(); Post(); - OstTraceFunctionExit0( CUSBOTGWATCHER_RUNL_EXIT_DUP1 ); } @@ -772,9 +694,8 @@ */ void CUsbOtgWatcher::DoCancel() { - OstTraceFunctionEntry0( CUSBOTGWATCHER_DOCANCEL_ENTRY ); + LOG_FUNC iLdd.CancelOtgMessageRequest(); - OstTraceFunctionExit0( CUSBOTGWATCHER_DOCANCEL_EXIT ); } @@ -783,9 +704,8 @@ */ void CUsbOtgWatcher::Start() { - OstTraceFunctionEntry0( CUSBOTGWATCHER_START_ENTRY ); + LOG_FUNC Post(); - OstTraceFunctionExit0( CUSBOTGWATCHER_START_EXIT ); } /** @@ -793,12 +713,11 @@ */ void CUsbOtgWatcher::Post() { - OstTraceFunctionEntry0( CUSBOTGWATCHER_POST_ENTRY ); + LOG_FUNC - OstTrace0( TRACE_NORMAL, CUSBOTGWATCHER_POST, "CUsbOtgWatcher::Post - About to call QueueOtgMessageRequest" ); + LOGTEXT(_L8("CUsbOtgWatcher::Post() - About to call QueueOtgMessageRequest")); iLdd.QueueOtgMessageRequest((RUsbOtgDriver::TOtgMessage&)iOtgMessage, iStatus); SetActive(); - OstTraceFunctionExit0( CUSBOTGWATCHER_POST_EXIT ); } @@ -828,7 +747,7 @@ * Performs 2nd phase construction of the OTG object. */ { - OstTraceFunctionEntry0( CREQUESTSESSIONWATCHER_CONSTRUCTL_ENTRY ); + LOG_FUNC TInt err = RProperty::Define(KUsbRequestSessionProperty, RProperty::EInt, KAllowAllPolicy, KRequestSessionPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -843,15 +762,13 @@ User::LeaveIfError(iProp.Attach(KUidUsbManCategory, KUsbRequestSessionProperty)); iProp.Subscribe(iStatus); SetActive(); - OstTraceFunctionExit0( CREQUESTSESSIONWATCHER_CONSTRUCTL_EXIT ); } CRequestSessionWatcher::CRequestSessionWatcher(MUsbOtgObserver& aOwner) : CActive(CActive::EPriorityStandard), iOwner(aOwner) { - OstTraceFunctionEntry0( CREQUESTSESSIONWATCHER_CREQUESTSESSIONWATCHER_CONS_ENTRY ); + LOG_FUNC CActiveScheduler::Add(this); - OstTraceFunctionExit0( CREQUESTSESSIONWATCHER_CREQUESTSESSIONWATCHER_CONS_EXIT ); } /** @@ -859,8 +776,8 @@ */ void CRequestSessionWatcher::RunL() { - OstTraceFunctionEntry0( CREQUESTSESSIONWATCHER_RUNL_ENTRY ); - OstTrace1( TRACE_NORMAL, CREQUESTSESSIONWATCHER_RUNL, "CRequestSessionWatcher::RunL;iStatus=%d", iStatus.Int() ); + LOG_FUNC + LOGTEXT2(_L8(">>CRequestSessionWatcher::RunL [iStatus=%d]"), iStatus.Int()); RDebug::Printf(">>CRequestSessionWatcher::RunL [iStatus=%d]", iStatus.Int()); iProp.Subscribe(iStatus); @@ -872,7 +789,7 @@ iOwner.NotifyMessage(KUsbMessageRequestSession); - OstTraceFunctionExit0( CREQUESTSESSIONWATCHER_RUNL_EXIT ); + LOGTEXT(_L8("<ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_NEWL_EXIT ); return self; } @@ -919,10 +834,9 @@ */ CUsbOtgConnectionIdleWatcher::~CUsbOtgConnectionIdleWatcher() { - OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_DES_ENTRY ); + LOG_FUNC Cancel(); RProperty::Delete(KUsbOtgConnectionIdleProperty); - OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_DES_EXIT ); } /** @@ -930,7 +844,7 @@ */ void CUsbOtgConnectionIdleWatcher::ConstructL() { - OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_CONSTRUCTL_ENTRY ); + LOG_FUNC TInt err = RProperty::Define(KUsbOtgConnectionIdleProperty, RProperty::EInt, KAllowAllPolicy, KNetworkControlPolicy); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -942,7 +856,6 @@ { User::LeaveIfError(err); } - OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_CONSTRUCTL_EXIT ); } /** @@ -956,8 +869,7 @@ CUsbOtgConnectionIdleWatcher::CUsbOtgConnectionIdleWatcher(RUsbOtgDriver& aLdd) : CUsbOtgBaseWatcher(aLdd) { - OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_CONS_ENTRY ); - OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_CUSBOTGCONNECTIONIDLEWATCHER_CONS_EXIT ); + LOG_FUNC } /** @@ -965,20 +877,14 @@ */ void CUsbOtgConnectionIdleWatcher::RunL() { - OstTraceFunctionEntry0( CUSBOTGCONNECTIONIDLEWATCHER_RUNL_ENTRY ); - OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_RUNL, - "CUsbOtgConnectionIdleWatcher::RunL;iStatus=%d", iStatus.Int() ); + LOG_FUNC + LOGTEXT2(_L8(">>CUsbOtgConnectionIdleWatcher::RunL [iStatus=%d]"), iStatus.Int()); + + LEAVEIFERRORL(iStatus.Int()); - TInt err = iStatus.Int(); - if(err < 0) - { - OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_RUNL_DUP1, "CUsbOtgConnectionIdleWatcher::RunL;iStatus.Int() with error=%d", err ); - User::Leave(err); - } - Post(); - OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_RUNL_EXIT ); + LOGTEXT(_L8("<>CUsbOtgConnectionIdleWatcher::Post [iConnectionIdle=%d] - property is set to 1"), iConnectionIdle); break; case RUsbOtgDriver::EConnectionBusy: RProperty::Set(KUidUsbManCategory,KUsbOtgConnectionIdleProperty,EFalse); - OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_POST_DUP2, - "CUsbOtgConnectionIdleWatcher::Post;[iConnectionIdle=%d] - property is set to 0", iConnectionIdle ); + LOGTEXT2(_L8(">>CUsbOtgConnectionIdleWatcher::Post [iConnectionIdle=%d] - property is set to 0"), iConnectionIdle); break; default: - OstTrace1( TRACE_NORMAL, CUSBOTGCONNECTIONIDLEWATCHER_POST_DUP3, - "CUsbOtgConnectionIdleWatcher::Post;[iConnectionIdle=%d] is unrecognized, re-request QueueOtgIdPinNotification", iConnectionIdle ); + LOGTEXT2(_L8(">>CUsbOtgConnectionIdleWatcher::Post [iConnectionIdle=%d] is unrecognized, re-request QueueOtgIdPinNotification"), iConnectionIdle); break; } SetActive(); - OstTraceFunctionExit0( CUSBOTGCONNECTIONIDLEWATCHER_POST_EXIT ); }