wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp
branchRCL_3
changeset 8 c2bc3f8c7777
parent 2 6e4b6261703d
child 10 dff6ebfd236f
equal deleted inserted replaced
4:107412708b22 8:c2bc3f8c7777
    96     delete iWlanSettingsAccessor;
    96     delete iWlanSettingsAccessor;
    97     delete iScanInfo;
    97     delete iScanInfo;
    98     delete iScanArray;
    98     delete iScanArray;
    99     iDirectScanSsids.Close();
    99     iDirectScanSsids.Close();
   100     iDirectScanIapIDs.Close();
   100     iDirectScanIapIDs.Close();
       
   101     iAvailableIaps.Close();
   101     iDbSession = NULL; // not owning
   102     iDbSession = NULL; // not owning
   102     iConnectionDetailsProvider = NULL;
   103     iConnectionDetailsProvider = NULL;
   103     }
   104     }
   104 
   105 
   105 
   106 
   172     {
   173     {
   173     LOG_ENTERFN( "CWsfWlanScanner::RunL" );
   174     LOG_ENTERFN( "CWsfWlanScanner::RunL" );
   174     
   175     
   175     /*
   176     /*
   176      * Scan logic
   177      * Scan logic
   177      * 1. Do broadcast scan - state = EIdle
   178      * 1. Get available IAPs - state = EIdle
   178      * 2. Get available IAPs - state = EBroadcastScan
   179      * 2. Do broadcast scan - state = EIdle
   179      * 3. Process broadcast scan results state = EBroadcastScan
   180      * 3. Process broadcast scan results - state = EBroadcastScan
   180      * 4. Do direct scans for remaining known networks
   181      * 4. Do direct scans for remaining known networks
   181      *    from step 2. Get available IAPs - state = EDirectScan
   182      *    from step 2. Get available IAPs - state = EDirectScan
   182      * 5. Add connected network - state = EFinished
   183      * 5. Add connected network - state = EFinished
   183      * 6. Set names and priorities for known networks - state = EFinished
   184      * 6. Set names and priorities for known networks - state = EFinished
   184      */
   185      */
   194         if ( iObserver )
   195         if ( iObserver )
   195             {
   196             {
   196             iObserver->WlanScanStarted();
   197             iObserver->WlanScanStarted();
   197             }
   198             }
   198 
   199 
   199         // do broadcast scan
   200         
   200 #ifndef __WINS__
   201 #ifndef __WINS__
       
   202         // get available iaps
       
   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)
       
   205         iAvailableIaps.Reset();
       
   206         iWlanMgmtClient->GetAvailableIaps( iAvailableIaps );
       
   207         
       
   208 		// do broadcast scan
   201         iWlanMgmtClient->GetScanResults( iStatus, *iScanInfo );
   209         iWlanMgmtClient->GetScanResults( iStatus, *iScanInfo );
   202         SetActive();
   210         SetActive();
   203 #else
   211 #else
   204         // for testing
   212         // for testing
   205         SetActive();
   213         SetActive();
   942         }
   950         }
   943    
   951    
   944     TInt nElem = 0;
   952     TInt nElem = 0;
   945     TBool isHidden( EFalse );
   953     TBool isHidden( EFalse );
   946 
   954 
   947     // get available iaps
   955     TInt avIapCount = iAvailableIaps.Count();
   948     // (this only shows iaps with security mode matching to scan results
       
   949     // and  also finds hidden wlans for which an iap has been configured)
       
   950     RArray<TUint> availableIaps;
       
   951     iWlanMgmtClient->GetAvailableIaps(availableIaps);
       
   952     TInt avIapCount = availableIaps.Count();
       
   953 
   956 
   954     LOG_WRITEF( "Available iap count %d", avIapCount ); 
   957     LOG_WRITEF( "Available iap count %d", avIapCount ); 
   955 
   958 
   956     for( TInt i(0); i < avIapCount; i++ )
   959     for( TInt i(0); i < avIapCount; i++ )
   957         {
   960         {
   958         TBool addToArray( ETrue ); 
   961         TBool addToArray( ETrue ); 
   959         TWsfWlanInfo* availableInfo = new ( ELeave ) TWsfWlanInfo();       
   962         TWsfWlanInfo* availableInfo = new ( ELeave ) TWsfWlanInfo();       
   960         CleanupStack::PushL( availableInfo );
   963         CleanupStack::PushL( availableInfo );
   961         availableInfo->iIapId = availableIaps[i];
   964         availableInfo->iIapId = iAvailableIaps[i];
   962         TRAPD( error, GetWlanInfoFromIapL( *availableInfo ) );
   965         TRAPD( error, GetWlanInfoFromIapL( *availableInfo ) );
   963 
   966 
   964         if ( error == KErrNotFound )
   967         if ( error == KErrNotFound )
   965             {
   968             {
   966             LOG_WRITEF( "Iap id = %d does not exist", availableInfo->iIapId );
   969             LOG_WRITEF( "Iap id = %d does not exist", availableInfo->iIapId );