diff -r 17af172ffa5f -r 630d2f34d719 telephonyprotocols/rawipnif/rawipnif2/src/BcaController.cpp --- a/telephonyprotocols/rawipnif/rawipnif2/src/BcaController.cpp Thu Aug 19 11:03:36 2010 +0300 +++ b/telephonyprotocols/rawipnif/rawipnif2/src/BcaController.cpp Tue Aug 31 16:23:08 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2004-2010 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" @@ -19,21 +19,26 @@ @file */ + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "BcaControllerTraces.h" +#endif + #include #include #include "Constants.h" #include "BcaController.h" -CBcaController::CBcaController(CRawIP2Flow& aRawIPFlow,CBttLogger* aTheLogger) +CBcaController::CBcaController(CRawIP2Flow& aRawIPFlow) /** * Constructor. Performs standard active object initialisation. * * @param aRawIPFlow Reference to the RawIp2Flow - * @param aTheLogger The logging object + * */ : CActive(EPriorityStandard), - iTheLogger(aTheLogger), iMBca(NULL), iState(EIdling), iRawIPFlow(aRawIPFlow), @@ -45,17 +50,16 @@ CActiveScheduler::Add(this); } -CBcaController* CBcaController::NewL(CRawIP2Flow& aRawIPFlow,CBttLogger* aTheLogger) +CBcaController* CBcaController::NewL(CRawIP2Flow& aRawIPFlow) /** * Two-phase constructor. Creates a new CBcaController object, performs * second-phase construction, then returns it. * * @param aRawIPFlow Reference to the RawIp2Flow - * @param aTheLogger The logging object * @return A newly constructed CBcaController object */ { - CBcaController* self = new (ELeave) CBcaController(aRawIPFlow,aTheLogger); + CBcaController* self = new (ELeave) CBcaController(aRawIPFlow); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); @@ -67,7 +71,7 @@ * Second-phase constructor. Creates all the state objects it owns. */ { - _LOG_L1C1(_L8("CBcaController::ConstructL")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_CONSTRUCTL_1, "CBcaController::ConstructL"); } @@ -92,7 +96,7 @@ * */ { - _LOG_L1C1(_L8("CBcaControl::RunL() called")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_1, "CBcaControl::RunL() called"); switch (iState) { //in this state, Ioctl is called to set IAP ID, check the result of @@ -104,11 +108,11 @@ { if(iStatus == KErrNotSupported) { - _LOG_L1C1(_L8("This BCA does not support IAPID set")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_2, "This BCA does not support IAPID set"); } else { - _LOG_L2C1(_L8("This BCA supports IAPID set")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_3, "This BCA supports IAPID set"); } TPtrC bcaStack = iBCAProvisionConfig->GetBCAStack(); @@ -128,7 +132,7 @@ } else { - _LOG_L1C2(_L8("ERROR in BCA IAPID set = %d"), iStatus.Int()); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_4, "ERROR in BCA IAPID set = %d", iStatus.Int()); Stop(iStatus.Int()); } @@ -142,18 +146,18 @@ { if(iStatus == KErrNotSupported) { - _LOG_L1C1(_L8("This BCA does not support BCA stacking")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_5, "This BCA does not support BCA stacking"); } else { - _LOG_L2C1(_L8("This BCA supports BCA stacking")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_6, "This BCA supports BCA stacking"); } iBcaParams = new(ELeave) MBca2::TBcaParams(const_cast(iBCAProvisionConfig)->GetCommsPond(), iBCAProvisionConfig->GetPortName()); TInt aErr = iMBca->Open(*iUpperControl,*iUpperDataReceiver,*iBcaParams); if ( aErr != KErrNone) { - _LOG_L2C2(_L8("ERROR in BCA Open = %d"), aErr); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_7, "ERROR in BCA Open = %d", aErr); Stop(iStatus.Int()); iState = EIdling; } @@ -164,7 +168,7 @@ } else { - _LOG_L2C2(_L8("ERROR in BCA stack set = %d"), iStatus.Int()); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_8, "ERROR in BCA stack set = %d", iStatus.Int()); Stop(iStatus.Int()); } break; @@ -172,8 +176,9 @@ // Wrong state. default: { - _LOG_L1C1(_L8("ERROR CBcaControl::RunL(): Unknown state")); - _BTT_PANIC(KNifName, KBcaUnkownState); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_9, "ERROR CBcaControl::RunL(): Unknown state"); + OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_RUNL_10, "PANIC: %S %d", KNifName, KBcaUnkownState); + User::Panic(KNifName, KBcaUnkownState); break; } } @@ -185,8 +190,8 @@ * cancel active request. */ { - _LOG_L1C1(_L8("CBcaControl::DoCancel called.")); - _LOG_L2C2(_L8("iState value is %d"), iState); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_DOCANCEL_1, "CBcaControl::DoCancel called."); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_DOCANCEL_2, "iState value is %d", iState); switch (iState) { case EIdling: @@ -198,8 +203,9 @@ iState = EIdling; break; default: - _LOG_L2C1(_L8("ERROR CBcaControl::DoCancel(): Unknown state")); - _BTT_PANIC(KNifName, KBcaUnkownState); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_DOCANCEL_3, "ERROR CBcaControl::DoCancel(): Unknown state"); + OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_DOCANCEL_4, "PANIC: %S %d", KNifName, KBcaUnkownState); + User::Panic(KNifName, KBcaUnkownState); break; } } @@ -215,7 +221,7 @@ * @return none */ { - _LOG_L1C1(_L8("CBcaControl::StartLoad")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_STARTLOADL_1, "CBcaControl::StartLoad"); iBCAProvisionConfig = aBCAProvisionConfig; iUpperControl = aControl; @@ -226,7 +232,7 @@ TNewBca2FactoryL newBca2FactoryProcL = (TNewBca2FactoryL)iBcaDll.iObj.Lookup(1); if (NULL == newBca2FactoryProcL) { - _LOG_L1C2(_L8("Library entry point found error %d"), KErrBadLibraryEntryPoint); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_STARTLOADL_2, "Library entry point found error %d", KErrBadLibraryEntryPoint); User::Leave(KErrBadLibraryEntryPoint); } @@ -234,7 +240,7 @@ if(!bcaFactory) { - _LOG_L1C2(_L8("BcaFactory creation error %d"), KErrCompletion); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_STARTLOADL_3, "BcaFactory creation error %d", KErrCompletion); User::Leave(KErrCompletion); } CleanupReleasePushL(*bcaFactory); @@ -255,7 +261,7 @@ * requests on the active objects owned by this module and shutdown. */ { - _LOG_L1C1(_L8("CBcaController::Stop is called.")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_STOP_1, "CBcaController::Stop is called."); if(iMBca) { @@ -263,7 +269,7 @@ } else { - _LOG_L1C1(_L8("CBcaController::Stop Bca is not initialized. Bring the link layer down")); + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_STOP_2, "CBcaController::Stop Bca is not initialized. Bring the link layer down"); iRawIPFlow.LinkLayerDown(aError); } } @@ -274,7 +280,7 @@ * @param aPanic panic code */ void Panic(TRawIP2NifPanic aPanic) { - _LOG_L2C2(_L8("Panic code for RawIpNif = %d"), aPanic); + OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBCACONTROLLER_PANIC_1, "Panic code for RawIpNif = %d", aPanic); User::Panic(KNifName,aPanic); }