convergedconnectionhandler/cchclientapi/src/cchuiconnectionhandler.cpp
branchRCL_3
changeset 8 7117cbf1600a
parent 0 a4daefaec16c
child 9 bddb6d4447db
equal deleted inserted replaced
6:fc8c25e5a2e8 8:7117cbf1600a
   100     TWlanConnectionMode connectionMode; 
   100     TWlanConnectionMode connectionMode; 
   101     
   101     
   102     // Security mode of the WLAN network
   102     // Security mode of the WLAN network
   103     TWlanConnectionSecurityMode securityMode; 
   103     TWlanConnectionSecurityMode securityMode; 
   104     
   104     
       
   105     // Flag for determining if hidden wlan
       
   106     TBool hiddenWlan( EFalse );
       
   107     
   105     CCHUIDEBUG( 
   108     CCHUIDEBUG( 
   106         "CCchUiConnectionHandler::SearchAccessPointsL - begin search wlan" );
   109         "CCchUiConnectionHandler::SearchAccessPointsL - begin search wlan" );
   107         
   110         
   108     TBool ret = iConnUiUtils->SearchWLANNetwork( 
   111     TBool ret = iConnUiUtils->SearchWLANNetwork( 
   109         ssid, connectionMode, securityMode );
   112         ssid, connectionMode, securityMode );
   116         }
   119         }
   117     
   120     
   118     CCHUIDEBUG( 
   121     CCHUIDEBUG( 
   119       "CCchUiConnectionHandler::SearchAccessPointsL - search wlan finished" ); 
   122       "CCchUiConnectionHandler::SearchAccessPointsL - search wlan finished" ); 
   120     
   123     
       
   124     // Check if hidden wlan
       
   125     TUint32 easyWlanId( 0 );
       
   126     easyWlanId = iCmManagerExt.EasyWlanIdL();
       
   127     
       
   128     if ( easyWlanId )
       
   129         {
       
   130         RCmConnectionMethodExt cmConnMethodExt = 
       
   131             iCmManagerExt.ConnectionMethodL( easyWlanId );
       
   132         CleanupClosePushL( cmConnMethodExt );
       
   133         
       
   134         if ( cmConnMethodExt.GetBoolAttributeL( CMManager::EWlanScanSSID ) )
       
   135             {
       
   136         CCHUIDEBUG( 
       
   137              "CCchUiConnectionHandler::SearchAccessPointsL - hidden wlan" );
       
   138         
       
   139             hiddenWlan = ETrue;
       
   140             }
       
   141         
       
   142         CleanupStack::PopAndDestroy( &cmConnMethodExt );
       
   143         }
       
   144     
   121     HBufC* ssid16 = HBufC::NewL( KSsidLength );
   145     HBufC* ssid16 = HBufC::NewL( KSsidLength );
   122     CleanupStack::PushL( ssid16 );
   146     CleanupStack::PushL( ssid16 );
   123     
   147     
   124     TPtr ssid16Ptr( ssid16->Des() );
   148     TPtr ssid16Ptr( ssid16->Des() );
   125     ssid16Ptr.Copy( ssid );
   149     ssid16Ptr.Copy( ssid );
   155         CleanupClosePushL( newDestination );
   179         CleanupClosePushL( newDestination );
   156         
   180         
   157         TBool alreadyExists = EFalse;
   181         TBool alreadyExists = EFalse;
   158 
   182 
   159         TInt iapId = AddNewConnectionMethodL( 
   183         TInt iapId = AddNewConnectionMethodL( 
   160             newDestination, *ssid16, securityMode, alreadyExists, EFalse );
   184             newDestination, 
       
   185             *ssid16, 
       
   186             securityMode,
       
   187             alreadyExists,
       
   188             hiddenWlan );
   161         
   189         
   162         if ( KErrCancel == iapId )
   190         if ( KErrCancel == iapId )
   163             {
   191             {
   164             //Leave with cancel if user pressed Cancel softkey
   192             //Leave with cancel if user pressed Cancel softkey
   165             CleanupStack::PopAndDestroy( &newDestination );
   193             CleanupStack::PopAndDestroy( &newDestination );
   189             iCmManagerExt.DestinationL( aSnapId );
   217             iCmManagerExt.DestinationL( aSnapId );
   190         CleanupClosePushL( destination );
   218         CleanupClosePushL( destination );
   191         
   219         
   192         TBool alreadyExists = EFalse;
   220         TBool alreadyExists = EFalse;
   193         TInt iapId = AddNewConnectionMethodL( 
   221         TInt iapId = AddNewConnectionMethodL( 
   194             destination, *ssid16, securityMode, alreadyExists, EFalse );
   222             destination,
       
   223             *ssid16,
       
   224             securityMode,
       
   225             alreadyExists, 
       
   226             hiddenWlan );
   195         
   227         
   196         CleanupStack::PopAndDestroy( &destination );
   228         CleanupStack::PopAndDestroy( &destination );
   197         CleanupStack::PopAndDestroy( ssid16 );
   229         CleanupStack::PopAndDestroy( ssid16 );
   198         
   230         
   199         if ( KErrCancel == iapId )
   231         if ( KErrCancel == iapId )
   226                 User::Leave( KErrCancel );
   258                 User::Leave( KErrCancel );
   227                 }
   259                 }
   228             }
   260             }
   229         
   261         
   230         SetSnapToUseL( aServiceId, aSnapId ); 
   262         SetSnapToUseL( aServiceId, aSnapId ); 
       
   263         }
       
   264     
       
   265     // Reset Easy Wlan EWlanScanSSID parameter to EFalse
       
   266     if ( easyWlanId && hiddenWlan )
       
   267         {
       
   268         RCmConnectionMethodExt cmConnMethodExt = 
       
   269             iCmManagerExt.ConnectionMethodL( easyWlanId );
       
   270         CleanupClosePushL( cmConnMethodExt );
       
   271         cmConnMethodExt.SetBoolAttributeL( CMManager::EWlanScanSSID, EFalse );
       
   272         cmConnMethodExt.UpdateL();
       
   273         CleanupStack::PopAndDestroy( &cmConnMethodExt );
   231         }
   274         }
   232     
   275     
   233     CCHUIDEBUG( "CCchUiConnectionHandler::SearchAccessPointsL - OUT" );
   276     CCHUIDEBUG( "CCchUiConnectionHandler::SearchAccessPointsL - OUT" );
   234     } 
   277     } 
   235 
   278