wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp
branchRCL_3
changeset 20 a9524956f6b5
parent 18 aaabc7526ded
equal deleted inserted replaced
18:aaabc7526ded 20:a9524956f6b5
   157 void CWsfWlanScanner::DoCancel()
   157 void CWsfWlanScanner::DoCancel()
   158     {
   158     {
   159     LOG_ENTERFN( "CWsfWlanScanner::DoCancel" );
   159     LOG_ENTERFN( "CWsfWlanScanner::DoCancel" );
   160     iTimer.Cancel();
   160     iTimer.Cancel();
   161 #ifndef __WINS__
   161 #ifndef __WINS__
       
   162     iWlanMgmtClient->CancelGetAvailableIaps();
   162     iWlanMgmtClient->CancelGetScanResults();
   163     iWlanMgmtClient->CancelGetScanResults();
   163 #endif    
   164 #endif    
   164     iScanState = EIdle;    
   165     iScanState = EIdle;    
   165     }
   166     }
   166  
   167  
   174     LOG_ENTERFN( "CWsfWlanScanner::RunL" );
   175     LOG_ENTERFN( "CWsfWlanScanner::RunL" );
   175     
   176     
   176     /*
   177     /*
   177      * Scan logic
   178      * Scan logic
   178      * 1. Get available IAPs - state = EIdle
   179      * 1. Get available IAPs - state = EIdle
   179      * 2. Do broadcast scan - state = EIdle
   180      * 2. Do broadcast scan - state = EBroadcastScan
   180      * 3. Process broadcast scan results - state = EBroadcastScan
   181      * 3. Process broadcast scan results - state = EProcessBroadcastScan
   181      * 4. Do direct scans for remaining known networks
   182      * 4. Do direct scans for remaining known networks
   182      *    from step 2. Get available IAPs - state = EDirectScan
   183      *    from step 2. Get available IAPs - state = EDirectScan
   183      * 5. Add connected network - state = EFinished
   184      * 5. Add connected network - state = EFinished
   184      * 6. Set names and priorities for known networks - state = EFinished
   185      * 6. Set names and priorities for known networks - state = EFinished
   185      */
   186      */
   186 
   187 
   187     if ( iScanState == EIdle )
   188     if ( iScanState == EIdle )
   188         {
   189         {
   189         LOG_WRITE( "broadcast scan phase" );
   190         LOG_WRITE( "Get available IAPs scan phase" );
   190 
   191 
   191         // prepare things for direct scans
   192         // prepare things for direct scans
   192         PrepareDirectScan();
   193         PrepareDirectScan();
   193           
   194           
   194         // notify clients
   195         // notify clients
   195         if ( iObserver )
   196         if ( iObserver )
   196             {
   197             {
   197             iObserver->WlanScanStarted();
   198             iObserver->WlanScanStarted();
   198             }
   199             }
   199 
       
   200         
   200         
   201 #ifndef __WINS__
   201 #ifndef __WINS__
   202         // get available iaps
   202         // get available iaps
   203         // (this only shows iaps with security mode matching to scan results
   203         // (this only shows iaps with security mode matching to scan results
   204         // and  also finds hidden wlans for which an iap has been configured)
   204         // and  also finds hidden wlans for which an iap has been configured)
   205         iAvailableIaps.Reset();
   205         iAvailableIaps.Reset();
   206         iWlanMgmtClient->GetAvailableIaps( iAvailableIaps );
   206         iWlanMgmtClient->GetAvailableIaps( iCacheLifetime, 
   207         
   207                                            iMaxDelay, 
   208 		// do broadcast scan
   208                                            EFalse, 
       
   209                                            iStatus, 
       
   210                                            iAvailableIaps );
       
   211         SetActive();
       
   212 #else
       
   213         // for testing
       
   214         SetActive();
       
   215         TRequestStatus* status = &iStatus;
       
   216         User::RequestComplete( status, KErrNone );
       
   217 #endif 
       
   218         iScanState = EBroadcastScan;
       
   219         }
       
   220         
       
   221     else if ( iScanState == EBroadcastScan )
       
   222         {
       
   223         LOG_WRITEF( "GetAvailableIaps returned iStatus=%d", iStatus.Int() );
       
   224         if ( iStatus.Int() )
       
   225             {
       
   226             LOG_WRITE( "Error in getting available IAPs - leave" );
       
   227             User::Leave( iStatus.Int() );
       
   228             }
       
   229         
       
   230 #ifdef _DEBUG
       
   231         for ( TInt i = 0; i < iAvailableIaps.Count(); ++i )
       
   232             {
       
   233             LOG_WRITEF( "iAvailableIaps array index[%d] IapId[%d] rssi[%d]", i,
       
   234                         iAvailableIaps[i].iIapId, iAvailableIaps[i].iRssi );
       
   235             }
       
   236 #endif
       
   237     
       
   238 #ifndef __WINS__ 
       
   239         // do broadcast scan
   209         iWlanMgmtClient->GetScanResults( iStatus, *iScanInfo );
   240         iWlanMgmtClient->GetScanResults( iStatus, *iScanInfo );
   210         SetActive();
   241         SetActive();
   211 #else
   242 #else
   212         // for testing
   243         // for testing
   213         SetActive();
   244         SetActive();
   214         TRequestStatus* status = &iStatus;
   245         TRequestStatus* status = &iStatus;
   215         User::RequestComplete( status, KErrNone );
   246         User::RequestComplete( status, KErrNone );
   216 #endif     
   247 #endif 
   217         
   248         iScanState = EProcessBroadcastScan;
   218         iScanState = EBroadcastScan;
   249         }
   219         }
   250         
   220         
   251     else if ( iScanState == EProcessBroadcastScan )
   221     else if ( iScanState == EBroadcastScan )
       
   222         {
   252         {
   223         // process broadcast scan results
   253         // process broadcast scan results
   224         DoScanForNetworksL();
   254         DoScanForNetworksL();
   225         
   255         
   226         // now it's time to initiate direct scan 
   256         // now it's time to initiate direct scan 
   352             // reset the timer if we are responsible for scheduling scans
   382             // reset the timer if we are responsible for scheduling scans
   353             iTimer.Cancel();
   383             iTimer.Cancel();
   354             iTimer.After( iStatus, 
   384             iTimer.After( iStatus, 
   355                           TTimeIntervalMicroSeconds32( iScanningInterval ) );
   385                           TTimeIntervalMicroSeconds32( iScanningInterval ) );
   356             Cancel();
   386             Cancel();
       
   387             iCacheLifetime = 0;
       
   388             iMaxDelay = 0;
   357             SetActive();
   389             SetActive();
   358             }
   390             }
   359         
   391         
   360         iScanState = EIdle;
   392         iScanState = EIdle;
   361         }
   393         }
   438             if ( matchArray.Count() )
   470             if ( matchArray.Count() )
   439                 {
   471                 {
   440                 LOG_WRITE( "Info found" );
   472                 LOG_WRITE( "Info found" );
   441                 TWsfWlanInfo* temp = matchArray[0];
   473                 TWsfWlanInfo* temp = matchArray[0];
   442                 temp->iConnectionState = EConnected;
   474                 temp->iConnectionState = EConnected;
       
   475                 temp->iIapId = connectedInfo->iIapId;
   443                 temp->iSsid.Copy( connectedSsidOrIap );
   476                 temp->iSsid.Copy( connectedSsidOrIap );
   444                 temp->iNetworkName.Zero();
   477                 temp->iNetworkName.Zero();
   445                 }
   478                 }
   446             else
   479             else
   447                 {
   480                 {
   528                                    wi->iSecurityMode == EWlanSecModeWpa ||
   561                                    wi->iSecurityMode == EWlanSecModeWpa ||
   529                                    wi->iSecurityMode == EWlanSecModeWpa2 )? 
   562                                    wi->iSecurityMode == EWlanSecModeWpa2 )? 
   530                                       &Keap: &KNullDesC );
   563                                       &Keap: &KNullDesC );
   531         HBufC16 *ssid = TWsfWlanInfo::GetSsidAsUnicodeLC( wi->iSsid );
   564         HBufC16 *ssid = TWsfWlanInfo::GetSsidAsUnicodeLC( wi->iSsid );
   532         
   565         
   533         LOG_WRITEF( "[%S] %S %S %S", ssid, sm, psk, 
   566         LOG_WRITEF( "[%S] IapId=%d %S %S %S", ssid, wi->iIapId, sm, psk, 
   534                     wi->iVisibility? &KNullDesC: &Khidden );
   567                     wi->iVisibility? &KNullDesC: &Khidden );
   535         CleanupStack::PopAndDestroy( ssid );
   568         CleanupStack::PopAndDestroy( ssid );
   536         }
   569         }
   537     
   570     
   538     }
   571     }
   563         {
   596         {
   564         // the scanning has failed, re-issue the scan timer
   597         // the scanning has failed, re-issue the scan timer
   565         iTimer.Cancel();
   598         iTimer.Cancel();
   566         iTimer.After( iStatus, 
   599         iTimer.After( iStatus, 
   567                       TTimeIntervalMicroSeconds32( iScanningInterval ) );
   600                       TTimeIntervalMicroSeconds32( iScanningInterval ) );
       
   601         iCacheLifetime = 0;
       
   602         iMaxDelay = 0;
   568         SetActive();    
   603         SetActive();    
   569         }
   604         }
   570         
   605         
   571     return KErrNone;    
   606     return KErrNone;    
   572     }
   607     }
   602         iScanState = EIdle;
   637         iScanState = EIdle;
   603 
   638 
   604         if ( !iShowAvailability )
   639         if ( !iShowAvailability )
   605             {
   640             {
   606             // in case show wlan availability is off, carry out a scan now
   641             // in case show wlan availability is off, carry out a scan now
       
   642             iCacheLifetime = 0;
       
   643             iMaxDelay = 0;
   607             SetActive();
   644             SetActive();
   608             TRequestStatus* status = &iStatus;
   645             TRequestStatus* status = &iStatus;
   609             User::RequestComplete( status, KErrNone );
   646             User::RequestComplete( status, KErrNone );
   610             }
   647             }
   611         }
   648         }
   651     if ( iScanState == EIdle && ( IsActive() || iShowAvailability ) )
   688     if ( iScanState == EIdle && ( IsActive() || iShowAvailability ) )
   652         {
   689         {
   653         // we have been waiting for the timer to complete
   690         // we have been waiting for the timer to complete
   654         // cancel it manually
   691         // cancel it manually
   655         Cancel();
   692         Cancel();
   656         
   693         iCacheLifetime = 0;
       
   694         iMaxDelay = 0;
   657         // then complete ourselves
   695         // then complete ourselves
   658         SetActive();
   696         SetActive();
   659         TRequestStatus* status = &iStatus;
   697         TRequestStatus* status = &iStatus;
   660         User::RequestComplete( status, KErrNone );
   698         User::RequestComplete( status, KErrNone );
   661         restarted = ETrue;
   699         restarted = ETrue;
   682         if ( !iShowAvailability )
   720         if ( !iShowAvailability )
   683             {
   721             {
   684             // still, life goes on
   722             // still, life goes on
   685             iTimer.After( iStatus, TTimeIntervalMicroSeconds32( 
   723             iTimer.After( iStatus, TTimeIntervalMicroSeconds32( 
   686                                                         iScanningInterval ) );
   724                                                         iScanningInterval ) );
       
   725             iCacheLifetime = 0;
       
   726             iMaxDelay = 0;
   687             SetActive();        
   727             SetActive();        
   688             }
   728             }
   689         }
   729         }
   690     }
   730     }
   691 
   731 
   708 void CWsfWlanScanner::BssidChanged( TWlanBssid& /*aNewBSsid*/ )
   748 void CWsfWlanScanner::BssidChanged( TWlanBssid& /*aNewBSsid*/ )
   709     {
   749     {
   710     LOG_ENTERFN( "CWsfWlanScanner::BssidChanged" );
   750     LOG_ENTERFN( "CWsfWlanScanner::BssidChanged" );
   711     if ( iScanState == EIdle && !IsActive() )
   751     if ( iScanState == EIdle && !IsActive() )
   712         {
   752         {
       
   753         iCacheLifetime = -1;
       
   754         iMaxDelay = 0;
   713         // complete ourselves
   755         // complete ourselves
   714         SetActive();
   756         SetActive();
   715         TRequestStatus* status = &iStatus;
   757         TRequestStatus* status = &iStatus;
   716         User::RequestComplete( status, KErrNone );
   758         User::RequestComplete( status, KErrNone );
   717         }
   759         }
   725 void CWsfWlanScanner::BssLost()
   767 void CWsfWlanScanner::BssLost()
   726     {
   768     {
   727     LOG_ENTERFN( "CWsfWlanScanner::BssLost" );
   769     LOG_ENTERFN( "CWsfWlanScanner::BssLost" );
   728     if ( iScanState == EIdle && !IsActive() )
   770     if ( iScanState == EIdle && !IsActive() )
   729         {
   771         {
       
   772         iCacheLifetime = -1;
       
   773         iMaxDelay = 0;
   730         // complete ourselves
   774         // complete ourselves
   731         SetActive();
   775         SetActive();
   732         TRequestStatus* status = &iStatus;
   776         TRequestStatus* status = &iStatus;
   733         User::RequestComplete( status, KErrNone );
   777         User::RequestComplete( status, KErrNone );
   734         }
   778         }
   742 void CWsfWlanScanner::BssRegained()
   786 void CWsfWlanScanner::BssRegained()
   743     {
   787     {
   744     LOG_ENTERFN( "CWsfWlanScanner::BssRegained" );
   788     LOG_ENTERFN( "CWsfWlanScanner::BssRegained" );
   745     if ( iScanState == EIdle && !IsActive() )
   789     if ( iScanState == EIdle && !IsActive() )
   746         {
   790         {
       
   791         iCacheLifetime = -1;
       
   792         iMaxDelay = 0;
   747         // complete ourselves
   793         // complete ourselves
   748         SetActive();
   794         SetActive();
   749         TRequestStatus* status = &iStatus;
   795         TRequestStatus* status = &iStatus;
   750         User::RequestComplete( status, KErrNone );
   796         User::RequestComplete( status, KErrNone );
   751         }
   797         }
   759 void CWsfWlanScanner::NewNetworksDetected()
   805 void CWsfWlanScanner::NewNetworksDetected()
   760     {
   806     {
   761     LOG_ENTERFN( "CWsfWlanScanner::NewNetworksDetected" );
   807     LOG_ENTERFN( "CWsfWlanScanner::NewNetworksDetected" );
   762     if ( iScanState == EIdle && !IsActive() )
   808     if ( iScanState == EIdle && !IsActive() )
   763         {
   809         {
       
   810         iCacheLifetime = -1;
       
   811         iMaxDelay = 0;
   764         // complete ourselves
   812         // complete ourselves
   765         SetActive();
   813         SetActive();
   766         TRequestStatus* status = &iStatus;
   814         TRequestStatus* status = &iStatus;
   767         User::RequestComplete( status, KErrNone );
   815         User::RequestComplete( status, KErrNone );
   768         }
   816         }
   776 void CWsfWlanScanner::OldNetworksLost()
   824 void CWsfWlanScanner::OldNetworksLost()
   777     {
   825     {
   778     LOG_ENTERFN( "CWsfWlanScanner::OldNetworksLost" );
   826     LOG_ENTERFN( "CWsfWlanScanner::OldNetworksLost" );
   779     if ( iScanState == EIdle && !IsActive() )
   827     if ( iScanState == EIdle && !IsActive() )
   780         {
   828         {
       
   829         iCacheLifetime = -1;
       
   830         iMaxDelay = 0;
   781         // complete ourselves
   831         // complete ourselves
   782         SetActive();
   832         SetActive();
   783         TRequestStatus* status = &iStatus;
   833         TRequestStatus* status = &iStatus;
   784         User::RequestComplete( status, KErrNone );
   834         User::RequestComplete( status, KErrNone );
   785         }
   835         }
   793 void CWsfWlanScanner::TransmitPowerChanged( TUint /*aPower*/ )
   843 void CWsfWlanScanner::TransmitPowerChanged( TUint /*aPower*/ )
   794     {
   844     {
   795     LOG_ENTERFN( "CWsfWlanScanner::TransmitPowerChanged" );
   845     LOG_ENTERFN( "CWsfWlanScanner::TransmitPowerChanged" );
   796     if ( iScanState == EIdle && !IsActive() )
   846     if ( iScanState == EIdle && !IsActive() )
   797         {
   847         {
       
   848         iCacheLifetime = -1;
       
   849         iMaxDelay = 0;
   798         // complete ourselves
   850         // complete ourselves
   799         SetActive();
   851         SetActive();
   800         TRequestStatus* status = &iStatus;
   852         TRequestStatus* status = &iStatus;
   801         User::RequestComplete( status, KErrNone );
   853         User::RequestComplete( status, KErrNone );
   802         }
   854         }
   810 void CWsfWlanScanner::RssChanged( TWlanRssClass /*aRssClass*/, TUint /*aRss*/ )
   862 void CWsfWlanScanner::RssChanged( TWlanRssClass /*aRssClass*/, TUint /*aRss*/ )
   811     {
   863     {
   812     LOG_ENTERFN( "CWsfWlanScanner::RssChanged" );
   864     LOG_ENTERFN( "CWsfWlanScanner::RssChanged" );
   813     if ( iScanState == EIdle && !IsActive() )
   865     if ( iScanState == EIdle && !IsActive() )
   814         {
   866         {
       
   867         iCacheLifetime = -1;
       
   868         iMaxDelay = 0;
   815         // complete ourselves
   869         // complete ourselves
   816         SetActive();
   870         SetActive();
   817         TRequestStatus* status = &iStatus;
   871         TRequestStatus* status = &iStatus;
   818         User::RequestComplete( status, KErrNone );
   872         User::RequestComplete( status, KErrNone );
   819         }
   873         }
   955     LOG_ENTERFN( "CWsfWlanScanner::DoScanForNetworksL" );
  1009     LOG_ENTERFN( "CWsfWlanScanner::DoScanForNetworksL" );
   956         
  1010         
   957     // start by making sure the scan array is empty
  1011     // start by making sure the scan array is empty
   958     iScanArray->Reset();    
  1012     iScanArray->Reset();    
   959 
  1013 
   960     LOG_WRITEF( "GetScanResults returned %d", iStatus.Int() );
  1014     LOG_WRITEF( "GetScanResults returned iStatus=%d", iStatus.Int() );
   961     
  1015     
   962     if ( iStatus.Int() )
  1016     if ( iStatus.Int() )
   963         {
  1017         {
   964         // if the status is not KErrNone, we cannot be sure that iScanInfo
  1018         // if the status is not KErrNone, we cannot be sure that iScanInfo
   965         // doesn't cause a crash, so it's better to leave
  1019         // doesn't cause a crash, so it's better to leave
       
  1020         LOG_WRITE( "Error in getting scan result - leave" );
   966         User::Leave( iStatus.Int() );
  1021         User::Leave( iStatus.Int() );
   967         }
  1022         }
   968    
  1023    
   969     TInt nElem = 0;
  1024     TInt nElem = 0;
   970     TBool isHidden( EFalse );
  1025     TBool isHidden( EFalse );
   976     for( TInt i(0); i < avIapCount; i++ )
  1031     for( TInt i(0); i < avIapCount; i++ )
   977         {
  1032         {
   978         TBool addToArray( ETrue ); 
  1033         TBool addToArray( ETrue ); 
   979         TWsfWlanInfo* availableInfo = new ( ELeave ) TWsfWlanInfo();       
  1034         TWsfWlanInfo* availableInfo = new ( ELeave ) TWsfWlanInfo();       
   980         CleanupStack::PushL( availableInfo );
  1035         CleanupStack::PushL( availableInfo );
   981         availableInfo->iIapId = iAvailableIaps[i];
  1036         availableInfo->iIapId = iAvailableIaps[i].iIapId;
   982         TRAPD( error, GetWlanInfoFromIapL( *availableInfo ) );
  1037         TRAPD( error, GetWlanInfoFromIapL( *availableInfo ) );
   983 
  1038 
   984         if ( error == KErrNotFound )
  1039         if ( error == KErrNotFound )
   985             {
  1040             {
   986             LOG_WRITEF( "Iap id = %d does not exist", availableInfo->iIapId );
  1041             LOG_WRITEF( "Iap id = %d does not exist", availableInfo->iIapId );
   995         if( addToArray )
  1050         if( addToArray )
   996             { 
  1051             { 
   997             LOG_WRITE( "Add to array" );
  1052             LOG_WRITE( "Add to array" );
   998             availableInfo->iCoverage = 0;
  1053             availableInfo->iCoverage = 0;
   999             availableInfo->iVisibility = 1;
  1054             availableInfo->iVisibility = 1;
  1000             availableInfo->iStrengthLevel = EWlanSignalUnavailable;
  1055             availableInfo->iStrengthLevel = iAvailableIaps[i].iRssi;
  1001             availableInfo->iTransferRate = 0;
  1056             availableInfo->iTransferRate = 0;
  1002             availableInfo->iConnectionState = ENotConnected;
  1057             availableInfo->iConnectionState = ENotConnected;
  1003             iScanArray->AppendL(availableInfo);
  1058             iScanArray->AppendL(availableInfo);
  1004             nElem++;
  1059             nElem++;
  1005 
  1060 
  1006             if ( availableInfo->iIapId )
  1061             if ( availableInfo->iIapId )
  1007                 {
  1062                 {
  1008                 LOG_WRITEF( "Append available iap [%d] for direct scan", availableInfo->iIapId );
  1063                 LOG_WRITEF( "Append available iap[%d] rssi[%d] for direct scan", 
       
  1064                          availableInfo->iIapId, availableInfo->iStrengthLevel );
  1009                 iDirectScanIapIDs.Append( availableInfo->iIapId );
  1065                 iDirectScanIapIDs.Append( availableInfo->iIapId );
  1010                 iDirectScanSsids.Append( availableInfo->iSsid );
  1066                 iDirectScanSsids.Append( availableInfo->iSsid );
  1011                 }
  1067                 }
  1012 
  1068 
  1013             CleanupStack::Pop( availableInfo );
  1069             CleanupStack::Pop( availableInfo );
  1016             {
  1072             {
  1017             LOG_WRITE( "Info not added" );
  1073             LOG_WRITE( "Info not added" );
  1018             CleanupStack::PopAndDestroy( availableInfo );
  1074             CleanupStack::PopAndDestroy( availableInfo );
  1019             }
  1075             }
  1020         }
  1076         }
       
  1077     
       
  1078 #ifdef _DEBUG
       
  1079         LOG_WRITE( "Dump scan results - available IAPs" );
       
  1080         DumpScanResultsL( iScanArray );
       
  1081 #endif
  1021       
  1082       
  1022     // Process the scanned results
  1083     // Process the scanned results
  1023     for( iScanInfo->First(); !iScanInfo->IsDone(); iScanInfo->Next() )
  1084     for( iScanInfo->First(); !iScanInfo->IsDone(); iScanInfo->Next() )
  1024         {
  1085         {
  1025         TWsfWlanInfo* wlanInfo = iScanArray->At( nElem );
  1086         TWsfWlanInfo* wlanInfo = iScanArray->At( nElem );
  1351 // ---------------------------------------------------------------------------
  1412 // ---------------------------------------------------------------------------
  1352 //
  1413 //
  1353 void CWsfWlanScanner::GetWlanInfoFromIapL( TWsfWlanInfo& aWlanInfo )
  1414 void CWsfWlanScanner::GetWlanInfoFromIapL( TWsfWlanInfo& aWlanInfo )
  1354     {
  1415     {
  1355     LOG_ENTERFN( "CWsfWlanScanner::GetWlanInfoFromIapL" );
  1416     LOG_ENTERFN( "CWsfWlanScanner::GetWlanInfoFromIapL" );
       
  1417     LOG_WRITEF( "Iap Id = %d", aWlanInfo.iIapId );
  1356 
  1418 
  1357     CCommsDatabase* commsDb = CCommsDatabase::NewL();    
  1419     CCommsDatabase* commsDb = CCommsDatabase::NewL();    
  1358     CleanupStack::PushL( commsDb );
  1420     CleanupStack::PushL( commsDb );
  1359     
  1421     
  1360     CCommsDbTableView* commsDbIapTableView = commsDb->OpenViewMatchingUintLC(
  1422     CCommsDbTableView* commsDbIapTableView = commsDb->OpenViewMatchingUintLC(
  1389     TUint32 secMode(0);
  1451     TUint32 secMode(0);
  1390     wlanTableView->ReadUintL(TPtrC( WLAN_SECURITY_MODE), secMode);
  1452     wlanTableView->ReadUintL(TPtrC( WLAN_SECURITY_MODE), secMode);
  1391     // Map Wpa2 to Wpa
  1453     // Map Wpa2 to Wpa
  1392     secMode = ( secMode == EWlanSecModeWpa2 )? EWlanSecModeWpa : secMode;
  1454     secMode = ( secMode == EWlanSecModeWpa2 )? EWlanSecModeWpa : secMode;
  1393     aWlanInfo.iSecurityMode = static_cast<TWlanSecMode>(secMode);
  1455     aWlanInfo.iSecurityMode = static_cast<TWlanSecMode>(secMode);
       
  1456     
       
  1457     TUint32 usePsk(0);
       
  1458     TRAP_IGNORE( wlanTableView->ReadUintL(TPtrC( WLAN_ENABLE_WPA_PSK ), 
       
  1459                  usePsk ) );
       
  1460     
       
  1461     aWlanInfo.SetUsesPreSharedKey( usePsk );
  1394 
  1462 
  1395     // net mode
  1463     // net mode
  1396     TUint32 netMode(0);
  1464     TUint32 netMode(0);
  1397     wlanTableView->ReadUintL(TPtrC( WLAN_CONNECTION_MODE), netMode);
  1465     wlanTableView->ReadUintL(TPtrC( WLAN_CONNECTION_MODE), netMode);
  1398     aWlanInfo.iNetMode = static_cast<TWlanNetMode>(netMode);
  1466     aWlanInfo.iNetMode = static_cast<TWlanNetMode>(netMode);
  1860                     {
  1928                     {
  1861                     Cancel();
  1929                     Cancel();
  1862                     }
  1930                     }
  1863                 iTimer.After( iStatus, TTimeIntervalMicroSeconds32( 
  1931                 iTimer.After( iStatus, TTimeIntervalMicroSeconds32( 
  1864                         iScanningInterval ) );
  1932                         iScanningInterval ) );
       
  1933                 iCacheLifetime = 0;
       
  1934                 iMaxDelay = 0;
  1865                 SetActive();
  1935                 SetActive();
  1866                 } 
  1936                 } 
  1867             }
  1937             }
  1868         }
  1938         }
  1869     else if ( !iShowAvailability )
  1939     else if ( !iShowAvailability )
  1877             // doCancel resets timer
  1947             // doCancel resets timer
  1878             LOG_WRITE( "reissuing timer request" );
  1948             LOG_WRITE( "reissuing timer request" );
  1879             Cancel();
  1949             Cancel();
  1880             iTimer.After( iStatus, TTimeIntervalMicroSeconds32( 
  1950             iTimer.After( iStatus, TTimeIntervalMicroSeconds32( 
  1881                     iScanningInterval ) );
  1951                     iScanningInterval ) );
       
  1952             iCacheLifetime = 0;
       
  1953             iMaxDelay = 0;
  1882             SetActive();
  1954             SetActive();
  1883             }        
  1955             }        
  1884         }
  1956         }
  1885     }
  1957     }
  1886 
  1958