usbengines/usbotgwatcher/src/cusbtimer.cpp
branchRCL_3
changeset 20 a15c582fbf97
parent 13 7068aba64af5
child 21 ff9df6630274
--- a/usbengines/usbotgwatcher/src/cusbtimer.cpp	Fri Feb 19 23:50:33 2010 +0200
+++ b/usbengines/usbotgwatcher/src/cusbtimer.cpp	Fri Mar 12 15:48:40 2010 +0200
@@ -1,20 +1,19 @@
 /*
-* 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Implementation
+ * 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  *
-*/
-
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Implementation
+ *
+ */
 
 #include "cusbtimer.h"
 
@@ -24,7 +23,7 @@
 // 
 // ---------------------------------------------------------------------------
 //
-CUsbTimer::CUsbTimer(MUsbTimerObserver* aObserver, TUsbTimerId aTimerId) :
+CUsbTimer::CUsbTimer(MUsbTimerObserver& aObserver, TUsbTimerId aTimerId) :
     CActive(CActive::EPriorityStandard), iObserver(aObserver), iTimerId(
             aTimerId)
     {
@@ -37,7 +36,7 @@
 //
 CUsbTimer::~CUsbTimer()
     {
-        FLOG( _L( "[USBOTGWATCHER]\tCUsbTimer::~CUsbTimer" ) );
+    LOG_FUNC
     Cancel();
     iTimer.Close();
     }
@@ -48,7 +47,7 @@
 //
 void CUsbTimer::ConstructL()
     {
-        FLOG( _L( "[USBOTGWATCHER]\tCUsbTimer::ConstructL" ) );
+    LOG_FUNC
     User::LeaveIfError(iTimer.CreateLocal());
     }
 
@@ -56,12 +55,11 @@
 // 
 // ---------------------------------------------------------------------------
 //
-CUsbTimer* CUsbTimer::NewL(MUsbTimerObserver* anObserver,
-        TUsbTimerId aTimerId)
+CUsbTimer* CUsbTimer::NewL(MUsbTimerObserver& aObserver, TUsbTimerId aTimerId)
     {
-        FLOG( _L( "[USBOTGWATCHER]\tCUsbTimer::NewL" ) );
+    LOG_FUNC
 
-    CUsbTimer* self = new (ELeave) CUsbTimer(anObserver, aTimerId);
+    CUsbTimer* self = new (ELeave) CUsbTimer(aObserver, aTimerId);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self); // pop self
@@ -74,9 +72,7 @@
 //
 void CUsbTimer::After(TInt aMilliseconds)
     {
-//        FTRACE(FPrint(_L( "[USBOTGWATCHER]\tCUsbTimer::After aMilliseconds %d, timerId=%d" ), aMilliseconds, iTimerId))
-
-    if (IsActive()) 
+    if (IsActive())
         {
         Cancel();
         }
@@ -93,13 +89,12 @@
 void CUsbTimer::RunL()
     {
 
-    if(KErrNone != iStatus.Int())
+    if (KErrNone != iStatus.Int())
         {
-        FTRACE(FPrint(_L( "[USBOTGWATCHER]\tCUsbTimer::RunL iStatus %d" ), iStatus.Int()));
         User::Leave(iStatus.Int());
         }
 
-    iObserver->TimerElapsedL(iTimerId);
+    iObserver.TimerElapsedL(iTimerId);
     }
 
 // ---------------------------------------------------------------------------
@@ -108,7 +103,8 @@
 //
 TInt CUsbTimer::RunError(TInt aError)
     {
-        FTRACE(FPrint(_L( "[USBOTGWATCHER]\tCUsbTimer::RunError aError %d" ), aError ));
+    LOG_FUNC
+    LOG1( "aError = %d" , aError );
 
     return KErrNone;
     }
@@ -119,6 +115,5 @@
 //
 void CUsbTimer::DoCancel()
     {
-        FLOG( _L( "[USBOTGWATCHER]\tCUsbTimer::DoCancel" ) )
     iTimer.Cancel();
     }