hotspotfw/hsserver/src/hotspotserver.cpp
changeset 61 e1d68407ed06
parent 39 7b3e49e4608a
equal deleted inserted replaced
60:822a45792fdd 61:e1d68407ed06
   105 // -----------------------------------------------------------------------------
   105 // -----------------------------------------------------------------------------
   106 //
   106 //
   107 CHotSpotServer::CHotSpotServer()
   107 CHotSpotServer::CHotSpotServer()
   108     :CPolicyServer( EPriorityStandard, THotSpotServerPlatSecPolicy, ESharableSessions )
   108     :CPolicyServer( EPriorityStandard, THotSpotServerPlatSecPolicy, ESharableSessions )
   109     {
   109     {
       
   110     iAssociationValue=false;
       
   111     iLogoutSent=false ;
       
   112     iLoginValue=false;
       
   113     iIapCheckValue=false;
       
   114     iMgtClient=NULL;
       
   115     iClientIapsChecked =0;
   110     }
   116     }
   111 
   117 
   112 // -----------------------------------------------------------------------------
   118 // -----------------------------------------------------------------------------
   113 // NewLC
   119 // NewLC
   114 // -----------------------------------------------------------------------------
   120 // -----------------------------------------------------------------------------
   232                 TUint iapId = cm.GetIntAttributeL( ECmIapId  );
   238                 TUint iapId = cm.GetIntAttributeL( ECmIapId  );
   233                 HBufC* client = cm.GetStringAttributeL( 
   239                 HBufC* client = cm.GetStringAttributeL( 
   234                                             EWlanServiceExtensionTableName );
   240                                             EWlanServiceExtensionTableName );
   235                 clientUid.Copy( client->Des() );
   241                 clientUid.Copy( client->Des() );
   236                 delete client;
   242                 delete client;
   237                 SetClientIap( iapId, clientUid );
   243                 SetClientIapL( iapId, clientUid );
   238                 DEBUG1("CHotSpotServer::FindClientIapsL() iapId: %d", iapId );
   244                 DEBUG1("CHotSpotServer::FindClientIapsL() iapId: %d", iapId );
   239                 }
   245                 }
   240             }
   246             }
   241         CleanupStack::PopAndDestroy( daemonName );
   247         CleanupStack::PopAndDestroy( daemonName );
   242         CleanupStack::PopAndDestroy( &cm );
   248         CleanupStack::PopAndDestroy( &cm );
   530 
   536 
   531     return retval;
   537     return retval;
   532     }
   538     }
   533 
   539 
   534 // -----------------------------------------------------------------------------
   540 // -----------------------------------------------------------------------------
   535 // SetTimerValues
   541 // SetTimerValuesL
   536 // -----------------------------------------------------------------------------
   542 // -----------------------------------------------------------------------------
   537 //
   543 //
   538 void CHotSpotServer::SetTimerValues(
   544 void CHotSpotServer::SetTimerValuesL(
   539         TDes& aClientUid,
   545         TDes& aClientUid,
   540         TUint aLoginTimerValue,   // in seconds
   546         TUint aLoginTimerValue,   // in seconds
   541         TUint aLogoutTimerValue ) // in seconds
   547         TUint aLogoutTimerValue ) // in seconds
   542     {    
   548     {    
   543     DEBUG("HotspotServer::SetTimerValues()");
   549     DEBUG("HotspotServer::SetTimerValuesL()");
   544     TInt ret = FindClientUid( aClientUid );
   550     TInt ret = FindClientUid( aClientUid );
   545     TUint loginTimeMicroSecs = KHssDefaultLoginTimeMicroSecs ;
   551     TUint loginTimeMicroSecs = KHssDefaultLoginTimeMicroSecs ;
   546     TUint logoutTimeMicroSecs = KHssDefaultLogoutTimeMicroSecs ;
   552     TUint logoutTimeMicroSecs = KHssDefaultLogoutTimeMicroSecs ;
   547     
   553     
   548     // Check that values are in bounds and modify them into micro seconds.
   554     // Check that values are in bounds and modify them into micro seconds.
   558         logoutTimeMicroSecs = KMillion * aLogoutTimerValue;
   564         logoutTimeMicroSecs = KMillion * aLogoutTimerValue;
   559         }
   565         }
   560 
   566 
   561     if (ret != KErrNotFound)
   567     if (ret != KErrNotFound)
   562         {
   568         {
   563         DEBUG("CHotSpotServer::SetTimerValues(): Existing client modified.");
   569         DEBUG("CHotSpotServer::SetTimerValuesL(): Existing client modified.");
   564         // ret is the matching element's index.
   570         // ret is the matching element's index.
   565         iLoginLogoutTimerArray[ret].iLoginTimeMicroSecs = loginTimeMicroSecs;
   571         iLoginLogoutTimerArray[ret].iLoginTimeMicroSecs = loginTimeMicroSecs;
   566         iLoginLogoutTimerArray[ret].iLogoutTimeMicroSecs = logoutTimeMicroSecs;
   572         iLoginLogoutTimerArray[ret].iLogoutTimeMicroSecs = logoutTimeMicroSecs;
   567         }
   573         }
   568     else
   574     else
   569         {
   575         {
   570         DEBUG("CHotSpotServer::SetTimerValues(): New Client added.");
   576         DEBUG("CHotSpotServer::SetTimerValuesL(): New Client added.");
   571         // Create a new element and append it to the array.
   577         // Create a new element and append it to the array.
   572         const SLoginLogoutTimers addedElement = {
   578         const SLoginLogoutTimers addedElement = {
   573                 aClientUid,
   579                 aClientUid,
   574                 loginTimeMicroSecs,
   580                 loginTimeMicroSecs,
   575                 logoutTimeMicroSecs };
   581                 logoutTimeMicroSecs };
   576         iLoginLogoutTimerArray.Append( addedElement );
   582         iLoginLogoutTimerArray.AppendL( addedElement );
   577         }
   583         }
   578     }
   584     }
   579 
   585 
   580 // -----------------------------------------------------------------------------
   586 // -----------------------------------------------------------------------------
   581 // FindClientUid
   587 // FindClientUid
   627       
   633       
   628     return ret;
   634     return ret;
   629     }
   635     }
   630 
   636 
   631 // -----------------------------------------------------------------------------
   637 // -----------------------------------------------------------------------------
   632 // SetClientIap
   638 // SetClientIapL
   633 // -----------------------------------------------------------------------------
   639 // -----------------------------------------------------------------------------
   634 //
   640 //
   635 void CHotSpotServer::SetClientIap( TUint aIapId, TDes& aUid )
   641 void CHotSpotServer::SetClientIapL( TUint aIapId, TDes& aUid )
   636     {
   642     {
   637     DEBUG("CHotspotServer::SetClientIap()");
   643     DEBUG("CHotspotServer::SetClientIap()");
   638     SClientIaps clientElement = { aIapId, aUid };
   644     SClientIaps clientElement = { aIapId, aUid };
   639     iClientIaps.Append( clientElement );
   645     iClientIaps.AppendL( clientElement );
   640     }
   646     }
   641 
   647 
   642 // -----------------------------------------------------------------------------
   648 // -----------------------------------------------------------------------------
   643 // RemoveClientIap
   649 // RemoveClientIap
   644 // -----------------------------------------------------------------------------
   650 // -----------------------------------------------------------------------------