diff -r f92a4f87e424 -r 012cc2ee6408 usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/acmserver/src/acmserverimpl.cpp --- a/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/acmserver/src/acmserverimpl.cpp Tue Aug 31 17:01:47 2010 +0300 +++ b/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/acmserver/src/acmserverimpl.cpp Wed Sep 01 12:35:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-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" @@ -20,29 +20,27 @@ */ #include +#include "acmserverimpl.h" +#include #include -#include "acmserverimpl.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "acmserverimplTraces.h" + +#ifdef __FLOG_ACTIVE +_LIT8(KLogComponent, "ACMSVRCLI"); #endif /** Constructor */ CAcmServerImpl::CAcmServerImpl() { - OstTraceFunctionEntry0( CACMSERVERIMPL_CACMSERVERIMPL_CONS_ENTRY ); - - OstTraceFunctionExit0( CACMSERVERIMPL_CACMSERVERIMPL_CONS_EXIT ); + LOG_FUNC } /** Destructor */ CAcmServerImpl::~CAcmServerImpl() { - OstTraceFunctionEntry0( CACMSERVERIMPL_CACMSERVERIMPL_DES_ENTRY); - + LOG_FUNC + iCommServ.Close(); iAcmServerClient.Close(); - OstTraceFunctionExit0( CACMSERVERIMPL_CACMSERVERIMPL_ENTRY_DES_EXIT ); } /** @@ -51,61 +49,41 @@ */ CAcmServerImpl* CAcmServerImpl::NewL() { - OstTraceFunctionEntry0( CACMSERVERIMPL_NEWL_ENTRY ); - + LOG_STATIC_FUNC_ENTRY + CAcmServerImpl* self = new(ELeave) CAcmServerImpl; CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - OstTraceFunctionExit0( CACMSERVERIMPL_NEWL_EXIT ); return self; } void CAcmServerImpl::ConstructL() { - OstTraceFunctionEntry0( CACMSERVERIMPL_CONSTRUCTL_ENTRY ); - + LOG_FUNC // In order to connect a session, the ECACM CSY must be loaded (it // contains the server). - TInt err; - err = iCommServ.Connect(); - if (err < 0) - { - OstTrace1( TRACE_ERROR, CACMSERVERIMPL_CONSTRUCTL, "CAcmServerImpl::ConstructL;err=%d", err ); - User::Leave(err); - } - - err = iCommServ.LoadCommModule(KAcmCsyName); - if (err < 0) - { - OstTrace1( TRACE_ERROR, CACMSERVERIMPL_CONSTRUCTL_DUP1, "CAcmServerImpl::ConstructL;err=%d", err ); - User::Leave(err); - } - + LEAVEIFERRORL(iCommServ.Connect()); + LEAVEIFERRORL(iCommServ.LoadCommModule(KAcmCsyName)); // NB RCommServ::Close undoes LoadCommModule. - err = iAcmServerClient.Connect(); - if (err < 0) - { - OstTrace1( TRACE_ERROR, CACMSERVERIMPL_CONSTRUCTL_DUP2, "CAcmServerImpl::ConstructL;err=%d", err ); - User::Leave(err); - } - + LEAVEIFERRORL(iAcmServerClient.Connect()); // iCommServ is eventually cleaned up in our destructor. It must be held // open at least as long as our session on the ACM server, otherwise // there's a risk the ACM server will be pulled from under our feet. - OstTraceFunctionExit0( CACMSERVERIMPL_CONSTRUCTL_EXIT ); } TInt CAcmServerImpl::CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum, const TDesC& aAcmControlIfcName, const TDesC& aAcmDataIfcName) { - OstTraceFunctionEntry0( CACMSERVERIMPL_CREATEFUNCTIONS_ENTRY ); + LOG_FUNC + return iAcmServerClient.CreateFunctions(aNoAcms, aProtocolNum, aAcmControlIfcName, aAcmDataIfcName); } TInt CAcmServerImpl::DestroyFunctions(const TUint aNoAcms) { - OstTraceFunctionEntry0( CACMSERVERIMPL_DESTROYFUNCTIONS_ENTRY ); - OstTrace1( TRACE_NORMAL, CACMSERVERIMPL_DESTROYFUNCTIONS, "CAcmServerImpl::DestroyFunctions;aNoAcms=%d", aNoAcms ); + LOG_FUNC + LOGTEXT2(_L8("\taNoAcms = %d"), aNoAcms); + return iAcmServerClient.DestroyFunctions(aNoAcms); }