wlanutilities/wlansniffer/engine/server/src/wsfengine.cpp
branchRCL_3
changeset 20 a9524956f6b5
parent 12 981afc7d3841
equal deleted inserted replaced
18:aaabc7526ded 20:a9524956f6b5
   479 
   479 
   480     LOG_WRITEF( "deleting temporary IAP id = %d", aIapId );
   480     LOG_WRITEF( "deleting temporary IAP id = %d", aIapId );
   481     RCmManagerExt cmMgr;
   481     RCmManagerExt cmMgr;
   482     cmMgr.OpenLC();
   482     cmMgr.OpenLC();
   483     
   483     
       
   484     RArray<TUint32> cmIds;
       
   485     CleanupClosePushL( cmIds );
       
   486     cmMgr.ConnectionMethodL( cmIds, ETrue, ETrue, EFalse );
       
   487     TBool foundFromUncategorized = EFalse;
       
   488     
       
   489     for ( TInt k = 0; k < cmIds.Count(); k++ )
       
   490         {
       
   491         RCmConnectionMethodExt cm;
       
   492         TRAPD( error, cm = cmMgr.ConnectionMethodL( cmIds[k] ) );
       
   493         if ( KErrNone == error )
       
   494             {
       
   495             CleanupClosePushL( cm );
       
   496 
       
   497             TUint iapId = cm.GetIntAttributeL( CMManager::ECmIapId );
       
   498             if ( iapId == aIapId )
       
   499                 {
       
   500                 LOG_WRITE( "IAP is uncategorized" );
       
   501                 foundFromUncategorized = ETrue;
       
   502                 }
       
   503             CleanupStack::PopAndDestroy( &cm );
       
   504             }
       
   505         }
       
   506     
       
   507     CleanupStack::PopAndDestroy( &cmIds );
       
   508     
       
   509     if ( !foundFromUncategorized )
       
   510         {
       
   511         LOG_WRITE( "Not deleting IAP since it is in SNAP" );
       
   512         CleanupStack::PopAndDestroy( &cmMgr );
       
   513         return;
       
   514         }
       
   515     
   484     RCmConnectionMethodExt ictCm = cmMgr.ConnectionMethodL( aIapId );
   516     RCmConnectionMethodExt ictCm = cmMgr.ConnectionMethodL( aIapId );
   485     CleanupClosePushL( ictCm );
   517     CleanupClosePushL( ictCm );
   486 
   518 
   487     CWsfActiveWaiter* waiter = CWsfActiveWaiter::NewLC();
   519     CWsfActiveWaiter* waiter = CWsfActiveWaiter::NewLC();
   488 
   520 
   540 
   572 
   541 // ----------------------------------------------------------------------------
   573 // ----------------------------------------------------------------------------
   542 // CWsfEngine::ConnectWlanL
   574 // CWsfEngine::ConnectWlanL
   543 // ----------------------------------------------------------------------------
   575 // ----------------------------------------------------------------------------
   544 //
   576 //
   545 TInt CWsfEngine::ConnectWlanL( TUint32 aIapId, 
   577 TInt CWsfEngine::ConnectWlanL( TUint32 aIapId,
       
   578                                TBool aConnectOnly,
   546                                TWsfIapPersistence aPersistence )
   579                                TWsfIapPersistence aPersistence )
   547     {
   580     {
   548     LOG_ENTERFN( "CWsfEngine::ConnectWlanL" );
   581     LOG_ENTERFN( "CWsfEngine::ConnectWlanL" );
   549     LOG_WRITEF( "iapId = %d, persistence = %d", aIapId, aPersistence );
   582     LOG_WRITEF( "iapId = %d, persistence = %d", aIapId, aPersistence );
   550     
   583     
   566             aPersistence = EIapNestedExpireOnDisconnect;
   599             aPersistence = EIapNestedExpireOnDisconnect;
   567             }
   600             }
   568         iSuppressIapDeletion = EFalse;
   601         iSuppressIapDeletion = EFalse;
   569         }
   602         }
   570 
   603 
   571     TInt ret = iWlanBearerMonitor->ConnectBearer( aIapId );
   604     TInt ret = iWlanBearerMonitor->ConnectBearer( aIapId, 
       
   605                                                   aConnectOnly,
       
   606                                                   aPersistence != EIapPersistent );
   572     
   607     
   573     if ( !ret )
   608     if ( !ret )
   574         {
   609         {
   575         // successfully initiated connection
   610         // successfully initiated connection
   576         LOG_WRITE( "connection init succeded" );
   611         LOG_WRITE( "connection init succeded" );