Revision: 201034 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 13:26:06 +0300
branchRCL_3
changeset 59 34911529ee3c
parent 55 f28ada11abbf
child 65 32fadeea4023
Revision: 201034 Kit: 201036
wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp
wlanutilities/wlansniffer/model/inc/wsfmodel.h
wlanutilities/wlansniffer/model/inc/wsfmodel.inl
--- a/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp	Wed Sep 01 12:20:32 2010 +0100
+++ b/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp	Wed Sep 15 13:26:06 2010 +0300
@@ -61,6 +61,8 @@
     iAppUi = &aAppUi;
     iModel = &aModel;
     iWlanInfoBranding = &aWlanInfoBranding;
+    // Initialize our reference info array
+    iInfoArray = iModel->WlanList();
     iModel->SetConnecting( EFalse );
     }
 
@@ -601,37 +603,41 @@
 void TWsfMainController::UpdateIapIdToInfoArrayL( TWsfWlanInfo& aInfo )
     {
     LOG_ENTERFN( "TWsfMainController::UpdateIapIdToInfoArrayL" ); 
-    TWsfWlanInfo* temp = iInfoArray->Match( aInfo.iSsid, iInfoArray->Count() );
-    if ( temp && !aInfo.Hidden() )
+    
+    if ( iInfoArray )
         {
-        LOG_WRITE( "Info found" );
-        
-        // Check that there aren't any IAPs with same id
-        TWsfWlanInfo* wlanInfoWithSameIapId = iInfoArray->Match( aInfo.iIapId, 
-                                                iInfoArray->Count() );
-        if ( wlanInfoWithSameIapId )
+        TWsfWlanInfo* temp = iInfoArray->Match( aInfo.iSsid, iInfoArray->Count() );
+        if ( temp && !aInfo.Hidden() )
             {
-            // info with same id found set its iap id to zero
-            LOG_WRITE( "info with same id found" );
-            wlanInfoWithSameIapId->iIapId = 0;
+            LOG_WRITE( "Info found" );
+            
+            // Check that there aren't any IAPs with same id
+            TWsfWlanInfo* wlanInfoWithSameIapId = iInfoArray->Match( aInfo.iIapId, 
+                                                    iInfoArray->Count() );
+            if ( wlanInfoWithSameIapId )
+                {
+                // info with same id found set its iap id to zero
+                LOG_WRITE( "info with same id found" );
+                wlanInfoWithSameIapId->iIapId = 0;
+                }
+            
+            temp->iIapId = aInfo.iIapId;
+            
+            if ( aInfo.iNetworkName.Length() )
+                {
+                // Replace ssid as well since scanner does this same thing
+                temp->iSsid.Copy( aInfo.iNetworkName );
+                }
             }
-        
-        temp->iIapId = aInfo.iIapId;
-        
-        if ( aInfo.iNetworkName.Length() )
+        else
             {
-            // Replace ssid as well since scanner does this same thing
-            temp->iSsid.Copy( aInfo.iNetworkName );
+            LOG_WRITE( "Info not found" );
+            TWsfWlanInfo* createdInfo = new (ELeave) TWsfWlanInfo( aInfo );
+            createdInfo->iVisibility = ETrue;
+            createdInfo->iStrengthLevel = EWlanSignalStrengthMax;
+            iInfoArray->AppendL( createdInfo );
             }
         }
-    else
-        {
-        LOG_WRITE( "Info not found" );
-        TWsfWlanInfo* createdInfo = new (ELeave) TWsfWlanInfo( aInfo );
-        createdInfo->iVisibility = ETrue;
-        createdInfo->iStrengthLevel = EWlanSignalStrengthMax;
-        iInfoArray->AppendL( createdInfo );
-        }
     }
     
 // ---------------------------------------------------------------------------
--- a/wlanutilities/wlansniffer/model/inc/wsfmodel.h	Wed Sep 01 12:20:32 2010 +0100
+++ b/wlanutilities/wlansniffer/model/inc/wsfmodel.h	Wed Sep 15 13:26:06 2010 +0300
@@ -101,13 +101,20 @@
         IMPORT_C void SetEngineObserver( MWsfModelObserver* aObserver );
 
         /**
+        * Return pointer to the list of WLANs. Ownership not passed.
+        * @since S60 5.2
+        * @return Array of WLANs
+        */
+        inline CWsfWlanInfoArray* WlanList();
+        
+        /**
         * Return the latest list of found WLANs. Ownership not passed.
         * @since S60 5.0
         * @return Array of WLANs
         */
         IMPORT_C CWsfWlanInfoArray* GetWlanListL();
         
-		/**
+        /**
         * Asyncronous request to the server to return wlan list size
         * @since S60 5.2
         * @param aPckg request result
@@ -117,11 +124,11 @@
         IMPORT_C void GetWlanListSize( TPckgBuf<TUint>& aPckg, 
                                        TRequestStatus& aStatus );
 
-		/**
+        /**
         * Asyncronous request to the server to return wlan list
         * @since S60 5.2
         * @param aPckg request result
-		* @param aPtr wlan list
+        * @param aPtr wlan list
         * @param aStatus The request status object used to contain 
         *        the completion status of the request.
         */
--- a/wlanutilities/wlansniffer/model/inc/wsfmodel.inl	Wed Sep 01 12:20:32 2010 +0100
+++ b/wlanutilities/wlansniffer/model/inc/wsfmodel.inl	Wed Sep 15 13:26:06 2010 +0300
@@ -39,3 +39,13 @@
 	}
 
 
+// -----------------------------------------------------------------------------
+// CWsfModel::WlanList
+// -----------------------------------------------------------------------------
+//
+inline CWsfWlanInfoArray* CWsfModel::WlanList()
+    { 
+    return iArray;
+    }
+
+