hotspotfw/hsserver/src/hotspotserver.cpp
changeset 39 7b3e49e4608a
parent 19 10810c91db26
child 61 e1d68407ed06
equal deleted inserted replaced
36:682dd021f9be 39:7b3e49e4608a
    23 #include <wlanmgmtclient.h>
    23 #include <wlanmgmtclient.h>
    24 #include <wlanmgmtinterface.h>
    24 #include <wlanmgmtinterface.h>
    25 #include <e32std.h>
    25 #include <e32std.h>
    26 #include <commsdattypesv1_1.h>
    26 #include <commsdattypesv1_1.h>
    27 
    27 
    28 #include <cmconnectionmethodext.h>
    28 #include <cmconnectionmethod.h>
    29 #include <cmconnectionmethoddef.h>
    29 #include <cmconnectionmethoddef.h>
    30 #include <cmpluginwlandef.h>
    30 #include <cmpluginwlandef.h>
    31 #include <cmmanagerext.h>
    31 #include <cmmanager.h>
    32 #include <cmmanagerdef.h>
    32 #include <cmmanagerdef.h>
    33 #include <cmdestinationext.h>
    33 #include <cmdestination.h>
    34 
    34 
    35 #include "hotspotserver.h"
    35 #include "hotspotserver.h"
    36 #include "am_debug.h"
    36 #include "am_debug.h"
    37 #include "hotspotsession.h"
    37 #include "hotspotsession.h"
    38 #include "hssclientplugin.h"
    38 #include "hssclientplugin.h"
   156     iIapCheckValue = EFalse;
   156     iIapCheckValue = EFalse;
   157     iLogoutSent = EFalse;
   157     iLogoutSent = EFalse;
   158     iLoginValue = ETrue;
   158     iLoginValue = ETrue;
   159     iAssociationValue = EFalse;
   159     iAssociationValue = EFalse;
   160     iClientIapsChecked = KErrNone;
   160     iClientIapsChecked = KErrNone;
   161     iEasyWlanId = KEasyWlanServiceId; // Set to default value just in case
   161     
   162 
       
   163     TRAP( iClientIapsChecked, FindClientIapsL() );
   162     TRAP( iClientIapsChecked, FindClientIapsL() );
   164  
   163  
   165     // Activate notifications for IAP check purposes. Done with every server startup.
   164     // Activate notifications for IAP check purposes. Done with every server startup.
   166     // When EWlanConnectionModeNotConnected is received we can cancel this.
   165     // When EWlanConnectionModeNotConnected is received we can cancel this.
   167     iMgtClient = CWlanMgmtClient::NewL();
   166     iMgtClient = CWlanMgmtClient::NewL();
   202 // -----------------------------------------------------------------------------
   201 // -----------------------------------------------------------------------------
   203 //
   202 //
   204 void CHotSpotServer::FindClientIapsL()
   203 void CHotSpotServer::FindClientIapsL()
   205     {
   204     {
   206     DEBUG("CHotSpotServer::FindClientIapsL()");
   205     DEBUG("CHotSpotServer::FindClientIapsL()");
   207     RCmManagerExt cmManager;
   206     RCmManager cmManager;
   208     cmManager.OpenL();
   207     cmManager.OpenL();
   209     CleanupClosePushL(cmManager);
   208     CleanupClosePushL(cmManager);
   210            
   209            
   211     RArray<TUint32> cmArray;
   210     RArray<TUint32> cmArray;
   212     CleanupClosePushL( cmArray );
   211     CleanupClosePushL( cmArray );
   216     cmManager.ConnectionMethodL( cmArray, supportedBearersOnly, legacyCmsOnly );
   215     cmManager.ConnectionMethodL( cmArray, supportedBearersOnly, legacyCmsOnly );
   217     DEBUG1("CHotSpotServer::FindClientIapsL count: %d", cmArray.Count());  
   216     DEBUG1("CHotSpotServer::FindClientIapsL count: %d", cmArray.Count());  
   218     
   217     
   219     for( TInt i = 0; i < cmArray.Count(); i++ )
   218     for( TInt i = 0; i < cmArray.Count(); i++ )
   220         {
   219         {
   221         RCmConnectionMethodExt cm = cmManager.ConnectionMethodL( cmArray[i] );
   220         RCmConnectionMethod cm = cmManager.ConnectionMethodL( cmArray[i] );
   222         CleanupClosePushL( cm );
   221         CleanupClosePushL( cm );
   223         HBufC* daemonName = cm.GetStringAttributeL( 
   222         HBufC* daemonName = cm.GetStringAttributeL( 
   224                                                 ECmConfigDaemonManagerName );
   223                                                 ECmConfigDaemonManagerName );
   225         CleanupStack::PushL( daemonName );
   224         CleanupStack::PushL( daemonName );
   226         if ( daemonName )
   225         if ( daemonName )
   241             }
   240             }
   242         CleanupStack::PopAndDestroy( daemonName );
   241         CleanupStack::PopAndDestroy( daemonName );
   243         CleanupStack::PopAndDestroy( &cm );
   242         CleanupStack::PopAndDestroy( &cm );
   244         }
   243         }
   245     CleanupStack::PopAndDestroy( &cmArray );
   244     CleanupStack::PopAndDestroy( &cmArray );
   246     
       
   247     // Read Easy WLAN IAP ID
       
   248     iEasyWlanId = cmManager.EasyWlanIdL();
       
   249     CleanupStack::PopAndDestroy( &cmManager );
   245     CleanupStack::PopAndDestroy( &cmManager );
   250     DEBUG1("CHotSpotServer::FindClientIapsL() iEasyWlanId: % d", iEasyWlanId);
   246     DEBUG("CHotSpotServer::FindClientIapsL() Done");
   251     }
   247     }
   252 
   248 
   253 // -----------------------------------------------------------------------------
   249 // -----------------------------------------------------------------------------
   254 // CheckIapsL
   250 // CheckIapsL
   255 // -----------------------------------------------------------------------------
   251 // -----------------------------------------------------------------------------
   278 
   274 
   279         DEBUG1("CHotSpotServer::CheckIapsL find client error: %d", error );
   275         DEBUG1("CHotSpotServer::CheckIapsL find client error: %d", error );
   280         if ( error == KErrNotFound )
   276         if ( error == KErrNotFound )
   281             {
   277             {
   282             // Remove from database
   278             // Remove from database
   283             RCmManagerExt cmManager;
   279             RCmManager cmManager;
   284             cmManager.OpenL();
   280             cmManager.OpenL();
   285             CleanupClosePushL(cmManager);
   281             CleanupClosePushL(cmManager);
   286             
   282             
   287             RCmConnectionMethodExt cm;
   283             RCmConnectionMethod cm;
   288             cm = cmManager.ConnectionMethodL( iClientIaps[i].iIapId );
   284             cm = cmManager.ConnectionMethodL( iClientIaps[i].iIapId );
   289             CleanupClosePushL( cm );
   285             CleanupClosePushL( cm );
   290             cmManager.RemoveAllReferencesL( cm );
   286             cmManager.RemoveAllReferencesL( cm );
   291             cm.DeleteL();
   287             cm.DeleteL();
   292             
   288             
   663             }
   659             }
   664         i++;
   660         i++;
   665         }
   661         }
   666     }
   662     }
   667 
   663 
   668 // -----------------------------------------------------------------------------
       
   669 // GetEasyWlanId
       
   670 // -----------------------------------------------------------------------------
       
   671 //
       
   672 TInt CHotSpotServer::GetEasyWlanId()
       
   673     {
       
   674     DEBUG("CHotspotServer::GetEasyWlanId()");
       
   675     return iEasyWlanId;
       
   676     }
       
   677 
       
   678 // ========================== OTHER EXPORTED FUNCTIONS =========================
   664 // ========================== OTHER EXPORTED FUNCTIONS =========================
   679 
   665 
   680 // -----------------------------------------------------------------------------
   666 // -----------------------------------------------------------------------------
   681 // E32Main implements the executable entry function.
   667 // E32Main implements the executable entry function.
   682 // Note that because the target type of the IPWServer Hss
   668 // Note that because the target type of the IPWServer Hss