wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp
branchRCL_3
changeset 44 a9524956f6b5
parent 35 aaabc7526ded
--- a/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp	Wed Jun 09 10:53:40 2010 +0300
+++ b/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp	Mon Jun 21 16:55:05 2010 +0300
@@ -350,6 +350,7 @@
             if ( temp )
                 {
                 temp->iConnectionState = EConnected;
+                temp->iIapId = info.iIapId;
                 iInfoArray->SortArrayL();
                 UpdateViewL( iInfoArray );
                 }
@@ -476,26 +477,31 @@
 
     TInt result( KErrNone );
     
+    TWsfIapPersistence persistence = EIapPersistent;
+    
     if ( !info.Known() && !info.Connected() )
         {
         // if not known yet, create an IAP
         if ( iModel->CreateAccessPointL( info, EFalse ) )
             {
+            persistence = EIapExpireOnDisconnect;
             // update iapID to list
             UpdateIapIdToInfoArrayL( info );
-            
-            // on success, test it and save it as well
-            result = iModel->TestAccessPointL( info, ETrue, EFalse );
             }
         else
             {
             result = KErrGeneral;
             }
         }
-    else if ( info.iIapId && !info.Connected() )
+    
+    if ( info.iIapId && !info.Connected() )
         {
         // hopefully we have a valid IAP id inside
-        result = iModel->ConnectL( info.iIapId );
+        result = iModel->ConnectL( info.iIapId, EFalse, persistence );
+        }
+    else if ( !info.Connected() )
+        {
+        result = KErrGeneral;
         }
     
     // pop cleanup item ReleaseSuppressingKeyEvents
@@ -562,28 +568,24 @@
         CleanupStack::PopAndDestroy();
         return;
         }
+    
+    TWsfIapPersistence persistence = EIapPersistent;
         
     if ( !info.Known() )
         {
         // a new access point needs to be created
         if ( iModel->CreateAccessPointL( info, EFalse ) )
             {
+            persistence = EIapExpireOnDisconnect;
             // update iapID to list
             UpdateIapIdToInfoArrayL( info );
-
-            // on success, test it and save it as well
-            // (testing actually creates the connection)
-            if ( iModel->TestAccessPointL( info, ETrue, ETrue ) == KErrCancel )
-                {
-                // connection creation was cancelled, refresh the view
-                iModel->RefreshScanL();
-                }
             }
         }
-    else if ( info.iIapId )
+    
+    if ( info.iIapId )
         {
         // hopefully we have a valid IAP id inside
-        iModel->ConnectL( info.iIapId );
+        iModel->ConnectL( info.iIapId, ETrue, persistence );
         }
 
     // pop cleanup item ReleaseSuppressingKeyEvents