hotspotfw/hsserver/src/hotspotsession.cpp
branchRCL_3
changeset 20 a9524956f6b5
parent 18 aaabc7526ded
child 23 b852595f5cbe
equal deleted inserted replaced
18:aaabc7526ded 20:a9524956f6b5
    35 #include <apgcli.h>
    35 #include <apgcli.h>
    36 
    36 
    37 // Forward declarations
    37 // Forward declarations
    38 class CWlanMgmtClient;
    38 class CWlanMgmtClient;
    39 class MWlanMgmtNotifications;
    39 class MWlanMgmtNotifications;
       
    40 
       
    41 // Constants
       
    42 const TInt KSeparatorsLength = 4;    
       
    43 const TInt KBrowserUid = 0x2000AFCC; // WLAN Login UID
    40 
    44 
    41 // ============================ MEMBER FUNCTIONS ===============================
    45 // ============================ MEMBER FUNCTIONS ===============================
    42 
    46 
    43 // -----------------------------------------------------------------------------
    47 // -----------------------------------------------------------------------------
    44 // CHotSpotPluginSession
    48 // CHotSpotPluginSession
  1110 // -----------------------------------------------------------------------------
  1114 // -----------------------------------------------------------------------------
  1111 //    
  1115 //    
  1112 void CHotSpotSession::AuthenticateL( const TDesC& aString )
  1116 void CHotSpotSession::AuthenticateL( const TDesC& aString )
  1113     {
  1117     {
  1114     DEBUG("CHotSpotSession::AuthenticateL()");
  1118     DEBUG("CHotSpotSession::AuthenticateL()");
  1115 
  1119     
  1116     const TInt KBrowserUid = 0x2000AFCC; // hotspot browser application
  1120     // Count IAP Id length
  1117     HBufC* param = HBufC::NewLC( KMaxFileName );
  1121     TInt iapIdLength ( 1 );
       
  1122     TInt iapId = iIapId;
       
  1123     while ( iapId >= 10 )
       
  1124         {
       
  1125         iapId = iapId / 10;
       
  1126         iapIdLength++;
       
  1127         }
       
  1128     
       
  1129     // Count Network Id length
       
  1130     TInt netIdLength ( 1 );
       
  1131     TInt netId = iNetId;
       
  1132     while ( netId >= 10 )
       
  1133         {
       
  1134         netId = netId / 10;
       
  1135         netIdLength++;
       
  1136         }
       
  1137     
       
  1138     TInt length = aString.Length() + 
       
  1139                   iapIdLength + 
       
  1140                   netIdLength + 
       
  1141                   KSeparatorsLength;
       
  1142     HBufC* param = HBufC::NewLC( length );
  1118     _LIT(tmpString, "%d, %d, %S");
  1143     _LIT(tmpString, "%d, %d, %S");
  1119     param->Des().Format( tmpString, iIapId, iNetId, &aString );
  1144     param->Des().Format( tmpString, iIapId, iNetId, &aString );
  1120     TUid uid( TUid::Uid( KBrowserUid ) );
  1145     TUid uid( TUid::Uid( KBrowserUid ) );
  1121     RApaLsSession appArcSession;
  1146     RApaLsSession appArcSession;
  1122     User::LeaveIfError( appArcSession.Connect() ); // connect to AppArc server
  1147     User::LeaveIfError( appArcSession.Connect() ); // connect to AppArc server