hotspotfw/hsclient/src/hssiaphandler.cpp
changeset 38 2dc6da6fb431
parent 25 001d4d78e350
child 36 682dd021f9be
equal deleted inserted replaced
29:dbe86d96ce5b 38:2dc6da6fb431
    27 #include <cmconnectionmethodext.h>
    27 #include <cmconnectionmethodext.h>
    28 #include <cmconnectionmethoddef.h>
    28 #include <cmconnectionmethoddef.h>
    29 #include <cmmanagerext.h>
    29 #include <cmmanagerext.h>
    30 #include <cmmanagerdef.h>
    30 #include <cmmanagerdef.h>
    31 #include <cmdestinationext.h>
    31 #include <cmdestinationext.h>
       
    32 
       
    33 // CONSTANTS
       
    34 const TInt  KRetryCount   = 20;
       
    35 const TInt  KRetryTimeout = 100000;
    32 
    36 
    33 using namespace CMManager;
    37 using namespace CMManager;
    34 
    38 
    35 // ============================ MEMBER FUNCTIONS ===============================
    39 // ============================ MEMBER FUNCTIONS ===============================
    36 
    40 
   197             {
   201             {
   198             DEBUG("CHssIapHandler::ChangeSettingsL -> SecurityMode > EHssWep -> EAP");
   202             DEBUG("CHssIapHandler::ChangeSettingsL -> SecurityMode > EHssWep -> EAP");
   199             *((CMDBField<TUint32>*)iWLANRecord->GetFieldByIdL(KCDTIdWlanEnableWpaPsk)) = aSettings.iEnableWpaPsk;
   203             *((CMDBField<TUint32>*)iWLANRecord->GetFieldByIdL(KCDTIdWlanEnableWpaPsk)) = aSettings.iEnableWpaPsk;
   200             }
   204             }
   201         }
   205         }
   202     // now update the access point
   206     // Update access point, be prepared that Commsdat might be locked
   203     iWLANRecord->ModifyL( *dbSession );
   207     TInt errCode( KErrLocked );
   204     
   208     TInt retryCount( 0 );
       
   209     
       
   210     while( errCode == KErrLocked && retryCount < KRetryCount )
       
   211         {
       
   212         TRAP( errCode, iWLANRecord->ModifyL( *dbSession ) );
       
   213 
       
   214         if ( errCode == KErrLocked )
       
   215             {	
       
   216             User::After( KRetryTimeout );
       
   217             }	
       
   218         retryCount++;	        
       
   219         }
       
   220     
       
   221     if ( errCode )
       
   222         {
       
   223         // override previous ret value only when error happened        	    	
       
   224         ret = errCode;
       
   225         }
       
   226 
   205     CleanupStack::PopAndDestroy( dbSession );
   227     CleanupStack::PopAndDestroy( dbSession );
   206     DEBUG("CHssIapHandler::ChangeSettingsL DONE");
   228     DEBUG("CHssIapHandler::ChangeSettingsL DONE");
   207 	return ret;
   229 	return ret;
   208     }
   230     }
   209  
   231