hotspotfw/hsclient/src/hssiaphandler.cpp
changeset 39 7b3e49e4608a
parent 36 682dd021f9be
child 58 301aeb18ae47
equal deleted inserted replaced
36:682dd021f9be 39:7b3e49e4608a
    22 #include "hssiaphandler.h"
    22 #include "hssiaphandler.h"
    23 #include "hotspotclientserver.h"
    23 #include "hotspotclientserver.h"
    24 #include "am_debug.h"
    24 #include "am_debug.h"
    25 #include <es_enum.h>
    25 #include <es_enum.h>
    26 
    26 
    27 #include <cmconnectionmethodext.h>
    27 #include <cmconnectionmethod.h>
    28 #include <cmconnectionmethoddef.h>
    28 #include <cmconnectionmethoddef.h>
    29 #include <cmmanagerext.h>
    29 #include <cmmanager.h>
    30 #include <cmmanagerdef.h>
    30 #include <cmmanagerdef.h>
    31 #include <cmdestinationext.h>
    31 #include <cmdestination.h>
    32 
    32 
    33 // CONSTANTS
    33 // CONSTANTS
    34 const TInt  KRetryCount   = 20;
    34 const TInt  KRetryCount   = 20;
    35 const TInt  KRetryTimeout = 100000;
    35 const TInt  KRetryTimeout = 100000;
    36 
    36 
    94     // Wlan table name -field not modified, because it is used to store UIDs
    94     // Wlan table name -field not modified, because it is used to store UIDs
    95     // of clients. 
    95     // of clients. 
    96     DEBUG("CHssIapHandler::ChangeSettingsL");
    96     DEBUG("CHssIapHandler::ChangeSettingsL");
    97     TInt ret( KErrNone );
    97     TInt ret( KErrNone );
    98     
    98     
    99     RCmManagerExt cmManager;
    99     RCmManager cmManager;
   100     cmManager.OpenL();
   100     cmManager.OpenL();
   101     CleanupClosePushL( cmManager );
   101     CleanupClosePushL( cmManager );
   102     
   102     
   103     TUint easyWlanId = cmManager.EasyWlanIdL();
       
   104     
       
   105     // Easy WLAN can't be modified
       
   106     if ( easyWlanId == aIapID )
       
   107     	{
       
   108         CleanupStack::PopAndDestroy( &cmManager ); 
       
   109     	return KErrPermissionDenied;
       
   110     	}
       
   111     
       
   112     // Read WLAN table service id
   103     // Read WLAN table service id
   113     TUint32 serviceId(0);
   104     TUint32 serviceId(0);
   114     RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapID );
   105     RCmConnectionMethod plugin = cmManager.ConnectionMethodL( aIapID );
   115     CleanupClosePushL( plugin );
   106     CleanupClosePushL( plugin );
   116     serviceId = plugin.GetIntAttributeL( EWlanServiceId );
   107     serviceId = plugin.GetIntAttributeL( EWlanServiceId );
   117     DEBUG1("CHssIapHandler::ChangeSettingsL WLAN serviceId: %d", serviceId);
   108     DEBUG1("CHssIapHandler::ChangeSettingsL WLAN serviceId: %d", serviceId);
   118     
   109     
   119     if  ( aSettings.Name.Length() > 0 )
   110     if  ( aSettings.Name.Length() > 0 )
   346 //
   337 //
   347 void CHssIapHandler::GetNetworkIdL( const TUint aIapId, TUint32& aNetId )
   338 void CHssIapHandler::GetNetworkIdL( const TUint aIapId, TUint32& aNetId )
   348     {
   339     {
   349     DEBUG( "CHssIapHandler::GetNetworkIdL()" );
   340     DEBUG( "CHssIapHandler::GetNetworkIdL()" );
   350     
   341     
   351     RCmManagerExt cmManager;
   342     RCmManager cmManager;
   352     cmManager.OpenL();
   343     cmManager.OpenL();
   353     CleanupClosePushL( cmManager );
   344     CleanupClosePushL( cmManager );
   354 
   345 
   355     RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapId );
   346     RCmConnectionMethod plugin = cmManager.ConnectionMethodL( aIapId );
   356     CleanupClosePushL( plugin );
   347     CleanupClosePushL( plugin );
   357     
   348     
   358     aNetId = plugin.GetIntAttributeL( ECmNetworkId );
   349     aNetId = plugin.GetIntAttributeL( ECmNetworkId );
   359     
   350     
   360     CleanupStack::PopAndDestroy( &plugin ); // Close() called on "plugin"
   351     CleanupStack::PopAndDestroy( &plugin ); // Close() called on "plugin"
   378     ModifyClientUid( uidClient );
   369     ModifyClientUid( uidClient );
   379 
   370 
   380     RArray<TUint32> destArray = RArray<TUint32>( 10 );  // KCmArrayGranularity instead of 10
   371     RArray<TUint32> destArray = RArray<TUint32>( 10 );  // KCmArrayGranularity instead of 10
   381     CleanupClosePushL( destArray );
   372     CleanupClosePushL( destArray );
   382 
   373 
   383     RCmManagerExt cmManager;
   374     RCmManager cmManager;
   384     cmManager.OpenL();
   375     cmManager.OpenL();
   385     CleanupClosePushL( cmManager );    
   376     CleanupClosePushL( cmManager );    
   386 
   377 
   387     cmManager.AllDestinationsL( destArray );
   378     cmManager.AllDestinationsL( destArray );
   388 
   379 
   389     for (TInt i = 0; i < destArray.Count(); i++)
   380     for (TInt i = 0; i < destArray.Count(); i++)
   390         {
   381         {
   391         RCmDestinationExt dest = cmManager.DestinationL( destArray[i] );
   382         RCmDestination dest = cmManager.DestinationL( destArray[i] );
   392         CleanupClosePushL( dest );
   383         CleanupClosePushL( dest );
   393 
   384 
   394         for (TInt j = 0; j < dest.ConnectionMethodCount(); j++)
   385         for (TInt j = 0; j < dest.ConnectionMethodCount(); j++)
   395             {
   386             {
   396             TInt bearerType = dest.ConnectionMethodL(j).
   387             TInt bearerType = dest.ConnectionMethodL(j).