# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277128505 -10800 # Node ID a9524956f6b580bda60fd5ae00519202208e7ae8 # Parent aaabc7526dedae8d7b2a836f5978980f617a8bae Revision: 201023 Kit: 2010125 diff -r aaabc7526ded -r a9524956f6b5 hotspotfw/hsclient/inc/hssiaphandler.h --- a/hotspotfw/hsclient/inc/hssiaphandler.h Wed Jun 09 10:53:40 2010 +0300 +++ b/hotspotfw/hsclient/inc/hssiaphandler.h Mon Jun 21 16:55:05 2010 +0300 @@ -123,6 +123,12 @@ * @param aEapCode, Eap id code */ void GetEapTypeDesC( TUint aEapType, TDes8& aEapString, TChar& aEapCode ); + + /** + * Removes brackets from UID + * @param aUid, UID of the client + */ + void ModifyClientUid( TDes& aUid ); private: // Data diff -r aaabc7526ded -r a9524956f6b5 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -31,6 +31,10 @@ #include #include +// CONSTANTS +const TInt KRetryCount = 20; +const TInt KRetryTimeout = 100000; + using namespace CMManager; // ============================ MEMBER FUNCTIONS =============================== @@ -276,12 +280,31 @@ eaps->SetL( enabledEapList ); } } - // now update the access point - iWLANRecord->ModifyL( *dbSession ); + + // Update access point, be prepared that Commsdat might be locked + TInt errCode( KErrLocked ); + TInt retryCount( 0 ); + + while( errCode == KErrLocked && retryCount < KRetryCount ) + { + TRAP( errCode, iWLANRecord->ModifyL( *dbSession ) ); + + if ( errCode == KErrLocked ) + { + User::After( KRetryTimeout ); + } + retryCount++; + } + + if ( errCode ) + { + // override previous ret value only when error happened + ret = errCode; + } CleanupStack::PopAndDestroy( dbSession ); DEBUG("CHssIapHandler::ChangeSettingsL DONE"); - return ret; + return ret; } // ----------------------------------------------------------------------------- @@ -557,8 +580,11 @@ { DEBUG("CHssIapSettingsHandler::GetClientsIapsL"); TBuf<32> buffer; // Temporary buffer for found UID from destination. - TUidName uidClient = aUId.Name(); // UID of the client. TUint32 iapId = 0; // IAP Identifiier. + TBuf uidClient; // UID of the client. + + uidClient.Copy( aUId.Name() ); + ModifyClientUid( uidClient ); RArray destArray = RArray( 10 ); // KCmArrayGranularity instead of 10 CleanupClosePushL( destArray ); @@ -610,4 +636,23 @@ CleanupStack::PopAndDestroy( &destArray ); } +// ----------------------------------------------------------------------------- +// ModifyClientUid +// ----------------------------------------------------------------------------- +// +void CHssIapHandler::ModifyClientUid( TDes& aUid ) + { + DEBUG("CHssIapHandler::ModifyClientUid"); + TInt indx = aUid.Find( KMark1 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + indx = aUid.Find( KMark2 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + } + } + } + // End of File diff -r aaabc7526ded -r a9524956f6b5 hotspotfw/hsserver/src/hotspotsession.cpp --- a/hotspotfw/hsserver/src/hotspotsession.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/hotspotfw/hsserver/src/hotspotsession.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -38,6 +38,10 @@ class CWlanMgmtClient; class MWlanMgmtNotifications; +// Constants +const TInt KSeparatorsLength = 4; +const TInt KBrowserUid = 0x2000AFCC; // WLAN Login UID + // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -1112,9 +1116,30 @@ void CHotSpotSession::AuthenticateL( const TDesC& aString ) { DEBUG("CHotSpotSession::AuthenticateL()"); - - const TInt KBrowserUid = 0x2000AFCC; // hotspot browser application - HBufC* param = HBufC::NewLC( KMaxFileName ); + + // Count IAP Id length + TInt iapIdLength ( 1 ); + TInt iapId = iIapId; + while ( iapId >= 10 ) + { + iapId = iapId / 10; + iapIdLength++; + } + + // Count Network Id length + TInt netIdLength ( 1 ); + TInt netId = iNetId; + while ( netId >= 10 ) + { + netId = netId / 10; + netIdLength++; + } + + TInt length = aString.Length() + + iapIdLength + + netIdLength + + KSeparatorsLength; + HBufC* param = HBufC::NewLC( length ); _LIT(tmpString, "%d, %d, %S"); param->Des().Format( tmpString, iIapId, iNetId, &aString ); TUid uid( TUid::Uid( KBrowserUid ) ); diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/aiplugin/inc/wsfactivewrappers.h --- a/wlanutilities/wlansniffer/aiplugin/inc/wsfactivewrappers.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfactivewrappers.h Mon Jun 21 16:55:05 2010 +0300 @@ -81,8 +81,12 @@ /** * Starts connecting * @since S60 5.2 + * @param aIapId WLAN IAP id to connect to. + * @param aConnectOnly ETrue if Connect selected + * @param aPersistence Persistence property of the IAP */ - void Connect( TUint aIapID, TWsfIapPersistence aPersistence ); + void Connect( TUint aIapID, TBool aConnectOnly, + TWsfIapPersistence aPersistence ); /** * Starts refresh scan diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/aiplugin/inc/wsfaicontroller.h --- a/wlanutilities/wlansniffer/aiplugin/inc/wsfaicontroller.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfaicontroller.h Mon Jun 21 16:55:05 2010 +0300 @@ -366,12 +366,7 @@ /** * Indicates whether Connect or Start Web browsing was selected */ - TBool iShouldConnectOnly; - - /** - * Indicates whether access point needs testing - */ - TBool iTestAccessPoint; + TBool iConnectOnly; /** * A pointer to CWsfActiveWrappers diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/aiplugin/inc/wsfconnectactivewrapper.h --- a/wlanutilities/wlansniffer/aiplugin/inc/wsfconnectactivewrapper.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfconnectactivewrapper.h Mon Jun 21 16:55:05 2010 +0300 @@ -62,8 +62,12 @@ /** * Function for making the initial request * @since S60 5.2 + * @param aIapId WLAN IAP id to connect to. + * @param aConnectOnly ETrue if Connect selected + * @param aPersistence Persistence property of the IAP */ - void Start( TUint aIapID, TWsfIapPersistence aPersistence ); + void Start( TUint aIapID, TBool aConnectOnly, + TWsfIapPersistence aPersistence ); private: @@ -131,6 +135,11 @@ TUint iIapID; /** + * Indicates whether Connect or Start Web browsing was selected + */ + TBool iConnectOnly; + + /** * Persistence value of IAP */ TWsfIapPersistence iPersistence; diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/aiplugin/src/wsfactivewrappers.cpp --- a/wlanutilities/wlansniffer/aiplugin/src/wsfactivewrappers.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfactivewrappers.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -117,10 +117,11 @@ // CWsfActiveWrappers::Connect // ---------------------------------------------------------------------------- // -void CWsfActiveWrappers::Connect( TUint aIapID, TWsfIapPersistence aPersistence ) +void CWsfActiveWrappers::Connect( TUint aIapID, TBool aConnectOnly, + TWsfIapPersistence aPersistence ) { LOG_ENTERFN( "CWsfActiveWrappers::Connect" ); - iConnectActiveWrapper->Start( aIapID, aPersistence ); + iConnectActiveWrapper->Start( aIapID, aConnectOnly, aPersistence ); } diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/aiplugin/src/wsfaicontroller.cpp --- a/wlanutilities/wlansniffer/aiplugin/src/wsfaicontroller.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfaicontroller.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -80,8 +80,7 @@ iAiModel( NULL ), iUi( NULL ), iDbObserver( NULL ), - iShouldConnectOnly( EFalse ), - iTestAccessPoint( EFalse ) + iConnectOnly( EFalse ) { // null the pointers iConnectedWlan.iConnectionState = ENotConnected; @@ -461,14 +460,10 @@ if ( aResult == KErrNone ) { iAiModel->SetConnected( ETrue ); - if ( !iShouldConnectOnly ) + if ( !iConnectOnly ) { StartWebBrowserL( iUsedInfo ); } - if ( iTestAccessPoint ) - { - iModel->TestConnectedAccessPointL( iUsedInfo, iShouldConnectOnly ); - } } else { @@ -511,7 +506,7 @@ else { LOG_WRITE("Start browser to connected network..."); - iShouldConnectOnly = EFalse; + iConnectOnly = EFalse; StartWebBrowserL( iUsedInfo ); } @@ -558,8 +553,8 @@ LOG_ENTERFN( "TWsfAiController::ConnectL" ); _ASS_D( iModel ); - iTestAccessPoint = aTestAccessPoint; - iShouldConnectOnly = aConnectOnly; + TBool testAccessPoint = aTestAccessPoint; + iConnectOnly = aConnectOnly; iUsedInfo = aInfo; // Prevent connections to ad-hoc + WPA @@ -602,29 +597,31 @@ User::Leave( accessPointCreatedError ); } ConnectingL( iUsedInfo.iIapId ); - iTestAccessPoint = ETrue; + testAccessPoint = ETrue; } else if ( !iUsedInfo.iIapId ) { + testAccessPoint = ETrue; // let the helper app do the query if necessary LOG_WRITE("AiHelper needs to be launched"); - iTestAccessPoint = ETrue; iActiveWrappers->LaunchHelperApplicationL( iUsedInfo, - iShouldConnectOnly, - iTestAccessPoint ); + iConnectOnly, + testAccessPoint ); } // Connect if ( iUsedInfo.iIapId ) { - if ( iTestAccessPoint ) + if ( testAccessPoint ) { - iActiveWrappers->Connect( iUsedInfo.iIapId, EIapExpireOnDisconnect ); + iActiveWrappers->Connect( iUsedInfo.iIapId, iConnectOnly, + EIapExpireOnDisconnect ); } else { - iActiveWrappers->Connect( iUsedInfo.iIapId, EIapPersistent ); + iActiveWrappers->Connect( iUsedInfo.iIapId, iConnectOnly, + EIapPersistent ); } } // pop cleanup item diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/aiplugin/src/wsfconnectactivewrapper.cpp --- a/wlanutilities/wlansniffer/aiplugin/src/wsfconnectactivewrapper.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfconnectactivewrapper.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -102,12 +102,14 @@ // CWsfConnectActiveWrapper::StartL // -------------------------------------------------------------------------- // -void CWsfConnectActiveWrapper::Start(TUint aIapID, TWsfIapPersistence aPersistence ) +void CWsfConnectActiveWrapper::Start( TUint aIapID, TBool aConnectOnly, + TWsfIapPersistence aPersistence ) { LOG_ENTERFN( "CWsfConnectActiveWrapper::Start" ); Cancel(); // Cancel any request, just to be sure iState = EUninitialized; iIapID = aIapID; + iConnectOnly = aConnectOnly; iPersistence = aPersistence; SetActive(); TRequestStatus* status = &iStatus; @@ -127,7 +129,7 @@ if ( iState == EUninitialized ) { LOG_WRITE( "Start connect" ); - iModel->ConnectL( iPckg, iIapID, iPersistence, iStatus ); + iModel->ConnectL( iPckg, iIapID, iConnectOnly, iPersistence, iStatus ); iState = EInitialized; SetActive(); // Tell scheduler a request is active } diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/client/bwins/wsfclientu.def --- a/wlanutilities/wlansniffer/engine/client/bwins/wsfclientu.def Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/client/bwins/wsfclientu.def Mon Jun 21 16:55:05 2010 +0300 @@ -2,29 +2,29 @@ ?SetIapPersistenceL@RWsfSession@@QAEHW4TWsfIapPersistence@@@Z @ 1 NONAME ; int RWsfSession::SetIapPersistenceL(enum TWsfIapPersistence) ?GetWlanList@RWsfSession@@QAEXAAV?$TPckgBuf@I@@AAVTPtr8@@AAVTRequestStatus@@@Z @ 2 NONAME ; void RWsfSession::GetWlanList(class TPckgBuf &, class TPtr8 &, class TRequestStatus &) ?DisconnectWlanBearer@RWsfSession@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 3 NONAME ; void RWsfSession::DisconnectWlanBearer(class TPckgBuf &, class TRequestStatus &) - ?RequestScanL@RWsfSession@@QAEHXZ @ 4 NONAME ; int RWsfSession::RequestScanL(void) - ??0RWsfSession@@QAE@XZ @ 5 NONAME ; RWsfSession::RWsfSession(void) - ?CancelNotifyEvent@RWsfSession@@QAEXXZ @ 6 NONAME ; void RWsfSession::CancelNotifyEvent(void) - ?CancelAll@RWsfSession@@QAEXXZ @ 7 NONAME ; void RWsfSession::CancelAll(void) - ?GetConnectedWlanDetailsL@RWsfSession@@QAEHAAVTWsfWlanInfo@@@Z @ 8 NONAME ; int RWsfSession::GetConnectedWlanDetailsL(class TWsfWlanInfo &) - ?EnableScanL@RWsfSession@@QAEHXZ @ 9 NONAME ; int RWsfSession::EnableScanL(void) - ?DisconnectWlanBearerL@RWsfSession@@QAEHXZ @ 10 NONAME ; int RWsfSession::DisconnectWlanBearerL(void) - ?ConnectWlanBearer@RWsfSession@@QAEXAAV?$TPckgBuf@H@@KW4TWsfIapPersistence@@AAVTRequestStatus@@@Z @ 11 NONAME ; void RWsfSession::ConnectWlanBearer(class TPckgBuf &, unsigned long, enum TWsfIapPersistence, class TRequestStatus &) - ?UpdateWlanListL@RWsfSession@@QAEXPAVCWsfWlanInfoArray@@@Z @ 12 NONAME ; void RWsfSession::UpdateWlanListL(class CWsfWlanInfoArray *) - ?NotifyEventL@RWsfSession@@QAEXAAVMWsfStateChangeObserver@@@Z @ 13 NONAME ; void RWsfSession::NotifyEventL(class MWsfStateChangeObserver &) - ?MonitorAccessPointL@RWsfSession@@QAEXK@Z @ 14 NONAME ; void RWsfSession::MonitorAccessPointL(unsigned long) - ?GetWlanListSize@RWsfSession@@QAEXAAV?$TPckgBuf@I@@AAVTRequestStatus@@@Z @ 15 NONAME ; void RWsfSession::GetWlanListSize(class TPckgBuf &, class TRequestStatus &) - ?AbortConnectingL@RWsfSession@@QAEXXZ @ 16 NONAME ; void RWsfSession::AbortConnectingL(void) - ?ConnectWlanBearerL@RWsfSession@@QAEHKW4TWsfIapPersistence@@@Z @ 17 NONAME ; int RWsfSession::ConnectWlanBearerL(unsigned long, enum TWsfIapPersistence) + ?GetConnectedWlanDetails@RWsfSession@@QAEXAAV?$TPckgBuf@H@@AAVTWsfWlanInfo@@AAVTRequestStatus@@@Z @ 4 NONAME ; void RWsfSession::GetConnectedWlanDetails(class TPckgBuf &, class TWsfWlanInfo &, class TRequestStatus &) + ?RequestScanL@RWsfSession@@QAEHXZ @ 5 NONAME ; int RWsfSession::RequestScanL(void) + ??0RWsfSession@@QAE@XZ @ 6 NONAME ; RWsfSession::RWsfSession(void) + ?ConnectWlanBearerL@RWsfSession@@QAEHKHW4TWsfIapPersistence@@@Z @ 7 NONAME ; int RWsfSession::ConnectWlanBearerL(unsigned long, int, enum TWsfIapPersistence) + ?CancelNotifyEvent@RWsfSession@@QAEXXZ @ 8 NONAME ; void RWsfSession::CancelNotifyEvent(void) + ?CancelAll@RWsfSession@@QAEXXZ @ 9 NONAME ; void RWsfSession::CancelAll(void) + ?GetConnectedWlanDetailsL@RWsfSession@@QAEHAAVTWsfWlanInfo@@@Z @ 10 NONAME ; int RWsfSession::GetConnectedWlanDetailsL(class TWsfWlanInfo &) + ?EnableScanL@RWsfSession@@QAEHXZ @ 11 NONAME ; int RWsfSession::EnableScanL(void) + ?DisconnectWlanBearerL@RWsfSession@@QAEHXZ @ 12 NONAME ; int RWsfSession::DisconnectWlanBearerL(void) + ?UpdateWlanListL@RWsfSession@@QAEXPAVCWsfWlanInfoArray@@@Z @ 13 NONAME ; void RWsfSession::UpdateWlanListL(class CWsfWlanInfoArray *) + ?NotifyEventL@RWsfSession@@QAEXAAVMWsfStateChangeObserver@@@Z @ 14 NONAME ; void RWsfSession::NotifyEventL(class MWsfStateChangeObserver &) + ?MonitorAccessPointL@RWsfSession@@QAEXK@Z @ 15 NONAME ; void RWsfSession::MonitorAccessPointL(unsigned long) + ?GetWlanListSize@RWsfSession@@QAEXAAV?$TPckgBuf@I@@AAVTRequestStatus@@@Z @ 16 NONAME ; void RWsfSession::GetWlanListSize(class TPckgBuf &, class TRequestStatus &) + ?AbortConnectingL@RWsfSession@@QAEXXZ @ 17 NONAME ; void RWsfSession::AbortConnectingL(void) ?ConnectedAccountNameL@RWsfSession@@QAEPAVHBufC16@@XZ @ 18 NONAME ; class HBufC16 * RWsfSession::ConnectedAccountNameL(void) - ?SetConnectWlanBearerResult@RWsfSession@@QAEXH@Z @ 19 NONAME ; void RWsfSession::SetConnectWlanBearerResult(int) - ?AbortScanningL@RWsfSession@@QAEXXZ @ 20 NONAME ; void RWsfSession::AbortScanningL(void) - ?RequestScan@RWsfSession@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 21 NONAME ; void RWsfSession::RequestScan(class TPckgBuf &, class TRequestStatus &) - ?IsConnectedL@RWsfSession@@QAEHXZ @ 22 NONAME ; int RWsfSession::IsConnectedL(void) - ?Close@RWsfSession@@QAEXXZ @ 23 NONAME ; void RWsfSession::Close(void) - ?IsScanEnabledL@RWsfSession@@QAEHXZ @ 24 NONAME ; int RWsfSession::IsScanEnabledL(void) - ?ControlDisconnectTimerL@RWsfSession@@QAEHI@Z @ 25 NONAME ; int RWsfSession::ControlDisconnectTimerL(unsigned int) - ?Connect@RWsfSession@@QAEHXZ @ 26 NONAME ; int RWsfSession::Connect(void) - ?DisableScanL@RWsfSession@@QAEHXZ @ 27 NONAME ; int RWsfSession::DisableScanL(void) - ?GetConnectedWlanDetails@RWsfSession@@QAEXAAV?$TPckgBuf@H@@AAVTWsfWlanInfo@@AAVTRequestStatus@@@Z @ 28 NONAME ; void RWsfSession::GetConnectedWlanDetails(class TPckgBuf &, class TWsfWlanInfo &, class TRequestStatus &) + ?ConnectWlanBearer@RWsfSession@@QAEXAAV?$TPckgBuf@H@@KHW4TWsfIapPersistence@@AAVTRequestStatus@@@Z @ 19 NONAME ; void RWsfSession::ConnectWlanBearer(class TPckgBuf &, unsigned long, int, enum TWsfIapPersistence, class TRequestStatus &) + ?SetConnectWlanBearerResult@RWsfSession@@QAEXH@Z @ 20 NONAME ; void RWsfSession::SetConnectWlanBearerResult(int) + ?AbortScanningL@RWsfSession@@QAEXXZ @ 21 NONAME ; void RWsfSession::AbortScanningL(void) + ?RequestScan@RWsfSession@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 22 NONAME ; void RWsfSession::RequestScan(class TPckgBuf &, class TRequestStatus &) + ?IsConnectedL@RWsfSession@@QAEHXZ @ 23 NONAME ; int RWsfSession::IsConnectedL(void) + ?Close@RWsfSession@@QAEXXZ @ 24 NONAME ; void RWsfSession::Close(void) + ?IsScanEnabledL@RWsfSession@@QAEHXZ @ 25 NONAME ; int RWsfSession::IsScanEnabledL(void) + ?ControlDisconnectTimerL@RWsfSession@@QAEHI@Z @ 26 NONAME ; int RWsfSession::ControlDisconnectTimerL(unsigned int) + ?Connect@RWsfSession@@QAEHXZ @ 27 NONAME ; int RWsfSession::Connect(void) + ?DisableScanL@RWsfSession@@QAEHXZ @ 28 NONAME ; int RWsfSession::DisableScanL(void) diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/client/eabi/wsfclientu.def --- a/wlanutilities/wlansniffer/engine/client/eabi/wsfclientu.def Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/client/eabi/wsfclientu.def Mon Jun 21 16:55:05 2010 +0300 @@ -12,19 +12,19 @@ _ZN11RWsfSession15UpdateWlanListLEP17CWsfWlanInfoArray @ 11 NONAME _ZN11RWsfSession16AbortConnectingLEv @ 12 NONAME _ZN11RWsfSession17CancelNotifyEventEv @ 13 NONAME - _ZN11RWsfSession17ConnectWlanBearerER8TPckgBufIiEm18TWsfIapPersistenceR14TRequestStatus @ 14 NONAME - _ZN11RWsfSession18ConnectWlanBearerLEm18TWsfIapPersistence @ 15 NONAME + _ZN11RWsfSession17ConnectWlanBearerER8TPckgBufIiEmi18TWsfIapPersistenceR14TRequestStatus @ 14 NONAME + _ZN11RWsfSession18ConnectWlanBearerLEmi18TWsfIapPersistence @ 15 NONAME _ZN11RWsfSession18SetIapPersistenceLE18TWsfIapPersistence @ 16 NONAME _ZN11RWsfSession19MonitorAccessPointLEm @ 17 NONAME _ZN11RWsfSession20DisconnectWlanBearerER8TPckgBufIiER14TRequestStatus @ 18 NONAME _ZN11RWsfSession21ConnectedAccountNameLEv @ 19 NONAME _ZN11RWsfSession21DisconnectWlanBearerLEv @ 20 NONAME _ZN11RWsfSession23ControlDisconnectTimerLEj @ 21 NONAME - _ZN11RWsfSession24GetConnectedWlanDetailsLER12TWsfWlanInfo @ 22 NONAME - _ZN11RWsfSession26SetConnectWlanBearerResultEi @ 23 NONAME - _ZN11RWsfSession5CloseEv @ 24 NONAME - _ZN11RWsfSession7ConnectEv @ 25 NONAME - _ZN11RWsfSessionC1Ev @ 26 NONAME - _ZN11RWsfSessionC2Ev @ 27 NONAME - _ZN11RWsfSession23GetConnectedWlanDetailsER8TPckgBufIiER12TWsfWlanInfoR14TRequestStatus @ 28 NONAME + _ZN11RWsfSession23GetConnectedWlanDetailsER8TPckgBufIiER12TWsfWlanInfoR14TRequestStatus @ 22 NONAME + _ZN11RWsfSession24GetConnectedWlanDetailsLER12TWsfWlanInfo @ 23 NONAME + _ZN11RWsfSession26SetConnectWlanBearerResultEi @ 24 NONAME + _ZN11RWsfSession5CloseEv @ 25 NONAME + _ZN11RWsfSession7ConnectEv @ 26 NONAME + _ZN11RWsfSessionC1Ev @ 27 NONAME + _ZN11RWsfSessionC2Ev @ 28 NONAME diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/client/inc/wsfsession.h --- a/wlanutilities/wlansniffer/engine/client/inc/wsfsession.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/client/inc/wsfsession.h Mon Jun 21 16:55:05 2010 +0300 @@ -188,10 +188,12 @@ * then starts a synchronous wait until the connection is established. * @since S60 5.0 * @param aIapId The id of the IAP to connect to + * @param aConnectOnly ETrue if Connect selected * @param aPersistence The value of the persistence property * @return KErrNone if managed to connect, otherwise error code */ IMPORT_C TInt ConnectWlanBearerL( TUint32 aIapId, + TBool aConnectOnly, TWsfIapPersistence aPersistence = EIapPersistent ); /** @@ -199,13 +201,15 @@ * @since S60 5.2 * @param aPckg request result * @param aIapId The id of the IAP to connect to + * @param aConnectOnly ETrue if Connect selected * @param aPersistence The value of the persistence property * @param aStatus The request status object used to contain * the completion status of the request. */ IMPORT_C void ConnectWlanBearer( TPckgBuf& aPckg, TUint32 aIapId, - TWsfIapPersistence aPersistence, + TBool aConnectOnly, + TWsfIapPersistence aPersistence, TRequestStatus& aStatus ); /** diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/client/src/wsfsession.cpp --- a/wlanutilities/wlansniffer/engine/client/src/wsfsession.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/client/src/wsfsession.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -480,7 +480,8 @@ // --------------------------------------------------------------------------- // EXPORT_C TInt RWsfSession::ConnectWlanBearerL( TUint32 aIapId, - TWsfIapPersistence aPersistence ) + TBool aConnectOnly, + TWsfIapPersistence aPersistence ) { LOG_ENTERFN( "RWsfSession::ConnectWlanBearerL" ); LOG_WRITEF( "IAP id = %d", aIapId ); @@ -495,8 +496,10 @@ CWsfActiveWaiter *waiter = CWsfActiveWaiter::NewL(); CleanupStack::PushL( waiter ); - SendReceive( ESnifferCmdConnect, TIpcArgs( &pckg, aIapId, aPersistence ), - waiter->iStatus ); + SendReceive( ESnifferCmdConnect, + TIpcArgs( &pckg, aIapId, aConnectOnly, aPersistence ), + waiter->iStatus ); + waiter->WaitForRequest(); LOG_WRITEF( "message[%d] call returned %d", ESnifferCmdConnect, @@ -534,6 +537,7 @@ // EXPORT_C void RWsfSession::ConnectWlanBearer( TPckgBuf& aPckg, TUint32 aIapId, + TBool aConnectOnly, TWsfIapPersistence aPersistence, TRequestStatus& aStatus ) { @@ -544,8 +548,9 @@ iEventHandler->UnBlockNextConnectedEvent(); iEventHandler->SetConnecting( ETrue ); - SendReceive( ESnifferCmdConnect, TIpcArgs( &aPckg, aIapId, aPersistence ), - aStatus ); + SendReceive( ESnifferCmdConnect, + TIpcArgs( &aPckg, aIapId, aConnectOnly, aPersistence ), + aStatus ); } diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/group/server.mmp --- a/wlanutilities/wlansniffer/engine/server/group/server.mmp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/group/server.mmp Mon Jun 21 16:55:05 2010 +0300 @@ -40,6 +40,7 @@ SOURCE wsfservercloser.cpp SOURCE wsfwlanbearerconnectionmonitor.cpp SOURCE wsfactivewaiter.cpp +SOURCE wsfict.cpp // own headers @@ -70,6 +71,7 @@ LIBRARY commdb.lib LIBRARY cmmanagerdatabase.lib LIBRARY cmmanager.lib +LIBRARY ictsclientinterface.lib LIBRARY esock.lib LIBRARY charconv.lib diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/inc/wsfengine.h --- a/wlanutilities/wlansniffer/engine/server/inc/wsfengine.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/inc/wsfengine.h Mon Jun 21 16:55:05 2010 +0300 @@ -143,10 +143,13 @@ * Connects to the given IAP * @since S60 5.0 * @param aIapId The IAP to connect to + * @param aConnectOnly ETrue if Connect selected * @param aPersistence Persistence property of the IAP * @return KErrNone if successful, otherwise error code */ - TInt ConnectWlanL( TUint32 aIapId, TWsfIapPersistence aPersistence ); + TInt ConnectWlanL( TUint32 aIapId, + TBool aConnectOnly, + TWsfIapPersistence aPersistence ); /** * Disconnects the active WLAN connection diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/inc/wsfict.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/engine/server/inc/wsfict.h Mon Jun 21 16:55:05 2010 +0300 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class header for CWsfIct +* +*/ + + + +#ifndef C_WSFICT_H +#define C_WSFICT_H + + +// EXTERNAL INCLUDES +#include +#include + + +// FORWARD DECLARATIONS + + +// CLASS DEFINITION +/** + * Class to monitor and control ICT interface + * + * @lib wsfserver.exe + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CWsfIct ): public CBase, + public MIctsObserver + { + public: // Constructors and destructor + + /** + * Factory function. + * @since S60 5.2 + * @return CWsfIct instance + */ + IMPORT_C static CWsfIct* NewL(); + + /** + * Factory function. + * @since S60 5.2 + * @return CWsfIct instance + */ + IMPORT_C static CWsfIct* NewLC(); + + IMPORT_C ~CWsfIct(); + + private: // Constructors + CWsfIct(); + + /** + * Factory function. + * @since S60 5.2 + */ + void ConstructL(); + + public: // New methods + + /** + * Tests the connected WLAN access point + * @since S60 5.2 + * @param aIapId Id of the connection method + */ + void TestConnectedAccessPointL( TUint aIapId ); + + /** + * Initializes ICT parameters + * @since S60 5.2 + * @param ETrue if ICT needs to be executed + * @param aIapId Id of the connection method + * @param aConnectOnly ETrue if connect only case, + * EFalse if browser is launched after successful connection. + */ + void InitializeIctL( TBool aTestAccessPoint, + TUint aIapId, + TBool aConnectOnly ); + + public: // from MIctsObserver + + /** + * Called by ICTS during/after connectivity test + * @since S60 5.2 + * @param aResult Result code of the connectivity test + * @param aString Parameter to hold auxiliary data + */ + void ConnectivityObserver( TIctsTestResult aResult, const TDesC& aString ); + + + private: // New methods + + /** + * Starts WLAN Login application + * @param aString Contains redirect URL + */ + void LaunchWlanLoginL( const TDesC& aString ); + + /** + * Moves the IAP to internet SNAP + * @param aIapId Id of the connection method + */ + void MoveToInternetSnapL( const TUint32 aIapId ); + + + private: // Data + + /** + * Id of currently connected IAP (if applicable) + */ + TUint iIapId; + + /** + * Network id of currently connected IAP (if applicable) + */ + TUint iNetId; + + /** + * Indicates if "Connect" or "Start Web browsing" is selected. + */ + TBool iConnectOnly; + + /** + * ICT class. Owned. + */ + CIctsClientInterface* iIct; + + }; + +#endif // C_WSFICT_H + +// End of file diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/inc/wsfwlanbearerconnectionmonitor.h --- a/wlanutilities/wlansniffer/engine/server/inc/wsfwlanbearerconnectionmonitor.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/inc/wsfwlanbearerconnectionmonitor.h Mon Jun 21 16:55:05 2010 +0300 @@ -36,6 +36,7 @@ // FORWARD DECLARATIONS class MWsfWlanMonitorObserver; class MWsfServerCloserAdapter; +class CWsfIct; // CLASS DEFINITION @@ -150,9 +151,14 @@ /* * Connects to the given IAP * @since S60 5.0 + * @param aIapId WLAN IAP id to connect to. + * @param aConnectOnly ETrue if Connect selected + * @param aTestAccessPoint ETrue if accesspoint needs testing * @return KErrNone on success, error code otherwise */ - TInt ConnectBearer( TUint32 aIapId ); + TInt ConnectBearer( TUint32 aIapId, + TBool aConnectOnly, + TBool aTestAccessPoint ); /* * Disconnects active connection @@ -401,6 +407,11 @@ */ MWsfServerCloserAdapter& iServerCloser; + /** + * Reference to ICT handler + */ + CWsfIct* iIct; + }; diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/inc/wsfwlanscanner.h --- a/wlanutilities/wlansniffer/engine/server/inc/wsfwlanscanner.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/inc/wsfwlanscanner.h Mon Jun 21 16:55:05 2010 +0300 @@ -136,9 +136,14 @@ EIdle, /** + * Do broadcast scan + */ + EBroadcastScan, + + /** * Processing broadcast scan results */ - EBroadcastScan, + EProcessBroadcastScan, /** * Processing direct scan results @@ -572,9 +577,24 @@ TBuf8 iConnectedSsidOrIap; /** - * Array containing the available IAP IDs + * Array containing the available IAP IDs and Signal Strengths + */ + RArray iAvailableIaps; + + /** + * Cache lifetime. + * Parameter needed for issuing "get available WLAN IAPs" + * request. */ - RArray iAvailableIaps; + TInt iCacheLifetime; + + /** + * Max Delay. + * Parameter needed for issuing "get available WLAN IAPs" + * request. + */ + TUint iMaxDelay; + }; diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/src/wsfengine.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfengine.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfengine.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -481,6 +481,38 @@ RCmManagerExt cmMgr; cmMgr.OpenLC(); + RArray cmIds; + CleanupClosePushL( cmIds ); + cmMgr.ConnectionMethodL( cmIds, ETrue, ETrue, EFalse ); + TBool foundFromUncategorized = EFalse; + + for ( TInt k = 0; k < cmIds.Count(); k++ ) + { + RCmConnectionMethodExt cm; + TRAPD( error, cm = cmMgr.ConnectionMethodL( cmIds[k] ) ); + if ( KErrNone == error ) + { + CleanupClosePushL( cm ); + + TUint iapId = cm.GetIntAttributeL( CMManager::ECmIapId ); + if ( iapId == aIapId ) + { + LOG_WRITE( "IAP is uncategorized" ); + foundFromUncategorized = ETrue; + } + CleanupStack::PopAndDestroy( &cm ); + } + } + + CleanupStack::PopAndDestroy( &cmIds ); + + if ( !foundFromUncategorized ) + { + LOG_WRITE( "Not deleting IAP since it is in SNAP" ); + CleanupStack::PopAndDestroy( &cmMgr ); + return; + } + RCmConnectionMethodExt ictCm = cmMgr.ConnectionMethodL( aIapId ); CleanupClosePushL( ictCm ); @@ -542,7 +574,8 @@ // CWsfEngine::ConnectWlanL // ---------------------------------------------------------------------------- // -TInt CWsfEngine::ConnectWlanL( TUint32 aIapId, +TInt CWsfEngine::ConnectWlanL( TUint32 aIapId, + TBool aConnectOnly, TWsfIapPersistence aPersistence ) { LOG_ENTERFN( "CWsfEngine::ConnectWlanL" ); @@ -568,7 +601,9 @@ iSuppressIapDeletion = EFalse; } - TInt ret = iWlanBearerMonitor->ConnectBearer( aIapId ); + TInt ret = iWlanBearerMonitor->ConnectBearer( aIapId, + aConnectOnly, + aPersistence != EIapPersistent ); if ( !ret ) { diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/src/wsfict.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfict.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -0,0 +1,371 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CWsfIct +* +*/ + + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include + +// CLASS HEADER +#include "wsfict.h" +#include "wsflogger.h" + +// INTERNAL INCLUDES + +using namespace CMManager; + +/** +* UID of Wlan Login application (hsbrowser) +* used when launching WLAN Login application +*/ +static const TInt KBrowserUid = { 0x2000AFCC }; + +/** +* Length of a needed separators +* used when launching WLAN Login application +*/ +const TInt KSeparatorsLength = 4; + + +// ---------------------------------------------------------------------------- +// CWsfIct::NewL +// ---------------------------------------------------------------------------- +// +EXPORT_C CWsfIct* CWsfIct::NewL() + { + CWsfIct* self = CWsfIct::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::NewLC +// ---------------------------------------------------------------------------- +// +EXPORT_C CWsfIct* CWsfIct::NewLC() + { + CWsfIct* self = new( ELeave ) CWsfIct; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::~CWsfIct +// ---------------------------------------------------------------------------- +// +EXPORT_C CWsfIct::~CWsfIct() + { + LOG_ENTERFN( "CWsfIct::~CWsfIct" ); + if ( iIct ) + { + LOG_WRITE( "ict cancel" ); + TRAP_IGNORE( iIct->CancelStartL() ); + delete iIct; + iIct = NULL; + } + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::CWsfIct +// ---------------------------------------------------------------------------- +// +CWsfIct::CWsfIct(): iConnectOnly( EFalse ) + { + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::ConstructL +// ---------------------------------------------------------------------------- +// +void CWsfIct::ConstructL() + { + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::ConnectivityObserver +// ---------------------------------------------------------------------------- +// +void CWsfIct::ConnectivityObserver( TIctsTestResult aResult, + const TDesC& aString ) + { + LOG_ENTERFN( "CWsfIct::ConnectivityObserver" ); + LOG_WRITEF( "ICTS result: %d", aResult ); + + // check the result + switch ( aResult ) + { + case EConnectionOk: + { + // test succeeded + TRAP_IGNORE( MoveToInternetSnapL( iIapId ) ); + LOG_WRITE( "ICT: EConnectionOk" ); + break; + } + + case EConnectionNotOk: + { + // test was run but it failed + LOG_WRITE( "ICT: EConnectionNotOk" ); + break; + } + case EHttpAuthenticationNeeded: + { + // test was run but HTTP authentication is required + LOG_WRITE( "ICT: EHttpAuthenticationNeeded" ); + if ( iConnectOnly ) + { + // Connect selected. WLAN Login needed. + TRAP_IGNORE( LaunchWlanLoginL(aString) ); + } + break; + } + case ETimeout: + { + LOG_WRITE( "ICT: ETimeout" ); + break; + } + + default: + { + _LIT( KIctPanic, "ICT result" ); + User::Panic( KIctPanic, aResult ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CWsfIct::LaunchWlanLoginL() +// ----------------------------------------------------------------------------- +// +void CWsfIct::LaunchWlanLoginL( const TDesC& aString ) + { + LOG_ENTERFN( "CWsfIct::LaunchWlanLoginL" ); + + // Count IAP Id length + TInt iapIdLength ( 1 ); + TInt iapId = iIapId; + while ( iapId >= 10 ) + { + iapId = iapId/10; + iapIdLength++; + } + + // Count Network Id length + TInt netIdLength ( 1 ); + TInt netId = iNetId; + while ( netId >= 10 ) + { + netId = netId/10; + netIdLength++; + } + + TInt length = aString.Length() + + iapIdLength + + netIdLength + + KSeparatorsLength; + HBufC* param = HBufC::NewLC( length ); + _LIT(tmpString, "%d, %d, %S"); + param->Des().Format( tmpString, + iIapId, + iNetId, + &aString ); + TUid uid( TUid::Uid( KBrowserUid ) ); + TThreadId id; + + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + CleanupClosePushL( appArcSession ); + + TInt err = appArcSession.StartDocument( *param, TUid::Uid( KBrowserUid ), id ); + if ( err != KErrNone ) + { + LOG_ENTERFN( "CWsfIct::LaunchWlanLoginL failed" ); + } + CleanupStack::PopAndDestroy( &appArcSession ); + CleanupStack::PopAndDestroy( param ); + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::MoveToInternetSnapL +// ---------------------------------------------------------------------------- +// +void CWsfIct::MoveToInternetSnapL( const TUint32 aIapId ) + { + LOG_ENTERFN( "CWsfIct::MoveToInternetSnapL" ); + RCmManagerExt cmManager; + cmManager.OpenL(); + CleanupClosePushL( cmManager ); + + // Check that is IAP uncategorized + RArray cmIds; + CleanupClosePushL( cmIds ); + cmManager.ConnectionMethodL( cmIds, ETrue, ETrue, EFalse ); + TBool foundFromUncategorized = EFalse; + + for ( TInt k = 0; k < cmIds.Count(); k++ ) + { + RCmConnectionMethodExt cm; + TRAPD( error, cm = cmManager.ConnectionMethodL( cmIds[k] ) ); + if ( KErrNone == error ) + { + CleanupClosePushL( cm ); + + TUint iapId = cm.GetIntAttributeL( CMManager::ECmIapId ); + if ( iapId == aIapId ) + { + LOG_WRITE( "IAP is uncategorized" ); + foundFromUncategorized = ETrue; + } + CleanupStack::PopAndDestroy( &cm ); + } + } + + CleanupStack::PopAndDestroy( &cmIds ); + + if ( !foundFromUncategorized ) + { + LOG_WRITE( "Not moving IAP since it is in SNAP" ); + CleanupStack::PopAndDestroy( &cmManager ); + return; + } + + // Read all destination(SNAP) settings into an array + RArray destinations; + CleanupClosePushL( destinations ); + + cmManager.AllDestinationsL( destinations ); + RCmDestinationExt destination; + // Loop through each destination + for( TInt i = 0; i < destinations.Count(); i++ ) + { + destination = cmManager.DestinationL( destinations[i] ); + CleanupClosePushL( destination ); + // Internet destination will always exist in the system. + // Internet destination will have ESnapPurposeInternet + // set in its metadata. + if ( destination.MetadataL( CMManager::ESnapMetadataPurpose ) == + CMManager::ESnapPurposeInternet ) + { + RCmConnectionMethodExt iap = cmManager.ConnectionMethodL( aIapId ); + CleanupClosePushL( iap ); + LOG_WRITE( "Move Iap to internet destination" ); + destination.AddConnectionMethodL( iap ); + destination.UpdateL(); + CleanupStack::PopAndDestroy( &iap ); + } + CleanupStack::PopAndDestroy( &destination ); + } + CleanupStack::PopAndDestroy( &destinations ); + CleanupStack::PopAndDestroy( &cmManager ); + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::TestConnectedAccessPointL +// ---------------------------------------------------------------------------- +// +void CWsfIct::TestConnectedAccessPointL( TUint aIapId ) + { + LOG_ENTERFN( "CWsfIct::TestConnectedAccessPointL" ); + if ( !aIapId || aIapId != iIapId ) + { + // the wlaninfo must already contain a valid IAP id + LOG_WRITE( "invalid IAP id" ); + return; + } + + if ( iIct ) + { + iIct->CancelStartL(); + delete iIct; + iIct = NULL; + } + + LOG_WRITE( "starting ICT test..." ); + + iIct = CIctsClientInterface::NewL( iIapId, iNetId, *this ); + LOG_WRITE( "ICT created" ); + iIct->StartL(); + LOG_WRITE( "ICT: started" ); + } + + +// ---------------------------------------------------------------------------- +// CWsfIct::InitializeIctL +// ---------------------------------------------------------------------------- +// +void CWsfIct::InitializeIctL( TBool aTestAccessPoint, + TUint aIapId, + TBool aConnectOnly ) + { + LOG_ENTERFN( "CWsfIct::InitializeIct" ); + + LOG_WRITEF( "IAP id = %d aTestAccessPoint = %d aConnectOnly = %d", + aIapId, aTestAccessPoint, aConnectOnly ); + + if ( !aIapId || !aTestAccessPoint ) + { + // the wlaninfo must already contain a valid IAP id + // and check that IAP needs testing + LOG_WRITE( "ICT not initialized" ); + iConnectOnly = EFalse; + iIapId = 0; + iNetId = 0; + return; + } + + // set variables + iConnectOnly = aConnectOnly; + iIapId = aIapId; + + if ( iIct ) + { + iIct->CancelStartL(); + delete iIct; + iIct = NULL; + } + + // get network Id + RCmManagerExt cmManager; + cmManager.OpenL(); + CleanupClosePushL(cmManager); + + RCmConnectionMethodExt cm = cmManager.ConnectionMethodL(iIapId); + CleanupClosePushL(cm); + + iNetId = cm.GetIntAttributeL(CMManager::ECmNetworkId); + + LOG_WRITEF( "Network Id=%d ", iNetId ); + + CleanupStack::PopAndDestroy(&cm); + CleanupStack::PopAndDestroy(&cmManager); + } + +// End of file + diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/src/wsfsession.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfsession.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfsession.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -590,8 +590,9 @@ { LOG_ENTERFN( "CWsfSession::ConnectWlanL" ); TUint32 iapId( aMessage.Int1() ); - TWsfIapPersistence persistence( TWsfIapPersistence( aMessage.Int2() ) ); - TPckgBuf p( iServer.Engine()->ConnectWlanL( iapId, persistence ) ); + TBool connectOnly( aMessage.Int2() ); + TWsfIapPersistence persistence( TWsfIapPersistence( aMessage.Int3() ) ); + TPckgBuf p( iServer.Engine()->ConnectWlanL( iapId, connectOnly, persistence ) ); aMessage.WriteL( 0, p ); } diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -39,6 +39,7 @@ #include "wsfactivewaiter.h" #include "wsfservercloseradapter.h" #include "wsfcommon.h" +#include "wsfict.h" // LOCAL DEFINITIONS @@ -148,6 +149,8 @@ } delete iClientPoll; + + delete iIct; iCmMgr.Close(); } @@ -179,6 +182,7 @@ iCmMgr.OpenL(); iMonitor.ConnectL(); iClientPoll = CPeriodic::NewL( CActive::EPriorityLow ); + iIct = CWsfIct::NewL(); FindWlanBearerConnectedL(); } @@ -425,7 +429,9 @@ // CWsfWlanBearerConnectionMonitor::ConnectBearer // --------------------------------------------------------------------------- // -TInt CWsfWlanBearerConnectionMonitor::ConnectBearer( TUint32 aIapId ) +TInt CWsfWlanBearerConnectionMonitor::ConnectBearer( TUint32 aIapId, + TBool aConnectOnly, + TBool aTestAccessPoint ) { LOG_ENTERFN( "CWsfWlanBearerConnectionMonitor::ConnectBearer" ); @@ -445,6 +451,13 @@ iConnectionOwned = ETrue; iServerCloser.WaitForOwnedConnection( ETrue ); + TRAPD( err, iIct->InitializeIctL( aTestAccessPoint, aIapId, + aConnectOnly ) ); + if ( err ) + { + LOG_WRITEF( "Ict initialization failed error = %d", err ); + } + SetActive(); TRequestStatus* status = &iStatus; User::RequestComplete( status, KErrNone ); @@ -1069,10 +1082,16 @@ TCallBack( CheckClientCount, this ) ); LOG_WRITE( "connection client polling started" ); - + // notify observers of the connection name iObserver->ConnectionEstablishedL( iWlanNetworkName ); + TRAPD( err, iIct->TestConnectedAccessPointL( iConnIap ) ); + if ( err ) + { + LOG_WRITEF( "Ict start failed error = %d", err ); + } + iConnectingState = ECsConnected; break; } diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -159,6 +159,7 @@ LOG_ENTERFN( "CWsfWlanScanner::DoCancel" ); iTimer.Cancel(); #ifndef __WINS__ + iWlanMgmtClient->CancelGetAvailableIaps(); iWlanMgmtClient->CancelGetScanResults(); #endif iScanState = EIdle; @@ -176,8 +177,8 @@ /* * Scan logic * 1. Get available IAPs - state = EIdle - * 2. Do broadcast scan - state = EIdle - * 3. Process broadcast scan results - state = EBroadcastScan + * 2. Do broadcast scan - state = EBroadcastScan + * 3. Process broadcast scan results - state = EProcessBroadcastScan * 4. Do direct scans for remaining known networks * from step 2. Get available IAPs - state = EDirectScan * 5. Add connected network - state = EFinished @@ -186,7 +187,7 @@ if ( iScanState == EIdle ) { - LOG_WRITE( "broadcast scan phase" ); + LOG_WRITE( "Get available IAPs scan phase" ); // prepare things for direct scans PrepareDirectScan(); @@ -196,16 +197,46 @@ { iObserver->WlanScanStarted(); } - #ifndef __WINS__ // get available iaps // (this only shows iaps with security mode matching to scan results // and also finds hidden wlans for which an iap has been configured) iAvailableIaps.Reset(); - iWlanMgmtClient->GetAvailableIaps( iAvailableIaps ); + iWlanMgmtClient->GetAvailableIaps( iCacheLifetime, + iMaxDelay, + EFalse, + iStatus, + iAvailableIaps ); + SetActive(); +#else + // for testing + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); +#endif + iScanState = EBroadcastScan; + } - // do broadcast scan + else if ( iScanState == EBroadcastScan ) + { + LOG_WRITEF( "GetAvailableIaps returned iStatus=%d", iStatus.Int() ); + if ( iStatus.Int() ) + { + LOG_WRITE( "Error in getting available IAPs - leave" ); + User::Leave( iStatus.Int() ); + } + +#ifdef _DEBUG + for ( TInt i = 0; i < iAvailableIaps.Count(); ++i ) + { + LOG_WRITEF( "iAvailableIaps array index[%d] IapId[%d] rssi[%d]", i, + iAvailableIaps[i].iIapId, iAvailableIaps[i].iRssi ); + } +#endif + +#ifndef __WINS__ + // do broadcast scan iWlanMgmtClient->GetScanResults( iStatus, *iScanInfo ); SetActive(); #else @@ -213,12 +244,11 @@ SetActive(); TRequestStatus* status = &iStatus; User::RequestComplete( status, KErrNone ); -#endif - - iScanState = EBroadcastScan; +#endif + iScanState = EProcessBroadcastScan; } - else if ( iScanState == EBroadcastScan ) + else if ( iScanState == EProcessBroadcastScan ) { // process broadcast scan results DoScanForNetworksL(); @@ -354,6 +384,8 @@ iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iScanningInterval ) ); Cancel(); + iCacheLifetime = 0; + iMaxDelay = 0; SetActive(); } @@ -440,6 +472,7 @@ LOG_WRITE( "Info found" ); TWsfWlanInfo* temp = matchArray[0]; temp->iConnectionState = EConnected; + temp->iIapId = connectedInfo->iIapId; temp->iSsid.Copy( connectedSsidOrIap ); temp->iNetworkName.Zero(); } @@ -530,7 +563,7 @@ &Keap: &KNullDesC ); HBufC16 *ssid = TWsfWlanInfo::GetSsidAsUnicodeLC( wi->iSsid ); - LOG_WRITEF( "[%S] %S %S %S", ssid, sm, psk, + LOG_WRITEF( "[%S] IapId=%d %S %S %S", ssid, wi->iIapId, sm, psk, wi->iVisibility? &KNullDesC: &Khidden ); CleanupStack::PopAndDestroy( ssid ); } @@ -565,6 +598,8 @@ iTimer.Cancel(); iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iScanningInterval ) ); + iCacheLifetime = 0; + iMaxDelay = 0; SetActive(); } @@ -604,6 +639,8 @@ if ( !iShowAvailability ) { // in case show wlan availability is off, carry out a scan now + iCacheLifetime = 0; + iMaxDelay = 0; SetActive(); TRequestStatus* status = &iStatus; User::RequestComplete( status, KErrNone ); @@ -653,7 +690,8 @@ // we have been waiting for the timer to complete // cancel it manually Cancel(); - + iCacheLifetime = 0; + iMaxDelay = 0; // then complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -684,6 +722,8 @@ // still, life goes on iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iScanningInterval ) ); + iCacheLifetime = 0; + iMaxDelay = 0; SetActive(); } } @@ -710,6 +750,8 @@ LOG_ENTERFN( "CWsfWlanScanner::BssidChanged" ); if ( iScanState == EIdle && !IsActive() ) { + iCacheLifetime = -1; + iMaxDelay = 0; // complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -727,6 +769,8 @@ LOG_ENTERFN( "CWsfWlanScanner::BssLost" ); if ( iScanState == EIdle && !IsActive() ) { + iCacheLifetime = -1; + iMaxDelay = 0; // complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -744,6 +788,8 @@ LOG_ENTERFN( "CWsfWlanScanner::BssRegained" ); if ( iScanState == EIdle && !IsActive() ) { + iCacheLifetime = -1; + iMaxDelay = 0; // complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -761,6 +807,8 @@ LOG_ENTERFN( "CWsfWlanScanner::NewNetworksDetected" ); if ( iScanState == EIdle && !IsActive() ) { + iCacheLifetime = -1; + iMaxDelay = 0; // complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -778,6 +826,8 @@ LOG_ENTERFN( "CWsfWlanScanner::OldNetworksLost" ); if ( iScanState == EIdle && !IsActive() ) { + iCacheLifetime = -1; + iMaxDelay = 0; // complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -795,6 +845,8 @@ LOG_ENTERFN( "CWsfWlanScanner::TransmitPowerChanged" ); if ( iScanState == EIdle && !IsActive() ) { + iCacheLifetime = -1; + iMaxDelay = 0; // complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -812,6 +864,8 @@ LOG_ENTERFN( "CWsfWlanScanner::RssChanged" ); if ( iScanState == EIdle && !IsActive() ) { + iCacheLifetime = -1; + iMaxDelay = 0; // complete ourselves SetActive(); TRequestStatus* status = &iStatus; @@ -957,12 +1011,13 @@ // start by making sure the scan array is empty iScanArray->Reset(); - LOG_WRITEF( "GetScanResults returned %d", iStatus.Int() ); + LOG_WRITEF( "GetScanResults returned iStatus=%d", iStatus.Int() ); if ( iStatus.Int() ) { // if the status is not KErrNone, we cannot be sure that iScanInfo // doesn't cause a crash, so it's better to leave + LOG_WRITE( "Error in getting scan result - leave" ); User::Leave( iStatus.Int() ); } @@ -978,7 +1033,7 @@ TBool addToArray( ETrue ); TWsfWlanInfo* availableInfo = new ( ELeave ) TWsfWlanInfo(); CleanupStack::PushL( availableInfo ); - availableInfo->iIapId = iAvailableIaps[i]; + availableInfo->iIapId = iAvailableIaps[i].iIapId; TRAPD( error, GetWlanInfoFromIapL( *availableInfo ) ); if ( error == KErrNotFound ) @@ -997,7 +1052,7 @@ LOG_WRITE( "Add to array" ); availableInfo->iCoverage = 0; availableInfo->iVisibility = 1; - availableInfo->iStrengthLevel = EWlanSignalUnavailable; + availableInfo->iStrengthLevel = iAvailableIaps[i].iRssi; availableInfo->iTransferRate = 0; availableInfo->iConnectionState = ENotConnected; iScanArray->AppendL(availableInfo); @@ -1005,7 +1060,8 @@ if ( availableInfo->iIapId ) { - LOG_WRITEF( "Append available iap [%d] for direct scan", availableInfo->iIapId ); + LOG_WRITEF( "Append available iap[%d] rssi[%d] for direct scan", + availableInfo->iIapId, availableInfo->iStrengthLevel ); iDirectScanIapIDs.Append( availableInfo->iIapId ); iDirectScanSsids.Append( availableInfo->iSsid ); } @@ -1018,6 +1074,11 @@ CleanupStack::PopAndDestroy( availableInfo ); } } + +#ifdef _DEBUG + LOG_WRITE( "Dump scan results - available IAPs" ); + DumpScanResultsL( iScanArray ); +#endif // Process the scanned results for( iScanInfo->First(); !iScanInfo->IsDone(); iScanInfo->Next() ) @@ -1353,6 +1414,7 @@ void CWsfWlanScanner::GetWlanInfoFromIapL( TWsfWlanInfo& aWlanInfo ) { LOG_ENTERFN( "CWsfWlanScanner::GetWlanInfoFromIapL" ); + LOG_WRITEF( "Iap Id = %d", aWlanInfo.iIapId ); CCommsDatabase* commsDb = CCommsDatabase::NewL(); CleanupStack::PushL( commsDb ); @@ -1391,6 +1453,12 @@ // Map Wpa2 to Wpa secMode = ( secMode == EWlanSecModeWpa2 )? EWlanSecModeWpa : secMode; aWlanInfo.iSecurityMode = static_cast(secMode); + + TUint32 usePsk(0); + TRAP_IGNORE( wlanTableView->ReadUintL(TPtrC( WLAN_ENABLE_WPA_PSK ), + usePsk ) ); + + aWlanInfo.SetUsesPreSharedKey( usePsk ); // net mode TUint32 netMode(0); @@ -1862,6 +1930,8 @@ } iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iScanningInterval ) ); + iCacheLifetime = 0; + iMaxDelay = 0; SetActive(); } } @@ -1879,6 +1949,8 @@ Cancel(); iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iScanningInterval ) ); + iCacheLifetime = 0; + iMaxDelay = 0; SetActive(); } } diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/mainapplication/data/wlansniffer.rss --- a/wlanutilities/wlansniffer/mainapplication/data/wlansniffer.rss Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/mainapplication/data/wlansniffer.rss Mon Jun 21 16:55:05 2010 +0300 @@ -567,8 +567,8 @@ listtype = EAknCtSingleHeadingPopupMenuListBox; listbox = AVKON_LIST_QUERY_LIST { - flags = EAknListBoxMenuList | - EAknListBoxDisableHighlight; + flags = EAknListBoxDisableItemSpecificMenu | + EAknListBoxViewerFlag; }; heading = qtn_wlan_heading_connection_details; }; diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/mainapplication/src/wsfdetailscontainer.cpp --- a/wlanutilities/wlansniffer/mainapplication/src/wsfdetailscontainer.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/mainapplication/src/wsfdetailscontainer.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -94,7 +94,7 @@ iListBox = new( ELeave ) CAknSingleHeadingStyleListBox; iListBox->SetContainerWindowL( *this ); TInt flags = 0; - flags |= EAknListBoxViewerFlags; + flags |= EAknListBoxViewerFlags | EAknListBoxDisableItemSpecificMenu; iListBox->ConstructL( this, flags ); iListBox->CreateScrollBarFrameL( ETrue ); iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp --- a/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -350,6 +350,7 @@ if ( temp ) { temp->iConnectionState = EConnected; + temp->iIapId = info.iIapId; iInfoArray->SortArrayL(); UpdateViewL( iInfoArray ); } @@ -476,26 +477,31 @@ TInt result( KErrNone ); + TWsfIapPersistence persistence = EIapPersistent; + if ( !info.Known() && !info.Connected() ) { // if not known yet, create an IAP if ( iModel->CreateAccessPointL( info, EFalse ) ) { + persistence = EIapExpireOnDisconnect; // update iapID to list UpdateIapIdToInfoArrayL( info ); - - // on success, test it and save it as well - result = iModel->TestAccessPointL( info, ETrue, EFalse ); } else { result = KErrGeneral; } } - else if ( info.iIapId && !info.Connected() ) + + if ( info.iIapId && !info.Connected() ) { // hopefully we have a valid IAP id inside - result = iModel->ConnectL( info.iIapId ); + result = iModel->ConnectL( info.iIapId, EFalse, persistence ); + } + else if ( !info.Connected() ) + { + result = KErrGeneral; } // pop cleanup item ReleaseSuppressingKeyEvents @@ -562,28 +568,24 @@ CleanupStack::PopAndDestroy(); return; } + + TWsfIapPersistence persistence = EIapPersistent; if ( !info.Known() ) { // a new access point needs to be created if ( iModel->CreateAccessPointL( info, EFalse ) ) { + persistence = EIapExpireOnDisconnect; // update iapID to list UpdateIapIdToInfoArrayL( info ); - - // on success, test it and save it as well - // (testing actually creates the connection) - if ( iModel->TestAccessPointL( info, ETrue, ETrue ) == KErrCancel ) - { - // connection creation was cancelled, refresh the view - iModel->RefreshScanL(); - } } } - else if ( info.iIapId ) + + if ( info.iIapId ) { // hopefully we have a valid IAP id inside - iModel->ConnectL( info.iIapId ); + iModel->ConnectL( info.iIapId, ETrue, persistence ); } // pop cleanup item ReleaseSuppressingKeyEvents diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/model/bwins/wsfmodelu.def --- a/wlanutilities/wlansniffer/model/bwins/wsfmodelu.def Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/model/bwins/wsfmodelu.def Mon Jun 21 16:55:05 2010 +0300 @@ -9,36 +9,33 @@ ?SetRefreshState@CWsfModel@@QAEXH@Z @ 8 NONAME ; void CWsfModel::SetRefreshState(int) ?RefreshScan@CWsfModel@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 9 NONAME ; void CWsfModel::RefreshScan(class TPckgBuf &, class TRequestStatus &) ?SetEngineObserver@CWsfModel@@QAEXPAVMWsfModelObserver@@@Z @ 10 NONAME ; void CWsfModel::SetEngineObserver(class MWsfModelObserver *) - ?ConnectL@CWsfModel@@QAEHK@Z @ 11 NONAME ; int CWsfModel::ConnectL(unsigned long) - ?CheckIsIapIdValidL@CWsfModel@@QBEXI@Z @ 12 NONAME ; void CWsfModel::CheckIsIapIdValidL(unsigned int) const + ?CheckIsIapIdValidL@CWsfModel@@QBEXI@Z @ 11 NONAME ; void CWsfModel::CheckIsIapIdValidL(unsigned int) const + ?ConnectL@CWsfModel@@QAEXAAV?$TPckgBuf@H@@KHW4TWsfIapPersistence@@AAVTRequestStatus@@@Z @ 12 NONAME ; void CWsfModel::ConnectL(class TPckgBuf &, unsigned long, int, enum TWsfIapPersistence, class TRequestStatus &) ?SetActiveViewL@CWsfModel@@QAEXH@Z @ 13 NONAME ; void CWsfModel::SetActiveViewL(int) ?NewLC@CWsfModel@@SAPAV1@AAVMWsfStateChangeObserver@@H@Z @ 14 NONAME ; class CWsfModel * CWsfModel::NewLC(class MWsfStateChangeObserver &, int) ?IsScanEnabledL@CWsfModel@@QAEHXZ @ 15 NONAME ; int CWsfModel::IsScanEnabledL(void) ?SetConnectResultL@CWsfModel@@QAEXHI@Z @ 16 NONAME ; void CWsfModel::SetConnectResultL(int, unsigned int) ?AbortScanningL@CWsfModel@@QAEXXZ @ 17 NONAME ; void CWsfModel::AbortScanningL(void) - ?TestAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@HH@Z @ 18 NONAME ; int CWsfModel::TestAccessPointL(class TWsfWlanInfo &, int, int) - ?CancelNotifyEvents@CWsfModel@@QAEXXZ @ 19 NONAME ; void CWsfModel::CancelNotifyEvents(void) - ??1CWsfModel@@UAE@XZ @ 20 NONAME ; CWsfModel::~CWsfModel(void) - ?GetWlanListL@CWsfModel@@QAEPAVCWsfWlanInfoArray@@XZ @ 21 NONAME ; class CWsfWlanInfoArray * CWsfModel::GetWlanListL(void) - ?DisableScanL@CWsfModel@@QAEHXZ @ 22 NONAME ; int CWsfModel::DisableScanL(void) - ?GetConnectedWlanDetailsL@CWsfModel@@QAEHAAVTWsfWlanInfo@@@Z @ 23 NONAME ; int CWsfModel::GetConnectedWlanDetailsL(class TWsfWlanInfo &) - ?GetWlanListSize@CWsfModel@@QAEXAAV?$TPckgBuf@I@@AAVTRequestStatus@@@Z @ 24 NONAME ; void CWsfModel::GetWlanListSize(class TPckgBuf &, class TRequestStatus &) - ?ConnectL@CWsfModel@@QAEXAAV?$TPckgBuf@H@@KW4TWsfIapPersistence@@AAVTRequestStatus@@@Z @ 25 NONAME ; void CWsfModel::ConnectL(class TPckgBuf &, unsigned long, enum TWsfIapPersistence, class TRequestStatus &) - ?NewL@CWsfModel@@SAPAV1@AAVMWsfStateChangeObserver@@H@Z @ 26 NONAME ; class CWsfModel * CWsfModel::NewL(class MWsfStateChangeObserver &, int) - ?Refreshing@CWsfModel@@QAEHXZ @ 27 NONAME ; int CWsfModel::Refreshing(void) - ?ContinueBrowsingL@CWsfModel@@QAEXK@Z @ 28 NONAME ; void CWsfModel::ContinueBrowsingL(unsigned long) - ?IctsTestPermission@CWsfModel@@SAHXZ @ 29 NONAME ; int CWsfModel::IctsTestPermission(void) - ?DisconnectL@CWsfModel@@QAEXXZ @ 30 NONAME ; void CWsfModel::DisconnectL(void) - ?IsConnectedL@CWsfModel@@QAEHXZ @ 31 NONAME ; int CWsfModel::IsConnectedL(void) - ?CreateAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@H@Z @ 32 NONAME ; int CWsfModel::CreateAccessPointL(class TWsfWlanInfo &, int) - ?TestConnectedAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@H@Z @ 33 NONAME ; int CWsfModel::TestConnectedAccessPointL(class TWsfWlanInfo &, int) - ?NewLC@CWsfAppLauncher@@SAPAV1@XZ @ 34 NONAME ; class CWsfAppLauncher * CWsfAppLauncher::NewLC(void) - ?RequestNotifyEventsL@CWsfModel@@QAEXAAVMWsfStateChangeObserver@@@Z @ 35 NONAME ; void CWsfModel::RequestNotifyEventsL(class MWsfStateChangeObserver &) - ?GetWlanList@CWsfModel@@QAEXAAV?$TPckgBuf@I@@AAVTPtr8@@AAVTRequestStatus@@@Z @ 36 NONAME ; void CWsfModel::GetWlanList(class TPckgBuf &, class TPtr8 &, class TRequestStatus &) - ?LaunchBrowserL@CWsfModel@@UAEXK@Z @ 37 NONAME ; void CWsfModel::LaunchBrowserL(unsigned long) - ?LaunchHelperApplicationL@CWsfModel@@QAEXAAVTWsfWlanInfo@@@Z @ 38 NONAME ; void CWsfModel::LaunchHelperApplicationL(class TWsfWlanInfo &) - ?RefreshScanL@CWsfModel@@QAEHXZ @ 39 NONAME ; int CWsfModel::RefreshScanL(void) - ?Disconnect@CWsfModel@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 40 NONAME ; void CWsfModel::Disconnect(class TPckgBuf &, class TRequestStatus &) - ?SetObservedWlanL@CWsfModel@@QAEXABVTDesC8@@@Z @ 41 NONAME ; void CWsfModel::SetObservedWlanL(class TDesC8 const &) - ?CloseHelperApplication@CWsfModel@@QAEHXZ @ 42 NONAME ; int CWsfModel::CloseHelperApplication(void) + ?CancelNotifyEvents@CWsfModel@@QAEXXZ @ 18 NONAME ; void CWsfModel::CancelNotifyEvents(void) + ??1CWsfModel@@UAE@XZ @ 19 NONAME ; CWsfModel::~CWsfModel(void) + ?GetWlanListL@CWsfModel@@QAEPAVCWsfWlanInfoArray@@XZ @ 20 NONAME ; class CWsfWlanInfoArray * CWsfModel::GetWlanListL(void) + ?DisableScanL@CWsfModel@@QAEHXZ @ 21 NONAME ; int CWsfModel::DisableScanL(void) + ?GetConnectedWlanDetailsL@CWsfModel@@QAEHAAVTWsfWlanInfo@@@Z @ 22 NONAME ; int CWsfModel::GetConnectedWlanDetailsL(class TWsfWlanInfo &) + ?GetWlanListSize@CWsfModel@@QAEXAAV?$TPckgBuf@I@@AAVTRequestStatus@@@Z @ 23 NONAME ; void CWsfModel::GetWlanListSize(class TPckgBuf &, class TRequestStatus &) + ?NewL@CWsfModel@@SAPAV1@AAVMWsfStateChangeObserver@@H@Z @ 24 NONAME ; class CWsfModel * CWsfModel::NewL(class MWsfStateChangeObserver &, int) + ?Refreshing@CWsfModel@@QAEHXZ @ 25 NONAME ; int CWsfModel::Refreshing(void) + ?ContinueBrowsingL@CWsfModel@@QAEXK@Z @ 26 NONAME ; void CWsfModel::ContinueBrowsingL(unsigned long) + ?DisconnectL@CWsfModel@@QAEXXZ @ 27 NONAME ; void CWsfModel::DisconnectL(void) + ?IsConnectedL@CWsfModel@@QAEHXZ @ 28 NONAME ; int CWsfModel::IsConnectedL(void) + ?CreateAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@H@Z @ 29 NONAME ; int CWsfModel::CreateAccessPointL(class TWsfWlanInfo &, int) + ?NewLC@CWsfAppLauncher@@SAPAV1@XZ @ 30 NONAME ; class CWsfAppLauncher * CWsfAppLauncher::NewLC(void) + ?RequestNotifyEventsL@CWsfModel@@QAEXAAVMWsfStateChangeObserver@@@Z @ 31 NONAME ; void CWsfModel::RequestNotifyEventsL(class MWsfStateChangeObserver &) + ?GetWlanList@CWsfModel@@QAEXAAV?$TPckgBuf@I@@AAVTPtr8@@AAVTRequestStatus@@@Z @ 32 NONAME ; void CWsfModel::GetWlanList(class TPckgBuf &, class TPtr8 &, class TRequestStatus &) + ?LaunchBrowserL@CWsfModel@@UAEXK@Z @ 33 NONAME ; void CWsfModel::LaunchBrowserL(unsigned long) + ?LaunchHelperApplicationL@CWsfModel@@QAEXAAVTWsfWlanInfo@@@Z @ 34 NONAME ; void CWsfModel::LaunchHelperApplicationL(class TWsfWlanInfo &) + ?RefreshScanL@CWsfModel@@QAEHXZ @ 35 NONAME ; int CWsfModel::RefreshScanL(void) + ?Disconnect@CWsfModel@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 36 NONAME ; void CWsfModel::Disconnect(class TPckgBuf &, class TRequestStatus &) + ?SetObservedWlanL@CWsfModel@@QAEXABVTDesC8@@@Z @ 37 NONAME ; void CWsfModel::SetObservedWlanL(class TDesC8 const &) + ?CloseHelperApplication@CWsfModel@@QAEHXZ @ 38 NONAME ; int CWsfModel::CloseHelperApplication(void) + ?ConnectL@CWsfModel@@QAEHKHW4TWsfIapPersistence@@@Z @ 39 NONAME ; int CWsfModel::ConnectL(unsigned long, int, enum TWsfIapPersistence) diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/model/eabi/wsfmodelu.def --- a/wlanutilities/wlansniffer/model/eabi/wsfmodelu.def Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/model/eabi/wsfmodelu.def Mon Jun 21 16:55:05 2010 +0300 @@ -21,27 +21,24 @@ _ZN9CWsfModel15SetRefreshStateEi @ 20 NONAME _ZN9CWsfModel16AbortConnectingLEv @ 21 NONAME _ZN9CWsfModel16SetObservedWlanLERK6TDesC8 @ 22 NONAME - _ZN9CWsfModel16TestAccessPointLER12TWsfWlanInfoii @ 23 NONAME - _ZN9CWsfModel17ContinueBrowsingLEm @ 24 NONAME - _ZN9CWsfModel17ContinueBrowsingLEv @ 25 NONAME - _ZN9CWsfModel17SetConnectResultLEij @ 26 NONAME - _ZN9CWsfModel17SetEngineObserverEP17MWsfModelObserver @ 27 NONAME - _ZN9CWsfModel18CancelNotifyEventsEv @ 28 NONAME - _ZN9CWsfModel18CreateAccessPointLER12TWsfWlanInfoi @ 29 NONAME - _ZN9CWsfModel18IctsTestPermissionEv @ 30 NONAME - _ZN9CWsfModel20RequestNotifyEventsLER23MWsfStateChangeObserver @ 31 NONAME - _ZN9CWsfModel22CloseHelperApplicationEv @ 32 NONAME - _ZN9CWsfModel23GetConnectedWlanDetailsER8TPckgBufIiER12TWsfWlanInfoR14TRequestStatus @ 33 NONAME - _ZN9CWsfModel24GetConnectedWlanDetailsLER12TWsfWlanInfo @ 34 NONAME - _ZN9CWsfModel24LaunchHelperApplicationLER12TWsfWlanInfo @ 35 NONAME - _ZN9CWsfModel25TestConnectedAccessPointLER12TWsfWlanInfoi @ 36 NONAME - _ZN9CWsfModel4NewLER23MWsfStateChangeObserveri @ 37 NONAME - _ZN9CWsfModel5NewLCER23MWsfStateChangeObserveri @ 38 NONAME - _ZN9CWsfModel8ConnectLER8TPckgBufIiEm18TWsfIapPersistenceR14TRequestStatus @ 39 NONAME - _ZN9CWsfModel8ConnectLEm @ 40 NONAME - _ZN9CWsfModelD0Ev @ 41 NONAME - _ZN9CWsfModelD1Ev @ 42 NONAME - _ZN9CWsfModelD2Ev @ 43 NONAME - _ZNK9CWsfModel18CheckIsIapIdValidLEj @ 44 NONAME - _ZThn12_N9CWsfModel14LaunchBrowserLEm @ 45 NONAME + _ZN9CWsfModel17ContinueBrowsingLEm @ 23 NONAME + _ZN9CWsfModel17ContinueBrowsingLEv @ 24 NONAME + _ZN9CWsfModel17SetConnectResultLEij @ 25 NONAME + _ZN9CWsfModel17SetEngineObserverEP17MWsfModelObserver @ 26 NONAME + _ZN9CWsfModel18CancelNotifyEventsEv @ 27 NONAME + _ZN9CWsfModel18CreateAccessPointLER12TWsfWlanInfoi @ 28 NONAME + _ZN9CWsfModel20RequestNotifyEventsLER23MWsfStateChangeObserver @ 29 NONAME + _ZN9CWsfModel22CloseHelperApplicationEv @ 30 NONAME + _ZN9CWsfModel23GetConnectedWlanDetailsER8TPckgBufIiER12TWsfWlanInfoR14TRequestStatus @ 31 NONAME + _ZN9CWsfModel24GetConnectedWlanDetailsLER12TWsfWlanInfo @ 32 NONAME + _ZN9CWsfModel24LaunchHelperApplicationLER12TWsfWlanInfo @ 33 NONAME + _ZN9CWsfModel4NewLER23MWsfStateChangeObserveri @ 34 NONAME + _ZN9CWsfModel5NewLCER23MWsfStateChangeObserveri @ 35 NONAME + _ZN9CWsfModel8ConnectLER8TPckgBufIiEmi18TWsfIapPersistenceR14TRequestStatus @ 36 NONAME + _ZN9CWsfModel8ConnectLEmi18TWsfIapPersistence @ 37 NONAME + _ZN9CWsfModelD0Ev @ 38 NONAME + _ZN9CWsfModelD1Ev @ 39 NONAME + _ZN9CWsfModelD2Ev @ 40 NONAME + _ZNK9CWsfModel18CheckIsIapIdValidLEj @ 41 NONAME + _ZThn12_N9CWsfModel14LaunchBrowserLEm @ 42 NONAME diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/model/group/model.mmp --- a/wlanutilities/wlansniffer/model/group/model.mmp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/model/group/model.mmp Mon Jun 21 16:55:05 2010 +0300 @@ -64,7 +64,6 @@ LIBRARY centralrepository.lib LIBRARY cmmanager.lib LIBRARY cmmanagerdatabase.lib -LIBRARY ictsclientinterface.lib LIBRARY sysutil.lib LIBRARY efsrv.lib diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/model/inc/wsfmodel.h --- a/wlanutilities/wlansniffer/model/inc/wsfmodel.h Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/model/inc/wsfmodel.h Mon Jun 21 16:55:05 2010 +0300 @@ -23,7 +23,6 @@ // EXTERNAL INCLUDES #include -#include // INTERNAL INCLUDES #include "wsfsession.h" @@ -54,8 +53,7 @@ NONSHARABLE_CLASS( CWsfModel ): public CBase, public MWsfBrowserLaunchObserver, public MWsfScreenSaverStateObserver, - public MWsfBrowserLaunchAdapter, - public MIctsObserver + public MWsfBrowserLaunchAdapter { public: // Constructors and destructor @@ -162,21 +160,27 @@ * Connects to the given WLAN IAP * @since S60 5.0 * @param aIapId WLAN IAP id to connect to. + * @param aConnectOnly ETrue if Connect selected + * @param aPersistence The value of the persistence property */ - IMPORT_C int ConnectL( TUint32 aIapId ); + IMPORT_C int ConnectL( TUint32 aIapId, + TBool aConnectOnly, + TWsfIapPersistence aPersistence ); /** * Asyncronous request to the server to connect to the given WLAN IAP * @since S60 5.2 * @param aPckg request result * @param aIapId WLAN IAP id to connect to. + * @param aConnectOnly ETrue if Connect selected * @param aPersistence The value of the persistence property * @param aStatus The request status object used to contain * the completion status of the request. */ - IMPORT_C void ConnectL( TPckgBuf& aPckg, TUint32 aIapId, - TWsfIapPersistence aPersistence, - TRequestStatus& aStatus ); + IMPORT_C void ConnectL( TPckgBuf& aPckg, TUint32 aIapId, + TBool aConnectOnly, + TWsfIapPersistence aPersistence, + TRequestStatus& aStatus ); /** * Sets connection result @@ -268,31 +272,6 @@ TBool aExplicitDefine ); /** - * Tests the WLAN access point and offers to save it to a destination - * @since S60 5.0 - * @param aWlan Reference to wlaninfo to test - * @param aKeepConnection Indicates whether to keep alive the connection. - * @param aConnectOnly ETrue if the helper app is expected to connect - * only, EFalse if it should also launch the browser - * on successful connection. - * @return KErrNone if successful, system-wide error code otherwise - */ - IMPORT_C TInt TestAccessPointL( TWsfWlanInfo& aWlan, - TBool aKeepConnection, - TBool aConnectOnly ); - - /** - * Tests the connected WLAN access point - * @since S60 5.0 - * @param aWlan Reference to wlaninfo to test - * @param aConnectOnly ETrue if connect only case, - * EFalse if launch browser case after successful connection. - * @return KErrNone if successful, system-wide error code otherwise - */ - IMPORT_C TInt TestConnectedAccessPointL( TWsfWlanInfo& aWlan, - TBool aConnectOnly ); - - /** * Requests a rescan for available wlans * @since S60 5.0 * @return ETrue on success @@ -390,13 +369,6 @@ * @since S60 5.0 */ IMPORT_C void AbortScanningL(); - - /** - * Gets the ICTS test permission setting value - * @since S60 5.0 - * @return The ICTS setting - */ - IMPORT_C static TInt IctsTestPermission(); /** * Check if Iap Id is valid @@ -446,42 +418,11 @@ * @param aScreenSaverActive Current status of the screensaver */ void ScreenSaverStatusChangedL( const TBool aScreenSaverActive ); - - - public: // from MIctsObserver - - /** - * Called by ICTS during/after connectivity test - * @since S60 5.0 - * @param aResult Result code of the connectivity test - * @param aString Parameter to hold auxiliary data - */ - void ConnectivityObserver( TIctsTestResult aResult, const TDesC& aString ); - + private: // New methods /** - * Starts WLAN Login application - * @param aString Contains redirect URL - */ - void LaunchWlanLoginL( const TDesC& aString ); - - /** - * Makes the temporary IAP created for ICT persistent, i.e. notifies - * the server not to delete it when the connection terminates. - * @since S60 5.0 - * @param aPersistence The persistence property for the IAP - */ - void MakeIctIapPersistentL( TWsfIapPersistence aPersistence ); - - /** - * Moves the IAP to internet SNAP - * @param aIapId Id of the connection method - */ - void MoveToInternetSnapL( const TUint32 aIapId ); - - /** * Check if there is disk space left * Leaves with KErrDiskFull is space is below CL * @since S60 5.0 @@ -542,11 +483,6 @@ * Id of currently connected IAP (if applicable) */ TUint iConnectedIapId; - - /** - * Network id of currently connected IAP (if applicable) - */ - TUint iConnectedNetId; /** * Refreshing status @@ -554,40 +490,10 @@ TBool iRefreshing; /** - * Persistent WlanInfo for ICT cleanup - */ - TWsfWlanInfo iIctWlanInfo; - - /** * Indicates whether connection creation has been started but not * finished yet. */ TBool iConnecting; - - /** - * Waiter for ICT - */ - CActiveSchedulerWait iIctWait; - - /** - * Indicates that connectivity test if over. - */ - TBool iIctEnded; - - /** - * Indicates if connection will be kept when launching browser. - */ - TBool iKeepConnection; - - /** - * Indicates if "Connect" or "Start Web browsing" is selected. - */ - TBool iConnectOnly; - - /** - * ICT class. Owned. - */ - CIctsClientInterface* iIct; }; diff -r aaabc7526ded -r a9524956f6b5 wlanutilities/wlansniffer/model/src/wsfmodel.cpp --- a/wlanutilities/wlansniffer/model/src/wsfmodel.cpp Wed Jun 09 10:53:40 2010 +0300 +++ b/wlanutilities/wlansniffer/model/src/wsfmodel.cpp Mon Jun 21 16:55:05 2010 +0300 @@ -52,12 +52,6 @@ static const TUid KHelperApUid = { 0x10281CEB }; /** -* UID of Wlan Login application (hsbrowser) -* used when launching WLAN Login application -*/ -static const TInt KBrowserUid = { 0x2000AFCC }; - -/** * Estimated overhead for access point creation */ const TInt KEstimatedOverhead = 8192; @@ -97,18 +91,6 @@ EXPORT_C CWsfModel::~CWsfModel() { LOG_ENTERFN( "CWsfModel::~CWsfModel" ); - if ( iIct ) - { - LOG_WRITE( "ict cancel" ); - TRAP_IGNORE( iIct->CancelStartL() ); - delete iIct; - iIct = NULL; - } - if ( iIctWait.IsStarted() ) - { - LOG_WRITE( "ict wait cancel" ); - iIctWait.AsyncStop(); - } iSession.CancelNotifyEvent(); iSession.Close(); delete iScreenSaverWatcher; @@ -124,10 +106,7 @@ // CWsfModel::CWsfModel(): iEikEnv( CEikonEnv::Static() ), - iRefreshing( EFalse ), - iIctEnded( EFalse ), - iKeepConnection( EFalse ), - iConnectOnly( EFalse ) + iRefreshing( EFalse ) { } @@ -246,7 +225,8 @@ // CWsfModel::ConnectL // ---------------------------------------------------------------------------- // -EXPORT_C int CWsfModel::ConnectL( TUint32 aIapId ) +EXPORT_C int CWsfModel::ConnectL( TUint32 aIapId, TBool aConnectOnly, + TWsfIapPersistence aPersistence ) { LOG_ENTERFN( "CWsfModel::ConnectL" ); @@ -255,7 +235,7 @@ iObserver->ConnectingL( aIapId ); } - TInt err = iSession.ConnectWlanBearerL( aIapId, EIapPersistent ); + TInt err = iSession.ConnectWlanBearerL( aIapId, aConnectOnly, aPersistence ); if ( err == KErrNone ) { iConnectedIapId = aIapId; @@ -273,7 +253,7 @@ iObserver->ConnectingFinishedL( err ); } - iRefreshing = iSession.RequestScanL(); + iRefreshing = iSession.RequestScanL(); return err; } @@ -283,9 +263,10 @@ // CWsfModel::ConnectL // ---------------------------------------------------------------------------- // -EXPORT_C void CWsfModel::ConnectL( TPckgBuf& aPckg, TUint32 aIapId, - TWsfIapPersistence aPersistence, - TRequestStatus& aStatus ) +EXPORT_C void CWsfModel::ConnectL( TPckgBuf& aPckg, TUint32 aIapId, + TBool aConnectOnly, + TWsfIapPersistence aPersistence, + TRequestStatus& aStatus ) { LOG_ENTERFN( "CWsfModel::ConnectL" ); @@ -294,7 +275,7 @@ iObserver->ConnectingL( aIapId ); } - iSession.ConnectWlanBearer( aPckg, aIapId, aPersistence, aStatus ); + iSession.ConnectWlanBearer( aPckg, aIapId, aConnectOnly, aPersistence, aStatus ); } // ---------------------------------------------------------------------------- @@ -324,8 +305,6 @@ TBool disconnected = iSession.DisconnectWlanBearerL(); LOG_WRITEF( "disconnected = %d", disconnected ); iConnectedIapId = 0; - iConnectedNetId = 0; - iConnectOnly = EFalse; if ( !disconnected ) { iRefreshing = iSession.RequestScanL(); @@ -342,8 +321,6 @@ LOG_ENTERFN( "CWsfModel::Disconnect" ); iSession.DisconnectWlanBearer( aPckg, aStatus ); iConnectedIapId = 0; - iConnectedNetId = 0; - iConnectOnly = EFalse; } @@ -457,165 +434,6 @@ // ---------------------------------------------------------------------------- -// CWsfModel::ConnectivityObserver -// ---------------------------------------------------------------------------- -// -void CWsfModel::ConnectivityObserver( TIctsTestResult aResult, - const TDesC& aString ) - { - LOG_ENTERFN( "CWsfModel::ConnectivityObserver" ); - LOG_WRITEF( "ICTS result: %d", aResult ); - - TBool makePersistent( EFalse ); - // check the result - switch ( aResult ) - { - case EConnectionOk: - { - // test succeeded - TRAP_IGNORE( MoveToInternetSnapL( iConnectedIapId ) ); - makePersistent = ETrue; - LOG_WRITE( "ICT: EConnectionOk" ); - break; - } - - case EConnectionNotOk: - { - // test was run but it failed - LOG_WRITE( "ICT: EConnectionNotOk" ); - break; - } - case EHttpAuthenticationNeeded: - { - // test was run but HTTP authentication is required - LOG_WRITE( "ICT: EHttpAuthenticationNeeded" ); - if ( iConnectOnly ) - { - // Connect selected. WLAN Login needed. - TRAP_IGNORE( LaunchWlanLoginL(aString) ); - } - break; - } - case ETimeout: - { - LOG_WRITE( "ICT: ETimeout" ); - break; - } - - default: - { - _LIT( KIctPanic, "ICT result" ); - User::Panic( KIctPanic, aResult ); - } - } - - if ( makePersistent ) - { - TWsfIapPersistence pt = ( iConnectedIapId )? - EIapPersistent: - EIapExpireOnShutdown; - - TRAPD( err, MakeIctIapPersistentL( pt ) ); - if ( err ) - { - LOG_WRITEF( "MakeIctIapPersistentL leaved with error = %d", err ); - } - } - - LOG_WRITE( "before AsyncStop" ); - // finally stop blocking the caller - iIctEnded = ETrue; - if ( iIctWait.IsStarted() ) - { - LOG_WRITE( "ICT: AsyncStop" ); - iIctWait.AsyncStop(); - } - - } - -// ----------------------------------------------------------------------------- -// CWsfModel::LaunchWlanLoginL() -// ----------------------------------------------------------------------------- -// -void CWsfModel::LaunchWlanLoginL( const TDesC& aString ) - { - LOG_ENTERFN( "WsfModel::LaunchWlanLoginL" ); - HBufC* param = HBufC::NewLC( KMaxFileName ); - _LIT(tmpString, "%d, %d, %S"); - param->Des().Format( tmpString, - iConnectedIapId, - iConnectedNetId, - &aString ); - TUid uid( TUid::Uid( KBrowserUid ) ); - TThreadId id; - - RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL( appArcSession ); - - TInt err = appArcSession.StartDocument( *param, TUid::Uid( KBrowserUid ), id ); - if ( err != KErrNone ) - { - LOG_ENTERFN( "WsfModel::LaunchWlanLoginL failed" ); - } - CleanupStack::PopAndDestroy( &appArcSession ); - CleanupStack::PopAndDestroy( param ); - } - -// ---------------------------------------------------------------------------- -// CWsfModel::MakeIctIapPersistentL -// ---------------------------------------------------------------------------- -// -void CWsfModel::MakeIctIapPersistentL( TWsfIapPersistence aPersistence ) - { - LOG_ENTERFN( "CWsfModel::MakeIctIapPersistentL" ); - LOG_WRITEF( "temp ICT IAP id = %d", iIctWlanInfo.iIapId ); - - if ( !iSession.SetIapPersistenceL( aPersistence ) ) - { - LOG_WRITE( "setting temporary flag FAILED" ); - } - - } - -// ---------------------------------------------------------------------------- -// CWsfModel::MoveToInternetSnapL -// ---------------------------------------------------------------------------- -// -void CWsfModel::MoveToInternetSnapL( const TUint32 aIapId ) - { - LOG_ENTERFN( "CWsfModel::MoveToInternetSnapL" ); - // Read all destination(SNAP) settings into an array - RArray destinations; - CleanupClosePushL(destinations); - RCmManagerExt cmManager; - cmManager.OpenL(); - CleanupClosePushL( cmManager ); - cmManager.AllDestinationsL(destinations); - RCmDestinationExt destination; - // Loop through each destination - for(TInt i = 0; i < destinations.Count(); i++) - { - destination = cmManager.DestinationL(destinations[i]); - CleanupClosePushL(destination); - // Internet destination will always exist in the system. - // Internet destination will have ESnapPurposeInternet set in its metadata. - if (destination.MetadataL(CMManager::ESnapMetadataPurpose) == CMManager::ESnapPurposeInternet) - { - RCmConnectionMethodExt iap = cmManager.ConnectionMethodL( aIapId ); - CleanupClosePushL( iap ); - LOG_WRITE( "Move Iap to internet destination" ); - destination.AddConnectionMethodL( iap ); - destination.UpdateL(); - CleanupStack::PopAndDestroy( &iap ); - } - CleanupStack::PopAndDestroy( &destination ); - } - CleanupStack::PopAndDestroy( &cmManager ); - CleanupStack::PopAndDestroy( &destinations ); - } - -// ---------------------------------------------------------------------------- // CWsfModel::CreateAccessPointL // ---------------------------------------------------------------------------- // @@ -630,8 +448,7 @@ CheckSpaceBelowCriticalLevelL(); CheckUnknownWapiL( aWlan ); - -#pragma message("TODO: oursource UI to client interfaces!") + CWsfWlanIapWizard* iapWizard = CWsfWlanIapWizard::NewLC(); // the wlaninfo must be persistent to avoid nullpointer crashes due to @@ -667,233 +484,6 @@ // ---------------------------------------------------------------------------- -// CWsfModel::IctsTestPermission -// ---------------------------------------------------------------------------- -// -EXPORT_C TInt CWsfModel::IctsTestPermission() - { - LOG_ENTERFN( "CWsfModel::IctsTestPermission" ); - TInt ictTestPermission( 0 ); - CRepository* repository( NULL ); - - TRAPD( err, repository = CRepository::NewL( - KCRUidInternetConnectivitySettings ) ); - if ( err == KErrNone ) - { - repository->Get( KIctsTestPermission, ictTestPermission ); - delete repository; - LOG_WRITEF( "ICT is set to %d", ictTestPermission ); - } - return ictTestPermission; - } - - -// ---------------------------------------------------------------------------- -// CWsfModel::TestAccessPointL -// ---------------------------------------------------------------------------- -// -EXPORT_C TInt CWsfModel::TestAccessPointL( TWsfWlanInfo& aWlan, - TBool aKeepConnection, - TBool aConnectOnly ) - { - LOG_ENTERFN( "CWsfModel::TestAccessPointL" ); - TInt err( KErrNone ); - iKeepConnection = aKeepConnection; - iConnectOnly = aConnectOnly; - if ( !aWlan.iIapId ) - { - // the wlaninfo must already contain a valid IAP id - LOG_WRITE( "invalid IAP id" ); - return KErrCorrupt; - } - - // the wlaninfo must be persistent to avoid nullpointer crashes due to - // background refreshing - iIctWlanInfo = aWlan; - - // create connection and test connectivity if needed - - // check ICT settings - TInt ictTestPermission( IctsTestPermission() ); - - - if ( aKeepConnection || ictTestPermission != EIctsNeverRun ) - { - // make connection if Connect was selected or if ICT needs it - LOG_WRITE( "creating connection..." ); - if ( iObserver ) - { - iObserver->ConnectingL( iIctWlanInfo.iIapId ); - } - - // create the connection with temporary IAP by default - err = iSession.ConnectWlanBearerL( iIctWlanInfo.iIapId, - EIapExpireOnDisconnect ); - - if ( err == KErrNone ) - { - LOG_WRITE( "connection OK." ) - } - else - { - LOG_WRITEF( "connection creation failed with error = %d", err ); - // either the connection creation failed or was aborted, - // the server already cleaned up the mess, so nothing to do - } - - if ( iObserver ) - { - iObserver->ConnectingFinishedL( err ); - } - - } - - if ( err == KErrNone && ictTestPermission != EIctsNeverRun ) - { - // do the connectivity test - iConnectedIapId = iIctWlanInfo.iIapId; - - RCmManagerExt cmManager; - cmManager.OpenL(); - CleanupClosePushL( cmManager ); - - RCmConnectionMethodExt cm = cmManager.ConnectionMethodL( - iConnectedIapId ); - CleanupClosePushL( cm ); - - iConnectedNetId = cm.GetIntAttributeL( CMManager::ECmNetworkId ); - - CleanupStack::PopAndDestroy( &cm ); - CleanupStack::PopAndDestroy( &cmManager ); - - LOG_WRITE( "starting ICT test..." ); - CIctsClientInterface* ict = CIctsClientInterface::NewL( - iConnectedIapId, - iConnectedNetId, - *this ); - LOG_WRITE( "ICT created" ); - CleanupStack::PushL( ict ); - ict->StartL(); - LOG_WRITE( "ICT: started" ); - - // enter a waitloop since ICT is a kind of asynchronous service - if ( !iIctEnded ) - { - LOG_WRITE( "ICT: iIctWait started" ); - iIctWait.Start(); - } - - iIctEnded = EFalse; - CleanupStack::PopAndDestroy( ict ); - LOG_WRITE( "ICT test done." ); - } - - - if ( ( err == KErrNone && !aKeepConnection && - ictTestPermission != EIctsNeverRun ) || - ( err != KErrNone && err != KErrCancel ) ) - { - // drop the connection in case of Start web browsing, and if an error - // different from KErrCancel occured (on cancel the connection is - // closed automatically) - LOG_WRITE( "disconnecting..." ); - iSession.DisconnectWlanBearerL(); - LOG_WRITE( "Disconnected." ); - } - - - - if ( err == KErrNone && ictTestPermission == EIctsNeverRun ) - { - LOG_WRITE( "ICT is set to never run, IAP remains temporary" ); - - ConnectivityObserver( EConnectionNotOk, KNullDesC ); - } - - return err; - } - - -// ---------------------------------------------------------------------------- -// CWsfModel::TestConnectedAccessPointL -// ---------------------------------------------------------------------------- -// -EXPORT_C TInt CWsfModel::TestConnectedAccessPointL( TWsfWlanInfo& aWlan, - TBool aConnectOnly ) - { - LOG_ENTERFN( "CWsfModel::TestConnectedAccessPointL" ); - TInt err( KErrNone ); - iConnectOnly = aConnectOnly; - if ( !aWlan.iIapId ) - { - // the wlaninfo must already contain a valid IAP id - LOG_WRITE( "invalid IAP id" ); - return KErrCorrupt; - } - - // the wlaninfo must be persistent to avoid nullpointer crashes due to - // background refreshing - iIctWlanInfo = aWlan; - - // check ICT settings - TInt ictTestPermission( IctsTestPermission() ); - - if ( ictTestPermission != EIctsNeverRun ) - { - // do the connectivity test - iConnectedIapId = iIctWlanInfo.iIapId; - - RCmManagerExt cmManager; - cmManager.OpenL(); - CleanupClosePushL( cmManager ); - - RCmConnectionMethodExt cm = cmManager.ConnectionMethodL( - iConnectedIapId ); - CleanupClosePushL( cm ); - - iConnectedNetId = cm.GetIntAttributeL( CMManager::ECmNetworkId ); - - CleanupStack::PopAndDestroy( &cm ); - CleanupStack::PopAndDestroy( &cmManager ); - - LOG_WRITE( "starting ICT test..." ); - - if ( iIct ) - { - iIct->CancelStartL(); - delete iIct; - iIct = NULL; - } - - iIct = CIctsClientInterface::NewL( iConnectedIapId, - iConnectedNetId, - *this ); - LOG_WRITE( "ICT created" ); - iIct->StartL(); - LOG_WRITE( "ICT: started" ); - - // enter a waitloop since ICT is a kind of asynchronous service - if ( !iIctEnded ) - { - LOG_WRITE( "ICT: iIctWait started" ); - iIctWait.Start(); - } - - iIctEnded = EFalse; - LOG_WRITE( "ICT test done." ); - } - - if ( ictTestPermission == EIctsNeverRun ) - { - LOG_WRITE( "ICT is set to never run, IAP remains temporary" ); - ConnectivityObserver( EConnectionNotOk, KNullDesC ); - } - - return err; - } - - -// ---------------------------------------------------------------------------- // CWsfModel::RefreshScanL // ---------------------------------------------------------------------------- //