usbclasses/usbobexclasscontroller/src/CUsbObexClassController.cpp
branchRCL_3
changeset 23 25fce757be94
parent 7 ff9df6630274
child 24 e02eb84a14d2
--- a/usbclasses/usbobexclasscontroller/src/CUsbObexClassController.cpp	Thu Aug 19 10:54:11 2010 +0300
+++ b/usbclasses/usbobexclasscontroller/src/CUsbObexClassController.cpp	Tue Aug 31 16:13:57 2010 +0300
@@ -22,15 +22,8 @@
 #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.
@@ -43,6 +36,8 @@
   EBadApiCallStart = 1,
   /** Stop() called while in an illegal state */
   EBadApiCallStop = 2,
+  /** Request completes in uknown state */
+  EUnkownState = 3
   };
 
 // ---------------------------------------------------------------------------
@@ -52,7 +47,7 @@
 CUsbObexClassController* CUsbObexClassController::NewL(
   MUsbClassControllerNotify& aOwner)
   {
-  LOG_STATIC_FUNC_ENTRY
+  LOG_FUNC
 
   CUsbObexClassController* self = new (ELeave) CUsbObexClassController(aOwner);
   CleanupStack::PushL(self);
@@ -107,13 +102,13 @@
 
   LOG_FUNC
   //Start() should never be called if started, starting or stopping (or in state EUsbServiceFatalError)
-  __ASSERT_DEBUG(iState == EUsbServiceIdle, _USB_PANIC(KObexCcPanicCategory, EBadApiCallStart));
+  ASSERT_DEBUG(iState == EUsbServiceIdle, EBadApiCallStart );
 
   // Start OBEX SM
   iRequestStatus = &aStatus;
   iState = EUsbServiceStarting;
   aStatus = KRequestPending;
-  LOGTEXT(_L8("CUsbObexClassController::Start() calling ManageUSBService(ETrue)")); 
+  LOG("CUsbObexClassController::Start() calling ManageUSBService(ETrue)"); 
   iObexSM->ManageUSBServices(ETrue, iStatus);
   SetActive();
   }
@@ -127,10 +122,10 @@
   {
 
   LOG_FUNC
-  LOGTEXT2(_L8("CUsbObexClassController::Stop iState = %d"), iState);
+  LOG1("CUsbObexClassController::Stop iState = %d", iState);
   
   //Stop() should never be called if stopping or starting (or in state EUsbServiceFatalError)
-  __ASSERT_DEBUG(iState == EUsbServiceStarted || iState == EUsbServiceIdle, _USB_PANIC(KObexCcPanicCategory, EBadApiCallStop));
+  ASSERT_DEBUG(iState == EUsbServiceStarted || iState == EUsbServiceIdle, EBadApiCallStop );
 
   //state may be idle after Cancel
   if ( iState == EUsbServiceIdle )
@@ -144,7 +139,7 @@
     iRequestStatus = &aStatus;
     iState = EUsbServiceStopping;   
     aStatus = KRequestPending;
-    LOGTEXT(_L8("CUsbObexClassController::Stop() calling ManageUSBService(EFalse)")); 
+    LOG("CUsbObexClassController::Stop() calling ManageUSBService(EFalse)"); 
     iObexSM->ManageUSBServices(EFalse, iStatus);
     SetActive();
     }
@@ -160,11 +155,11 @@
   LOG_FUNC
   if (iStatus != KErrNone)
     {
-    LOGTEXT2(_L8("CUsbObexClassController::RunL() Error = %d"), iStatus.Int());
+    LOG1("CUsbObexClassController::RunL() iStatus = %d", iStatus.Int());
     User::RequestComplete(iRequestStatus, iStatus.Int());
     return;
     }
-  LOGTEXT2(_L8("CUsbObexClassController::RunL() State is %d"), iState);
+  LOG1("CUsbObexClassController::RunL() State is %d", iState);
 
             switch (iState)
                 {
@@ -182,7 +177,8 @@
                 case EUsbServiceIdle:
 
                 default:
-            LOGTEXT(_L8("CUsbObexClassController::RunL() Error or Unknown State"));
+            	     LOG("CUsbObexClassController::RunL() Unknown State");
+            		 PANIC(EUnkownState);
                     break;
                 }
   }
@@ -198,7 +194,7 @@
   TRAPD(ret, DoGetDescriptorInfoL(aDescriptorInfo));
         if(ret!=KErrNone)
           {
-                 LOGTEXT2(_L8("CUsbObexClassController::GetDescriptorInfo leave with code: %d"), ret);
+                 LOG1("CUsbObexClassController::GetDescriptorInfo leave with code: %d", ret);
           }
         }
 
@@ -217,7 +213,7 @@
         resolverParams.SetWildcardMatch(EFalse);
         REComSession::ListImplementationsL(KCSrcsInterfaceUid, resolverParams, implInfoArray);
 
-        LOGTEXT2(_L8("CUsbObexClassController::DoGetDescriptorInfoL Number of Interfaces is %d"),
+        LOG1("CUsbObexClassController::DoGetDescriptorInfoL Number of Interfaces is %d",
                    implInfoArray.Count());
         aDescriptorInfo.iNumInterfaces = (implInfoArray.Count())*KObexNumInterfaces;
         aDescriptorInfo.iLength = 0;
@@ -242,7 +238,7 @@
       break;
 
     default:
-      __ASSERT_DEBUG( EFalse, _USB_PANIC(KObexCcPanicCategory, EBadAsynchronousCall) );
+      ASSERT_DEBUG( EFalse,  EBadAsynchronousCall );
       break;
     }
 
@@ -259,14 +255,14 @@
 TInt CUsbObexClassController::RunError(TInt aError)
   {
   LOG_FUNC
-  LOGTEXT2(_L8("CUsbObexClassController::RunError aError=%d"), aError);
+  LOG1("CUsbObexClassController::RunError aError=%d", aError);
   return KErrNone;
   }
 
 void CUsbObexClassController::MosmError(TInt aError)
     {
     LOG_FUNC
-    LOGTEXT2(_L8("CUsbObexClassController::MosmError aError=%d"), aError);
+    LOG1("CUsbObexClassController::MosmError aError=%d", aError);
     Owner().UccnError(aError);
     }