telephonyserverplugins/common_tsy/commontsy/src/mmpacket/Cmmpacketcontextlist.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 
    17 
    18 // INCLUDE FILES
    18 // INCLUDE FILES
       
    19 
       
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "CmmpacketcontextlistTraces.h"
       
    23 #endif
       
    24 
    19 #include "Cmmpacketcontextlist.h"
    25 #include "Cmmpacketcontextlist.h"
    20 #include "Cmmpacketservicetsy.h"
    26 #include "Cmmpacketservicetsy.h"
    21 #include "Cmmpacketcontexttsy.h"
    27 #include "Cmmpacketcontexttsy.h"
    22 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
    28 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
    23 
    29 
    34 
    40 
    35 CMmPacketContextList* CMmPacketContextList::NewL(
    41 CMmPacketContextList* CMmPacketContextList::NewL(
    36         CMmPacketServiceTsy* const aPacketService )
    42         CMmPacketServiceTsy* const aPacketService )
    37     {
    43     {
    38 
    44 
    39 TFLOGSTRING("TSY: CMmPacketContextList* CMmPacketContextList::NewL." );
    45 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_NEWL_1, "TSY: CMmPacketContextList* CMmPacketContextList::NewL." );
    40 
    46 
    41     CMmPacketContextList* const contextList =
    47     CMmPacketContextList* const contextList =
    42         new ( ELeave ) CMmPacketContextList();
    48         new ( ELeave ) CMmPacketContextList();
    43 
    49 
    44     CleanupStack::PushL( contextList );
    50     CleanupStack::PushL( contextList );
   112         CMmPacketContextTsy* const aContext, 
   118         CMmPacketContextTsy* const aContext, 
   113         const TInt aChannelId,              
   119         const TInt aChannelId,              
   114         const TUint8 /* aObjectId */,
   120         const TUint8 /* aObjectId */,
   115         const TInfoName& aContextName )      
   121         const TInfoName& aContextName )      
   116     {
   122     {
   117 TFLOGSTRING3("TSY: CMmPacketContextList::AddObject. Context Name: %S Channel Id: %d", &aContextName, aChannelId );
   123 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_ADDOBJECT_1, "TSY: CMmPacketContextList::AddObject. Context Name: %S Channel Id: %d", aContextName, aChannelId );
   118 
   124 
   119     TInt ret( KErrArgument );
   125     TInt ret( KErrArgument );
   120 
   126 
   121     if ( !( aContext->IsDialUpContext( NULL ) ) )
   127     if ( !( aContext->IsDialUpContext( NULL ) ) )
   122         {
   128         {
   182 //
   188 //
   183 TInt CMmPacketContextList::RemoveObject(
   189 TInt CMmPacketContextList::RemoveObject(
   184         CMmPacketContextTsy* const aContext )
   190         CMmPacketContextTsy* const aContext )
   185     {
   191     {
   186 
   192 
   187 TFLOGSTRING("TSY: CMmPacketContextList::RemoveObject." );
   193 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_REMOVEOBJECT_1, "TSY: CMmPacketContextList::RemoveObject." );
   188 
   194 
   189     // Set ret to KErrArgument to check that context is in list
   195     // Set ret to KErrArgument to check that context is in list
   190     TInt ret( KErrArgument );
   196     TInt ret( KErrArgument );
   191 
   197 
   192     if ( !( aContext->IsDialUpContext( NULL ) ) )
   198     if ( !( aContext->IsDialUpContext( NULL ) ) )
   210                         ret = CMmTsyObjectList::RemoveObject( aContext );
   216                         ret = CMmTsyObjectList::RemoveObject( aContext );
   211 
   217 
   212                         if ( KErrNone == ret )
   218                         if ( KErrNone == ret )
   213                             {
   219                             {
   214 
   220 
   215 TFLOGSTRING2("TSY: CMmPacketContextList::RemoveObject. Context Name: %S", &iContextInfoArray[i].iContextName );
   221 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_REMOVEOBJECT_2, "TSY: CMmPacketContextList::RemoveObject. Context Name: %S", iContextInfoArray[i].iContextName );
   216                             // Release Proxy id
   222                             // Release Proxy id
   217                             iProxyIdList[j].iIsFree = ETrue;
   223                             iProxyIdList[j].iIsFree = ETrue;
   218             
   224             
   219                             // Get index to last reserved cell in the list
   225                             // Get index to last reserved cell in the list
   220                             const TInt lastContext(
   226                             const TInt lastContext(
   498             }
   504             }
   499         }
   505         }
   500 
   506 
   501     *aCount = count;
   507     *aCount = count;
   502 
   508 
   503 TFLOGSTRING2("TSY: CMmPacketContextList::EnumerateNifs. Number of Nifs: %d", aCount );
   509 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_ENUMERATENIFS_1, "TSY: CMmPacketContextList::EnumerateNifs. Number of Nifs: %d", aCount );
   504     }
   510     }
   505 
   511 
   506 // ---------------------------------------------------------------------------
   512 // ---------------------------------------------------------------------------
   507 // CMmPacketContextList::GetNifInfo
   513 // CMmPacketContextList::GetNifInfo
   508 // Return information about network interface
   514 // Return information about network interface
   512 TInt CMmPacketContextList::GetNifInfo(
   518 TInt CMmPacketContextList::GetNifInfo(
   513         const TInt* aIndex,   
   519         const TInt* aIndex,   
   514         RPacketService::TNifInfoV2* aNifInfoV2 ) 
   520         RPacketService::TNifInfoV2* aNifInfoV2 ) 
   515     {
   521     {
   516 
   522 
   517 TFLOGSTRING("TSY: CMmPacketContextList::GetNifInfo." );
   523 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_GETNIFINFO_1, "TSY: CMmPacketContextList::GetNifInfo." );
   518 
   524 
   519     TInt index = *aIndex;
   525     TInt index = *aIndex;
   520 
   526 
   521     TInt nifContextsCount( 0 );
   527     TInt nifContextsCount( 0 );
   522 
   528 
   623 //
   629 //
   624 void CMmPacketContextList::EnumerateContextsInNif(
   630 void CMmPacketContextList::EnumerateContextsInNif(
   625         const TInfoName aExistingContextName, 
   631         const TInfoName aExistingContextName, 
   626         TInt* aCount )
   632         TInt* aCount )
   627     {
   633     {
   628 TFLOGSTRING("TSY: CMmPacketContextList::EnumerateContextsInNif." );
   634 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_ENUMERATECONTEXTSINNIF_1, "TSY: CMmPacketContextList::EnumerateContextsInNif." );
   629 
   635 
   630     TInt count( 0 );
   636     TInt count( 0 );
   631 
   637 
   632     for ( TInt g = 0 ;CMmPacketContextList::NumberOfContexts() > g ; g++ )
   638     for ( TInt g = 0 ;CMmPacketContextList::NumberOfContexts() > g ; g++ )
   633         {
   639         {
   699 //
   705 //
   700 TInt CMmPacketContextList::GetContextNameInNif(
   706 TInt CMmPacketContextList::GetContextNameInNif(
   701         const RPacketService::TContextNameInNif* aContextNameInNif,
   707         const RPacketService::TContextNameInNif* aContextNameInNif,
   702         TDes* aContextName )
   708         TDes* aContextName )
   703     {
   709     {
   704 TFLOGSTRING("TSY: CMmPacketContextList::GetContextNameInNif." );
   710 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETCONTEXTLIST_GETCONTEXTNAMEINNIF_1, "TSY: CMmPacketContextList::GetContextNameInNif." );
   705 
   711 
   706     TInt index = aContextNameInNif->iIndex;
   712     TInt index = aContextNameInNif->iIndex;
   707 
   713 
   708     TInt count( 0 );
   714     TInt count( 0 );
   709 
   715