usbclasses/usbobexclasscontroller/src/CUsbObexClassController.cpp
branchRCL_3
changeset 80 e02eb84a14d2
parent 79 25fce757be94
--- a/usbclasses/usbobexclasscontroller/src/CUsbObexClassController.cpp	Tue Aug 31 16:13:57 2010 +0300
+++ b/usbclasses/usbobexclasscontroller/src/CUsbObexClassController.cpp	Wed Sep 01 12:20:49 2010 +0100
@@ -22,8 +22,15 @@
 #include <SrcsInterface.h>
 #include <mmf/common/mmfcontrollerpluginresolver.h> //for CleanupResetAndDestroyPushL
 #include <musbclasscontrollernotify.h>
-#include "debug.h"
 
+// Panic category only used in debug builds
+#ifdef _DEBUG
+_LIT( KObexCcPanicCategory, "OBEXCC" );
+#endif
+
+#ifdef __FLOG_ACTIVE
+_LIT8(KLogComponent, "UsbObexCc");
+#endif
 
 /**
  * Panic codes for the USB OBEX Class Controller.
@@ -36,8 +43,6 @@
   EBadApiCallStart = 1,
   /** Stop() called while in an illegal state */
   EBadApiCallStop = 2,
-  /** Request completes in uknown state */
-  EUnkownState = 3
   };
 
 // ---------------------------------------------------------------------------
@@ -47,7 +52,7 @@
 CUsbObexClassController* CUsbObexClassController::NewL(
   MUsbClassControllerNotify& aOwner)
   {
-  LOG_FUNC
+  LOG_STATIC_FUNC_ENTRY
 
   CUsbObexClassController* self = new (ELeave) CUsbObexClassController(aOwner);
   CleanupStack::PushL(self);
@@ -102,13 +107,13 @@
 
   LOG_FUNC
   //Start() should never be called if started, starting or stopping (or in state EUsbServiceFatalError)
-  ASSERT_DEBUG(iState == EUsbServiceIdle, EBadApiCallStart );
+  __ASSERT_DEBUG(iState == EUsbServiceIdle, _USB_PANIC(KObexCcPanicCategory, EBadApiCallStart));
 
   // Start OBEX SM
   iRequestStatus = &aStatus;
   iState = EUsbServiceStarting;
   aStatus = KRequestPending;
-  LOG("CUsbObexClassController::Start() calling ManageUSBService(ETrue)"); 
+  LOGTEXT(_L8("CUsbObexClassController::Start() calling ManageUSBService(ETrue)")); 
   iObexSM->ManageUSBServices(ETrue, iStatus);
   SetActive();
   }
@@ -122,10 +127,10 @@
   {
 
   LOG_FUNC
-  LOG1("CUsbObexClassController::Stop iState = %d", iState);
+  LOGTEXT2(_L8("CUsbObexClassController::Stop iState = %d"), iState);
   
   //Stop() should never be called if stopping or starting (or in state EUsbServiceFatalError)
-  ASSERT_DEBUG(iState == EUsbServiceStarted || iState == EUsbServiceIdle, EBadApiCallStop );
+  __ASSERT_DEBUG(iState == EUsbServiceStarted || iState == EUsbServiceIdle, _USB_PANIC(KObexCcPanicCategory, EBadApiCallStop));
 
   //state may be idle after Cancel
   if ( iState == EUsbServiceIdle )
@@ -139,7 +144,7 @@
     iRequestStatus = &aStatus;
     iState = EUsbServiceStopping;   
     aStatus = KRequestPending;
-    LOG("CUsbObexClassController::Stop() calling ManageUSBService(EFalse)"); 
+    LOGTEXT(_L8("CUsbObexClassController::Stop() calling ManageUSBService(EFalse)")); 
     iObexSM->ManageUSBServices(EFalse, iStatus);
     SetActive();
     }
@@ -155,11 +160,11 @@
   LOG_FUNC
   if (iStatus != KErrNone)
     {
-    LOG1("CUsbObexClassController::RunL() iStatus = %d", iStatus.Int());
+    LOGTEXT2(_L8("CUsbObexClassController::RunL() Error = %d"), iStatus.Int());
     User::RequestComplete(iRequestStatus, iStatus.Int());
     return;
     }
-  LOG1("CUsbObexClassController::RunL() State is %d", iState);
+  LOGTEXT2(_L8("CUsbObexClassController::RunL() State is %d"), iState);
 
             switch (iState)
                 {
@@ -177,8 +182,7 @@
                 case EUsbServiceIdle:
 
                 default:
-            	     LOG("CUsbObexClassController::RunL() Unknown State");
-            		 PANIC(EUnkownState);
+            LOGTEXT(_L8("CUsbObexClassController::RunL() Error or Unknown State"));
                     break;
                 }
   }
@@ -194,7 +198,7 @@
   TRAPD(ret, DoGetDescriptorInfoL(aDescriptorInfo));
         if(ret!=KErrNone)
           {
-                 LOG1("CUsbObexClassController::GetDescriptorInfo leave with code: %d", ret);
+                 LOGTEXT2(_L8("CUsbObexClassController::GetDescriptorInfo leave with code: %d"), ret);
           }
         }
 
@@ -213,7 +217,7 @@
         resolverParams.SetWildcardMatch(EFalse);
         REComSession::ListImplementationsL(KCSrcsInterfaceUid, resolverParams, implInfoArray);
 
-        LOG1("CUsbObexClassController::DoGetDescriptorInfoL Number of Interfaces is %d",
+        LOGTEXT2(_L8("CUsbObexClassController::DoGetDescriptorInfoL Number of Interfaces is %d"),
                    implInfoArray.Count());
         aDescriptorInfo.iNumInterfaces = (implInfoArray.Count())*KObexNumInterfaces;
         aDescriptorInfo.iLength = 0;
@@ -238,7 +242,7 @@
       break;
 
     default:
-      ASSERT_DEBUG( EFalse,  EBadAsynchronousCall );
+      __ASSERT_DEBUG( EFalse, _USB_PANIC(KObexCcPanicCategory, EBadAsynchronousCall) );
       break;
     }
 
@@ -255,14 +259,14 @@
 TInt CUsbObexClassController::RunError(TInt aError)
   {
   LOG_FUNC
-  LOG1("CUsbObexClassController::RunError aError=%d", aError);
+  LOGTEXT2(_L8("CUsbObexClassController::RunError aError=%d"), aError);
   return KErrNone;
   }
 
 void CUsbObexClassController::MosmError(TInt aError)
     {
     LOG_FUNC
-    LOG1("CUsbObexClassController::MosmError aError=%d", aError);
+    LOGTEXT2(_L8("CUsbObexClassController::MosmError aError=%d"), aError);
     Owner().UccnError(aError);
     }