# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1268401734 -7200 # Node ID dff6ebfd236fad21d0debb9d48bf5e953fea0c06 # Parent c2bc3f8c7777dc9c579f355295179c8f7e377ece Revision: 201007 Kit: 201008 diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h --- a/hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h Fri Mar 12 15:48:54 2010 +0200 @@ -11,13 +11,11 @@ * * Contributors: * -* Description: NIFMAN configuration +* Description: NIFMAN configuration daemon * */ - - #ifndef __NET_CFG_EXTN_HOTSPOT_H__ #define __NET_CFG_EXTN_HOTSPOT_H__ @@ -35,68 +33,80 @@ * @since S60 5.0 */ class CNetworkConfigExtensionHotSpot : public CNetworkConfigExtensionBase - { + { public: /** * Two-phased constructor. */ - static CNetworkConfigExtensionHotSpot* NewL( TAny* aMNifIfNotify ); - - /** + static CNetworkConfigExtensionHotSpot* NewL( TAny* aMNifIfNotify ); + + /** * Destructor. */ - virtual ~CNetworkConfigExtensionHotSpot(); + virtual ~CNetworkConfigExtensionHotSpot(); - /** + /** * From CNetworkConfigExtensionBase * @since S60 5.0 * @param aMessage the message * @return None */ - void SendIoctlMessageL( const ESock::RLegacyResponseMsg& aMessage ); + void SendIoctlMessageL( const ESock::RLegacyResponseMsg& aMessage ); + /** + * From CNetworkConfigExtensionBase + * @since S60 5.2 + * @param aCause Specifies what caused the deregistration request + * @return None + */ + void Deregister( TInt aCause ); + protected: /** * C++ default constructor. */ - CNetworkConfigExtensionHotSpot( MNifIfNotify& aNifIfNotify ); - - /** + CNetworkConfigExtensionHotSpot( MNifIfNotify& aNifIfNotify ); + + /** * By default Symbian 2nd phase constructor is private. */ - void ConstructL(); - + void ConstructL(); + /** - * From CTimer. Waits for StartLogin() completion from Hotspot Server + * From CNetworkConfigExtensionBase. HotspotFW handling add ons. + * @since S60 5.0 + * @return None + */ + virtual void RunL(); + + /** + * From CNetworkConfigExtensionBase. HotspotFW handling add ons. * @since S60 5.0 * @return None */ - virtual void RunL(); - - /** - * From CTimer. Implements cancel routines. - * @since S60 5.0 - * @return None - */ - virtual void DoCancel(); - - // Authentication flag - TBool iNotAuthenticated; - - // Authentication flag - TBool iNotDeregistered; - - // Flagging if Connect() to Hotspot done successfully - TInt iHotspotConnect; - + virtual void DoCancel(); + private: - // Hotspot client interface + // Flag for Authentication + TBool iNotAuthenticated; + + // Flag for Deregistering + TBool iNotDeregistered; + + // Defines if StartLogin() is ongoing + TBool iIsStartLoginActive; + + // Defines if HotspotFW session is created + TInt iHotspotConnect; + + // Handle to HotspotFW client interface RHssInterface iClient; - }; + + }; /** * CNetworkConfigExtensionBase - constructor @@ -104,8 +114,8 @@ */ inline CNetworkConfigExtensionHotSpot::CNetworkConfigExtensionHotSpot( MNifIfNotify& aNifIfNotify ) : CNetworkConfigExtensionBase( aNifIfNotify ) - { - } + { + } #endif diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsclient/NetCfgExtnHotSpot/src/NetCfgExtnHotSpot.cpp --- a/hotspotfw/hsclient/NetCfgExtnHotSpot/src/NetCfgExtnHotSpot.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsclient/NetCfgExtnHotSpot/src/NetCfgExtnHotSpot.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -11,10 +11,11 @@ * * Contributors: * -* Description: Implements Network Config Extension for HotSpot +* Description: Implements Network Config Extension for HotspotFW * */ + // INCLUDE FILES #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include @@ -24,11 +25,11 @@ #include "am_debug.h" -// ============================ MEMBER FUNCTIONS =============================== +// ============================ MEMBER FUNCTIONS ============================== -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // NewL -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // CNetworkConfigExtensionHotSpot* CNetworkConfigExtensionHotSpot::NewL( TAny* aMNifIfNotify ) @@ -42,9 +43,9 @@ return pDaemon; } -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // ConstructL -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CNetworkConfigExtensionHotSpot::ConstructL() { @@ -52,17 +53,17 @@ CNetworkConfigExtensionBase::ConstructL(); iNotAuthenticated = ETrue; iNotDeregistered = ETrue; + iIsStartLoginActive = EFalse; iHotspotConnect = KErrNotFound; - DEBUG( "CNetworkConfigExtensionHotSpot::ConstructL() Done" ); } -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // SendIoctlMessageL -// Forwards Ioctl request to the daemon and activates the AO to wait for response -// ----------------------------------------------------------------------------- +// Forwards Ioctl request to the daemon. Activates the AO to wait for response. +// ---------------------------------------------------------------------------- // -void CNetworkConfigExtensionHotSpot::SendIoctlMessageL( const ESock::RLegacyResponseMsg& aMessage ) - +void CNetworkConfigExtensionHotSpot::SendIoctlMessageL( + const ESock::RLegacyResponseMsg& aMessage ) { TInt name = aMessage.Int1(); if ( aMessage.Int0() != KCOLConfiguration ) @@ -85,109 +86,128 @@ CNetworkConfigExtensionBase::SendIoctlMessageL( aMessage ); } -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // ~CNetworkConfigExtensionHotSpot -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // CNetworkConfigExtensionHotSpot::~CNetworkConfigExtensionHotSpot() + { + DEBUG( "CNetworkConfigExtensionHotSpot::~CNetworkConfigExtensionHotSpot" ); + iClient.Close(); + } - { - DEBUG( "CNetworkConfigExtensionHotSpot::~CNetworkConfigExtensionHotSpot()" ); - } - -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // ImplementationTable -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // const TImplementationProxy ImplementationTable[] = { - IMPLEMENTATION_PROXY_ENTRY(0x10282ECA, CNetworkConfigExtensionHotSpot::NewL) + IMPLEMENTATION_PROXY_ENTRY( 0x10282ECA, + CNetworkConfigExtensionHotSpot::NewL ) }; -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // ImplementationGroupProxy -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + aTableCount = sizeof( ImplementationTable ) / + sizeof( TImplementationProxy ); return ImplementationTable; } +// ---------------------------------------------------------------------------- +// Deregister +// ---------------------------------------------------------------------------- +// +void CNetworkConfigExtensionHotSpot::Deregister( TInt aCause ) + { + DEBUG1( "CNetworkConfigExtensionHotSpot::Deregister() aCause: %d", aCause ); + CNetworkConfigExtensionBase::Deregister( aCause ); // to parent + + if ( iIsStartLoginActive ) + { + DEBUG( "CNetworkConfigExtensionHotSpot::Deregister() LoginComplete" ); + iClient.LoginComplete( iConnectionInfoBuf().iIapId, KErrNone ); + } + iIsStartLoginActive = EFalse; + } -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // RunL -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CNetworkConfigExtensionHotSpot::RunL() - { - DEBUG( "CNetworkConfigExtensionHotSpot::RunL()" ); - if (iLastGenericProgressStage == KConfigDaemonStartingRegistration) - { - - if(iNotAuthenticated) - { - DEBUG( "CNetworkConfigExtensionHotSpot::RunL() not auth" ); - TUint iapId = iConnectionInfoBuf().iIapId; - TUint networkId = iConnectionInfoBuf().iNetId; - - iHotspotConnect = iClient.Connect(); - - if ( KErrNone == iHotspotConnect ) - { - iClient.StartLogin( iapId, networkId, iStatus); - SetActive(); - } - else - { - CNetworkConfigExtensionBase::RunL(); - } - iNotAuthenticated = EFalse; + { + DEBUG( "CNetworkConfigExtensionHotSpot::RunL()" ); + if ( iLastGenericProgressStage == KConfigDaemonStartingRegistration ) + { + if( iNotAuthenticated ) + { + DEBUG( "CNetworkConfigExtensionHotSpot::RunL() StartLogin" ); + iHotspotConnect = iClient.Connect(); + + if ( KErrNone == iHotspotConnect ) + { + iIsStartLoginActive = ETrue; + iClient.StartLogin( iConnectionInfoBuf().iIapId, + iConnectionInfoBuf().iNetId, + iStatus ); + SetActive(); + } + else // to parent + { + CNetworkConfigExtensionBase::RunL(); + } + iNotAuthenticated = EFalse; } - else - { - DEBUG( "CNetworkConfigExtensionHotSpot::RunL() close" ); - CNetworkConfigExtensionBase::RunL(); - } - - } - else if (iLastGenericProgressStage == KConfigDaemonStartingDeregistration) + else // to parent + { + DEBUG( "CNetworkConfigExtensionHotSpot::RunL() authenticated" ); + iIsStartLoginActive = EFalse; + CNetworkConfigExtensionBase::RunL(); + } + + } + else if ( iLastGenericProgressStage == + KConfigDaemonStartingDeregistration ) { - if(iNotDeregistered) - { - DEBUG( "CNetworkConfigExtensionHotSpot::RunL() dereg" ); + if( iNotDeregistered ) + { + DEBUG( "CNetworkConfigExtensionHotSpot::RunL() CloseConnection" ); TUint iapId = iConnectionInfoBuf().iIapId; - TUint networkId = iConnectionInfoBuf().iNetId; - - if ( KErrNone == iHotspotConnect ) - { - iClient.CloseConnection( iapId, iStatus); - SetActive(); - } - else - { - CNetworkConfigExtensionBase::RunL(); - } - iNotDeregistered = EFalse; - } - else - { - DEBUG( "CNetworkConfigExtensionHotSpot::RunL() dereg close" ); - iClient.Close(); - CNetworkConfigExtensionBase::RunL(); - } + TUint networkId = iConnectionInfoBuf().iNetId; + + if ( KErrNone == iHotspotConnect ) + { + iClient.CloseConnection( iapId, iStatus ); + SetActive(); + } + else // to parent + { + CNetworkConfigExtensionBase::RunL(); + } + iNotDeregistered = EFalse; + } + else // to parent + { + DEBUG( "CNetworkConfigExtensionHotSpot::RunL() deregistered" ); + CNetworkConfigExtensionBase::RunL(); + } } - else // original ========================================================= - { - DEBUG( "CNetworkConfigExtensionHotSpot::RunL() original" ); - CNetworkConfigExtensionBase::RunL(); - } - } - -// ----------------------------------------------------------------------------- + else // to parent + { + DEBUG( "CNetworkConfigExtensionHotSpot::RunL() original" ); + CNetworkConfigExtensionBase::RunL(); + } + } + +// ---------------------------------------------------------------------------- // DoCancel -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CNetworkConfigExtensionHotSpot::DoCancel() { diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsclient/inc/hssinterface.h --- a/hotspotfw/hsclient/inc/hssinterface.h Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsclient/inc/hssinterface.h Fri Mar 12 15:48:54 2010 +0200 @@ -279,13 +279,7 @@ * @return KErrNone if successful otherwise another of the system wide error codes. */ TInt StartServer(); - - /** - * Server startup continues. - * @return KErrNone if successful otherwise another of the system wide error codes. - */ - TInt CreateServerProcess(); - + private: // Methods /** diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsclient/src/hssinterface.cpp --- a/hotspotfw/hsclient/src/hssinterface.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsclient/src/hssinterface.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -108,7 +108,7 @@ error = CreateSession( KHotSpotDataServerName, Version(), KDefaultMsgSlots ); - DEBUG1( "RHssInterface::Connect() CreateSession: %d", error ); + DEBUG1( "RHssInterface::Connect() CreateSession: %d", error ); } return error; } @@ -412,75 +412,50 @@ // TInt RHssInterface::StartServer() { - DEBUG( "RHssInterface::StartServer" ); - TInt result; - - TFindServer findHotSpotServer( KHotSpotDataServerName ); + TInt res( KErrNone ); + // create server - if one of this name does not already exist + TFindServer findServer( KHotSpotDataServerName ); TFullName name; - result = findHotSpotServer.Next( name ); - if ( result == KErrNone ) - { - // Server already running - return KErrNone; - } - - RSemaphore semaphore; - result = semaphore.CreateGlobal( KHotSpotServerSemaphore, 0 ); - DEBUG1( "RHssInterface::StartServer semaphore: %d", result ); - if ( result != KErrNone ) + if ( findServer.Next( name ) != KErrNone ) // we don't exist already { - return result; - } + RProcess server; + // Create the server process + res = server.Create( KHotSpotServerExe, KNullDesC ); - result = CreateServerProcess(); - DEBUG1( "RHssInterface::StartServer CreateServerProcess: %d", result ); - if ( result != KErrNone ) - { - // Should the semaphore be closed if process creating fails? - return result; - } - - semaphore.Wait(); - semaphore.Close(); - - return KErrNone; - } + if ( res != KErrNone ) // thread created ok - now start it going + { + return res; + } -// ----------------------------------------------------------------------------- -// RHssInterface::CreateServerProcess() -// Creates a server process -// ----------------------------------------------------------------------------- -// -TInt RHssInterface::CreateServerProcess() - { - const TUidType serverUid( KNullUid,KNullUid, KHotspotServerUid3 ); - - RProcess server; + // Rendezvous is used to detect server start + TRequestStatus status; + server.Rendezvous( status ); + + if ( status != KRequestPending ) + { + DEBUG1( "StartServer Rendezvous ERROR: %d", status.Int() ); + server.Kill( 0 ); // abort startup + } + else + { + server.Resume(); // logon OK - start the server + } + + DEBUG( "StartServer wait for start" ); + User::WaitForRequest( status ); // wait for start or death - TInt r = server.Create(KHotSpotServerExe,KNullDesC); - if ( r != KErrNone ) - { - DEBUG1( "**** RHssInterface: server start failed %d", r ); - return r; - } - TRequestStatus stat; - server.Rendezvous( stat ); - if ( stat!=KRequestPending ) - { - server.Kill(0); // abort startup - } - else - { - server.Resume(); // logon OK - start the server + // We can't use the 'exit reason' if the server paniced as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone + res = ( server.ExitType() == EExitPanic ) ? KErrGeneral : status.Int(); + + // we're no longer interested in the other process + server.Close(); } - - DEBUG("**** RHssInterface: Started"); - - User::WaitForRequest(stat); - r = ( server.ExitType()==EExitPanic ) ? KErrGeneral : stat.Int(); - server.Close(); - return r; + + return res; + } // --------------------------------------------------------- diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsserver/inc/hotspotclientserver.h --- a/hotspotfw/hsserver/inc/hotspotclientserver.h Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsserver/inc/hotspotclientserver.h Fri Mar 12 15:48:54 2010 +0200 @@ -23,39 +23,17 @@ #include "hssiapsettings.h" _LIT(KHotSpotServerExe, "\\sys\\bin\\HotSpotServer.exe"); -_LIT(KHotSpotServerSemaphore, "HotSpotServerSemaphore"); _LIT(KHotSpotDataServerName, "HotSpotServer"); -_LIT( KWlanBearerAgent, "wlanagt.agt" ); -_LIT( KWlanBearerAgent2, "wlanagt2.agt" ); - _LIT(KHotSpotServerName,"hotspotserver"); -_LIT(KHotSpotServerImg,"HotSpotServer"); // DLL/EXE name - -_LIT(KExePath, "\\sys\\bin\\"); -_LIT(KExe, ".exe"); +_LIT(KHotSpotServerImg,"HotSpotServer"); _LIT( KHotSpotPlugin, "NetCfgExtnHotSpot" ); _LIT( KDhcpPlugin, "NetCfgExtnDhcp" ); const TUint KEasyWlanServiceId = 1; - -const TUint KMaxSqlQueryLength = 2048; -_LIT(KDatabaseName, "c:\\system\\data\\hotspot.dat"); -_LIT(KTableName, "hotspot"); -_LIT(KIapName, "IapName"); -_LIT(KTestStatus, "TestStatus"); -_LIT(KRedirectStatus, "RedirectStatus"); - -const TInt KAppNameMaxLength = 64; -const TInt KExePathLength = 14; -const TInt KExeLength = 4; const TUid KHotspotServerUid3={0x10282ECB}; -const TInt KMaxHotspotMessage=512; -const TInt KScanHotspotIapId=0; - const TUint KHssShutdown = 777; - const TUint8 KHssMacAddressLength = 6; const TUid KInternetConnectivityUid={0x10282EC5}; @@ -79,10 +57,7 @@ const TUint KHotSpotBuildVersionNumber = 1; const TInt KIapNameLength = 128; -const TUint KConnectivityTestedId = 20; -const TUint KConnectivityTestNeededId = 30; -const TUint KNoRedirect = 40; -const TUint KRedirect = 50; +const TInt KUidLength = 10; /** * Commands from client to server. diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsserver/inc/hotspotserver.h --- a/hotspotfw/hsserver/inc/hotspotserver.h Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsserver/inc/hotspotserver.h Fri Mar 12 15:48:54 2010 +0200 @@ -86,20 +86,34 @@ void PanicClient(const RMessagePtr2& aMessage,THotspotPanic aPanic); +/** +* Stores RMessage entries +*/ struct SRequestMapEntry { RMessagePtr2 iMessage; THotSpotCommands iFunction; TUint iIapId; }; - +/** +* Stores timer values for each client +*/ struct SLoginLogoutTimers { - TUid clientUid; - TUint loginTimeMicroSecs; - TUint logoutTimeMicroSecs; + TBuf iClientUid; + TUint iLoginTimeMicroSecs; + TUint iLogoutTimeMicroSecs; }; - + +/** +* Stores all registered IAPs and their client UIDs +*/ +struct SClientIaps + { + TUint iIapId; + TBuf iClientUid; + }; + // CLASS DECLARATION /** @@ -209,54 +223,79 @@ * @return ETrue if can be sent. Otherwise EFalse. */ TBool GetAssociationFlagValue(); - + /** - * Set service id of IAP in use - * @since Series 60 3.0 - * @param aServiceId service id + * Finds HotspotFW created client IAPs. + * @since Series 60 5.2 * @return None */ - void SetServiceId( TInt aServiceId ); + void FindClientIapsL(); /** - * Gets service id of IAP in use - * @since Series 60 3.0 - * @return service ID - */ - TInt GetServiceId(); - - /** * Checks IAPs if there's any unused Hotspot IAPs. - * @since Series 60 3.0 + * @since Series 60 3.2 * @return None */ void CheckIapsL(); /** * Get login timer value for the specified client. - * @param aClientUid, client's user ID, + * @since Series 60 5.2 + * @param aClientUid, clients user id * @return Login timer value. */ - TUint GetLoginTimeMicroSecs( TUid aClientUid ); + TUint GetLoginTimeMicroSecs( TDes& aClientUid ); /** * Get logout timer value for the specified client. - * @param aClientUid, client's user ID, + * @since Series 60 5.2 + * @param aClientUid, clients user id * @return Logout timer value. */ - TUint GetLogoutTimeMicroSecs( TUid aClientUid ); + TUint GetLogoutTimeMicroSecs( TDes& aClientUid ); /** * Set both login and logout timer values for the specified client. - * @param aClientUid, client's user ID, - * @param aLoginTimerValue, set login timer value, + * @since Series 60 5.2 + * @param aClientUid, clients user id + * @param aLoginTimerValue, set login timer value * @param aLogoutTimerValue, set logout timer value. */ - void CHotSpotServer::SetTimerValues( - TUid aClientUid, + void SetTimerValues( + TDes& aClientUid, TUint aLoginTimerValue, TUint aLogoutTimerValue ); + /** + * Finds if given IAP id has an existing client. + * @since Series 60 5.2 + * @param aClientUid, clients user id + * @return KErrNone if client is found, otherwise KErrNotFound + */ + TInt GetClientUid( TUint aIapId, TDes& aUid ); + + /** + * Adds client IAP to the array. + * @since Series 60 5.2 + * @param aIapId, IAP id + * @param aUid, clients user id + */ + void SetClientIap( TUint aIapId, TDes& aUid ); + + /** + * Removes client IAP from the array. + * @since Series 60 5.2 + * @param aIapId, IAP id + */ + void RemoveClientIap( TUint aIapId ); + + /** + * Returns Easy WLAN IAP id. + * @since Series 60 5.2 + * @return Easy WLAN id + */ + TInt GetEasyWlanId(); + private: /** @@ -264,7 +303,7 @@ * @param aClientUid, client UID to find. * @return matching index if UID was found, otherwise KErrNotFound. */ - TInt CHotSpotServer::FindClientUid( TUid aClientUid ); + TInt FindClientUid( TDes& aClientUid ); public: // Functions from base classes @@ -331,24 +370,34 @@ TBool iAssociationValue; /** - * Boolean flag whether the IAPs has been checked or not + * Flag for the IAP check */ TBool iIapCheckValue; + + /** + * Flag for client IAP search + */ + TInt iClientIapsChecked; /** * WLAN management API */ CWlanMgmtClient* iMgtClient; - - /** - * Service id of IAP in use - */ - TInt iCurrentServiceIdInUse; - + /** * Array for storing client dependent login and logout timer values. */ RArray iLoginLogoutTimerArray; + + /** + * Array for storing client IAPs and their UIDs. + */ + RArray iClientIaps; + + /** + * Easy WLAN IAP Id + */ + TInt iEasyWlanId; }; #endif diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsserver/inc/hotspotsession.h --- a/hotspotfw/hsserver/inc/hotspotsession.h Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsserver/inc/hotspotsession.h Fri Mar 12 15:48:54 2010 +0200 @@ -65,16 +65,20 @@ */ static CHotSpotSession* NewL( CHotSpotServer& aServer ); - /** + /** * Destructor. */ ~CHotSpotSession(); - struct TNotification - { - TInt id; - TBuf8 data; - }; + /** + * Struct for notifications. + */ + struct TNotification + { + TInt id; + TBuf8 data; + }; + public: // Functions from base classes /** @@ -116,18 +120,18 @@ void LogoutTimeout(); /** - * From MWlanMgmtNotifications - * @since Series 60 3.0 - * @param aNewState State of WLAN - * @return None - */ - virtual void ConnectionStateChanged( TWlanConnectionMode aNewState ); + * From MWlanMgmtNotifications + * @since Series 60 3.0 + * @param aNewState State of WLAN + * @return None + */ + virtual void ConnectionStateChanged( TWlanConnectionMode aNewState ); public: // New functions /** - * Metods for handling passthrough notifications + * Methods for handling passthrough notifications */ void HandleCancelNotifications( const RMessage2& aMessage ); void AddNotification( TInt aNotification, TDes8& aData ); @@ -191,7 +195,7 @@ * @param aIapId, IAP id * @return KErrNone, if successful, otherwice one of system wide errorcodes. */ - TInt ProcessStartAgain( const TUint aIapId ); + TInt ProcessStartAgain( const TUint aIapId ); /** * Sends WLAN association status to client @@ -206,7 +210,7 @@ * @param aIapId, IAP id * @return KErrNone, if successful, otherwice one of system wide errorcodes. */ - TInt ProcessCloseL( const TUint aIapId ); + TInt ProcessCloseL( const TUint aIapId ); /** * Creates client instance through ECom @@ -234,20 +238,32 @@ void AuthenticateL( const TDesC& aString ); /** - * Reads EasyWLAN IAP id - * @return None + * Removes brackets from the UID + * @param aUid, UID of the client */ - void EasyWlanIdL(); + void ModifyClientUid( TDes& aUid ); + + /** + * Convert descriptor to TUid and saves it to member variable + * @param aUid, UID of the client + */ + void ConvertTBufToTUid( TDes& aUid ); private: // Data - /** List of pending (not sent) notifications. */ + /** + * List of pending (not sent) notifications. + */ RArray iPendingNotifications; - /** The request from the client pending for a notification. */ + /** + * The request from the client pending for a notification. + */ RMessagePtr2 iPendingNotificationRequest; - /** Is there a pending request from the client. */ + /** + * Is there a pending request from the client. + */ TBool iIsNotificationRequestPending; /** @@ -262,11 +278,13 @@ CHssClientPlugin* iClient; /** - * handle to MHssSrvNotifications + * Handle to MHssSrvNotifications */ MHssSrvNotifications *iSrvNotifications; - /** Handle to remove notification. */ + /** + * Handle to remove notification. + */ CSessionNotification* iNotificationHandle; /** @@ -294,12 +312,6 @@ */ HssNotifications *iNotifications; - - /** - * statusinformation of Async call - */ - TRequestStatus iStatus; - /** * Handler for changing IAP settings * Own @@ -338,11 +350,7 @@ * Flag for indicate if extended HSFW API is used */ TBool iHotspotExtension; - - /** - * Easy WLAN IAP Id - */ - TUint32 iEasyWlanId; + }; #endif diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsserver/inc/hssiapsettingshandler.h --- a/hotspotfw/hsserver/inc/hssiapsettingshandler.h Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsserver/inc/hssiapsettingshandler.h Fri Mar 12 15:48:54 2010 +0200 @@ -45,8 +45,8 @@ _LIT8(KEapPlus,"+0"); _LIT8(KDot,", "); -_LIT8(KMark1, "[" ); -_LIT8(KMark2, "]" ); +_LIT(KMark1, "[" ); +_LIT(KMark2, "]" ); _LIT8(KEapNone,"0"); _LIT8(KEapGtc,"6"); @@ -130,7 +130,9 @@ * @param aUid, UID of the client * @return Iap ID, Otherwise aIapId will be null */ - void CreateClientIapL( const TDesC& aIapName, TUint32& aIapId, const TUid aUid ); + void CreateClientIapL( const TDesC& aIapName, + TUint32& aIapId, + const TDesC& aUid ); /** * Create new IAP to Internet SNAP. @@ -142,16 +144,7 @@ * @param aIapID, IAP id */ void DeleteIapL( const TUint aIapId ); - - /** - * Finds client if found return its UID - * @param aIapId, IAP id - * @param aUid, UID id - * @param aUidText, UID id as a descriptor. Without[]. - * @return KErrNone, if successful, otherwise one of system wide errorcodes. - */ - TInt FindClientL( const TUint aIapId, TUid& aUid, TDes8& aUidText ); - + protected: /** diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsserver/src/hotspotserver.cpp --- a/hotspotfw/hsserver/src/hotspotserver.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsserver/src/hotspotserver.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -11,15 +11,12 @@ * * Contributors: * -* Description: Implementation of HotSpot Plugin Server +* Description: Implementation of HotSpot Server * */ - - - // INCLUDE FILES #include #include @@ -49,11 +46,8 @@ // CONSTANTS // Panic codes for HotSpot server const TInt KHotSpotPanicCleanupStackCreationFailed = 1; -const TInt KHotSpotPanicOpenSemaforeFailed = 2; -const TInt KHotSpotPanicCreationOfSchedulerFailed = 3; // Default timeout values - const TUint KMillion = 1000000; const TUint KHssDefaultLoginTimeMicroSecs = 180 * KMillion; // 180 seconds (3 mins) const TUint KHssMinLoginTime = 5; // 5 seconds @@ -73,39 +67,24 @@ // static void RunServerL() { - User::LeaveIfError( User::RenameThread( KHotSpotServerName ) ); - - CActiveScheduler* s=new(ELeave) CActiveScheduler; - if ( !s ) - { - User::Panic( KHotSpotModuleName, KHotSpotPanicCreationOfSchedulerFailed ); - } - CleanupStack::PushL(s); - CActiveScheduler::Install(s); - - CHotSpotServer::NewLC(); // Is NewLC: Server was pushed into cleanup stack. - - RSemaphore started; - TInt err = started.CreateGlobal( KHotSpotServerSemaphore, 0 ); - if ( err != KErrNone ) - { - err = started.OpenGlobal( KHotSpotServerSemaphore ); - } + // Create and install the active scheduler + CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; + CleanupStack::PushL( scheduler ); + CActiveScheduler::Install( scheduler ); + + // Create server + CHotSpotServer::NewLC(); + + // Initialisation complete, now signal the client + User::LeaveIfError( RThread().RenameMe( KHotSpotServerName ) ); + RProcess::Rendezvous( KErrNone ); - __ASSERT_ALWAYS( - err == KErrNone, - User::Panic( KHotSpotModuleName, KHotSpotPanicOpenSemaforeFailed ) - ); - - // lets everyone know that the thread is ready to deal with requests - RProcess::Rendezvous(KErrNone); - - started.Signal(); - started.Close(); - + // Ready to run DEBUG("**** HotspotServer: server fully running"); CActiveScheduler::Start(); - CleanupStack::PopAndDestroy( 2, s ); // Cleanup both server and scheduler + + // Cleanup the server and scheduler + CleanupStack::PopAndDestroy( 2, scheduler ); REComSession::FinalClose(); } @@ -149,11 +128,12 @@ // CHotSpotServer::~CHotSpotServer() { - DEBUG("**** HotSpotServer: CHotSpotServer::~CHotSpotServer"); + DEBUG( "**** HotSpotServer: CHotSpotServer::~CHotSpotServer" ); iMap.Close(); iNotificationArray.Close(); iLoginLogoutTimerArray.Close(); + iClientIaps.Close(); if ( iMgtClient != NULL ) { @@ -170,17 +150,20 @@ // void CHotSpotServer::ConstructL() { - DEBUG("**** HotSpotServer: CHotSpotServer::ConstructL"); + DEBUG( "**** HotSpotServer: CHotSpotServer::ConstructL" ); StartL( KHotSpotServerName ); iIapCheckValue = EFalse; iLogoutSent = EFalse; iLoginValue = ETrue; iAssociationValue = EFalse; - + iClientIapsChecked = KErrNone; + iEasyWlanId = KEasyWlanServiceId; // Set to default value just in case + + TRAP( iClientIapsChecked, FindClientIapsL() ); + // Activate notifications for IAP check purposes. Done with every server startup. - // When EWlanConnectionModeNotConnected is received we can cancel this and - // we know that it safe to go through IAPs. + // When EWlanConnectionModeNotConnected is received we can cancel this. iMgtClient = CWlanMgmtClient::NewL(); #ifndef __WINS__ iMgtClient->ActivateNotificationsL( *this ); @@ -202,94 +185,119 @@ iMgtClient->CancelNotifications(); #endif } - - TRAPD(err, CheckIapsL()); - if ( err != KErrNone ) - { - DEBUG1("CHotSpotServer::ConnectionStateChanged(): %d", err); - } + if ( iClientIapsChecked != KErrNone ) + { + TRAP_IGNORE( FindClientIapsL() ); + } + TRAPD(err, CheckIapsL()); + if ( err != KErrNone ) + { + DEBUG1("CHotSpotServer::ConnectionStateChanged(): %d", err); + } } } // ----------------------------------------------------------------------------- +// FindClientIapsL +// ----------------------------------------------------------------------------- +// +void CHotSpotServer::FindClientIapsL() + { + DEBUG("CHotSpotServer::FindClientIapsL()"); + RCmManagerExt cmManager; + cmManager.OpenL(); + CleanupClosePushL(cmManager); + + RArray cmArray; + CleanupClosePushL( cmArray ); + TBool supportedBearersOnly = ETrue; + TBool legacyCmsOnly = EFalse; + + cmManager.ConnectionMethodL( cmArray, supportedBearersOnly, legacyCmsOnly ); + DEBUG1("CHotSpotServer::FindClientIapsL count: %d", cmArray.Count()); + + for( TInt i = 0; i < cmArray.Count(); i++ ) + { + RCmConnectionMethodExt cm = cmManager.ConnectionMethodL( cmArray[i] ); + CleanupClosePushL( cm ); + HBufC* daemonName = cm.GetStringAttributeL( + ECmConfigDaemonManagerName ); + CleanupStack::PushL( daemonName ); + if ( daemonName ) + { + if ( daemonName->Compare( KHotSpotPlugin ) == 0 ) + { + DEBUG("CHotSpotServer::FindClientIapsL() Client found"); + TBuf clientUid; + TUid uid(TUid::Null()); + TUint iapId = cm.GetIntAttributeL( ECmIapId ); + HBufC* client = cm.GetStringAttributeL( + EWlanServiceExtensionTableName ); + clientUid.Copy( client->Des() ); + delete client; + SetClientIap( iapId, clientUid ); + DEBUG1("CHotSpotServer::FindClientIapsL() iapId: %d", iapId ); + } + } + CleanupStack::PopAndDestroy( daemonName ); + CleanupStack::PopAndDestroy( &cm ); + } + CleanupStack::PopAndDestroy( &cmArray ); + + // Read Easy WLAN IAP ID + iEasyWlanId = cmManager.EasyWlanIdL(); + CleanupStack::PopAndDestroy( &cmManager ); + DEBUG1("CHotSpotServer::FindClientIapsL() iEasyWlanId: % d", iEasyWlanId); + } + +// ----------------------------------------------------------------------------- // CheckIapsL // ----------------------------------------------------------------------------- // void CHotSpotServer::CheckIapsL() { DEBUG("CHotSpotServer::CheckIapsL"); - - _LIT(KMarkFirst, "[" ); - _LIT(KMarkLast, "]" ); - // This is needed to be checked only once per boot - if ( iIapCheckValue == EFalse ) + // This is needed to be checked only once per boot + iIapCheckValue = ETrue; + TInt count = iClientIaps.Count(); + + // Check the array. Not supposed to be many elements. + for( TInt i = 0; i < count; i++ ) { - iIapCheckValue = ETrue; + TLex lex( iClientIaps[i].iClientUid ); + TUint value( 0 ); + lex.Val( value, EHex ); + TUid client = TUid::Null(); + client.iUid = value; - RCmManagerExt cmManager; - cmManager.OpenL(); - CleanupClosePushL(cmManager); + // Try to find if plugin exists + CHssClientPlugin* plugin(NULL); + TBuf8 nullBuf; + TRAPD( error, plugin = CHssClientPlugin::NewL( client, nullBuf ) ); + delete plugin; - TBool supportedBearersOnly = ETrue; - TBool legacyCmsOnly = EFalse; - - RArray cmArray; - CleanupClosePushL( cmArray ); - - cmManager.ConnectionMethodL( cmArray, supportedBearersOnly, legacyCmsOnly ); - DEBUG1("CHotSpotServer::CheckIapsL count: %d", cmArray.Count()); - for( TInt i = 0; i < cmArray.Count(); i++ ) + DEBUG1("CHotSpotServer::CheckIapsL find client error: %d", error ); + if ( error == KErrNotFound ) { + // Remove from database + RCmManagerExt cmManager; + cmManager.OpenL(); + CleanupClosePushL(cmManager); + RCmConnectionMethodExt cm; - TRAPD( err, cm = cmManager.ConnectionMethodL( cmArray[i] ) ); - DEBUG1("CHotSpotServer::CheckIapsL: err %d", err ); - if ( KErrNone == err ) - { - HBufC* client( NULL ); - TRAPD( errr, client = cm.GetStringAttributeL( EWlanServiceExtensionTableName )); - DEBUG1("CHotSpotServer::CheckIapsL: errr %d", errr ); - if( KErrNone == errr ) - { - TBuf clientUid; - TUid uid(TUid::Null()); - - clientUid.Copy( client->Des() ); - delete client; - TInt indx = clientUid.Find( KMarkFirst ); - if ( KErrNotFound != indx ) - { - DEBUG("CHotSpotServer::CheckIapsL Client is found"); - clientUid.Delete( indx, 1 ); - indx = clientUid.Find( KMarkLast ); - if ( KErrNotFound != indx ) - { - clientUid.Delete( indx, 1 ); - } - // Convert TBuf to TUid - TLex lex( clientUid ); - TUint value( 0 ); - User::LeaveIfError( lex.Val( value, EHex ) ); - uid.iUid = value; - - // Try to find if 3rd party client exists. - // Delete IAP if no client. - CHssClientPlugin* plugin(NULL); - TBuf8 nullBuf; - TRAPD( error, plugin = CHssClientPlugin::NewL( uid, nullBuf ) ); - delete plugin; - - DEBUG1("CHotSpotServer::CheckIapsL find client error: %d", error ); - if ( error == KErrNotFound ) - { - cm.DeleteL(); - } - } - } - } - DEBUG("CHotSpotServer::CheckIapsLOK"); + cm = cmManager.ConnectionMethodL( iClientIaps[i].iIapId ); + CleanupClosePushL( cm ); + cmManager.RemoveAllReferencesL( cm ); + cm.DeleteL(); + + CleanupStack::PopAndDestroy( &cm ); + CleanupStack::PopAndDestroy( &cmManager ); + + // Remove from array + RemoveClientIap( iClientIaps[i].iIapId ); + count--; + i--; } - CleanupStack::PopAndDestroy( &cmArray ); - CleanupStack::PopAndDestroy( &cmManager ); } DEBUG("CHotSpotServer::CheckIapsL Done"); } @@ -472,33 +480,14 @@ DEBUG("HotspotServer::GetAssociationFlagValue()"); return iAssociationValue; } - -// ----------------------------------------------------------------------------- -// SetServiceId -// ----------------------------------------------------------------------------- -// -void CHotSpotServer::SetServiceId( TInt aServiceId ) - { - DEBUG("HotspotServer::SetServiceId"); - iCurrentServiceIdInUse = aServiceId; - } - -// ----------------------------------------------------------------------------- -// GetServiceId -// ----------------------------------------------------------------------------- -// -TInt CHotSpotServer::GetServiceId() - { - DEBUG("HotspotServer::GetServiceId()"); - return iCurrentServiceIdInUse; - } - + // ----------------------------------------------------------------------------- // RunError // ----------------------------------------------------------------------------- // TInt CHotSpotServer::RunError( TInt aError ) { + DEBUG1( "HotspotServer::RunError = %d", aError ); // error from CHotSpotSession::ServiceL Message().Complete( aError ); // Continue reading client requests @@ -510,16 +499,17 @@ // GetLoginTimerMicroSecs // ----------------------------------------------------------------------------- // -TUint CHotSpotServer::GetLoginTimeMicroSecs( TUid aClientUid ) +TUint CHotSpotServer::GetLoginTimeMicroSecs( TDes& aClientUid ) { + DEBUG("HotspotServer::GetLoginTimeMicroSecs()"); // Default timer value will be returned if matching client UID isn't found. TUint retval = KHssDefaultLoginTimeMicroSecs ; - TInt ret = CHotSpotServer::FindClientUid( aClientUid ); + TInt ret = FindClientUid( aClientUid ); if (ret != KErrNotFound) { // ret is the matching element's index. - retval = iLoginLogoutTimerArray[ret].loginTimeMicroSecs; + retval = iLoginLogoutTimerArray[ret].iLoginTimeMicroSecs; } return retval; @@ -529,16 +519,17 @@ // GetLogoutTimerMicroSecs // ----------------------------------------------------------------------------- // -TUint CHotSpotServer::GetLogoutTimeMicroSecs( TUid aClientUid ) +TUint CHotSpotServer::GetLogoutTimeMicroSecs( TDes& aClientUid ) { + DEBUG("HotspotServer::GetLogoutTimeMicroSecs()"); // Default timer value will be returned if matching client UID isn't found. TUint retval = KHssDefaultLogoutTimeMicroSecs ; - TInt ret = CHotSpotServer::FindClientUid( aClientUid ); + TInt ret = FindClientUid( aClientUid ); if (ret != KErrNotFound) { // ret is the matching element's index. - retval = iLoginLogoutTimerArray[ret].logoutTimeMicroSecs; + retval = iLoginLogoutTimerArray[ret].iLogoutTimeMicroSecs; } return retval; @@ -549,11 +540,12 @@ // ----------------------------------------------------------------------------- // void CHotSpotServer::SetTimerValues( - TUid aClientUid, + TDes& aClientUid, TUint aLoginTimerValue, // in seconds TUint aLogoutTimerValue ) // in seconds { - TInt ret = CHotSpotServer::FindClientUid( aClientUid ); + DEBUG("HotspotServer::SetTimerValues()"); + TInt ret = FindClientUid( aClientUid ); TUint loginTimeMicroSecs = KHssDefaultLoginTimeMicroSecs ; TUint logoutTimeMicroSecs = KHssDefaultLogoutTimeMicroSecs ; @@ -574,8 +566,8 @@ { DEBUG("CHotSpotServer::SetTimerValues(): Existing client modified."); // ret is the matching element's index. - iLoginLogoutTimerArray[ret].loginTimeMicroSecs = loginTimeMicroSecs; - iLoginLogoutTimerArray[ret].logoutTimeMicroSecs = logoutTimeMicroSecs; + iLoginLogoutTimerArray[ret].iLoginTimeMicroSecs = loginTimeMicroSecs; + iLoginLogoutTimerArray[ret].iLogoutTimeMicroSecs = logoutTimeMicroSecs; } else { @@ -593,16 +585,18 @@ // FindClientUid // ----------------------------------------------------------------------------- // -TInt CHotSpotServer::FindClientUid( TUid aClientUid ) +TInt CHotSpotServer::FindClientUid( TDes& aClientUid ) { + DEBUG("CHotspotServer::FindClientUid()"); TInt count = iLoginLogoutTimerArray.Count(); TInt i = 0; TInt ret = KErrNotFound; - while (i < count) + while ( i < count ) { - if (aClientUid == iLoginLogoutTimerArray[i].clientUid) + if ( aClientUid.Compare( iLoginLogoutTimerArray[i].iClientUid ) == 0 ) { + DEBUG("CHotspotServer::FindClientUid() FOUND"); ret = i; break; } @@ -612,6 +606,75 @@ return ret; } +// ----------------------------------------------------------------------------- +// GetClientUid +// ----------------------------------------------------------------------------- +// +TInt CHotSpotServer::GetClientUid( TUint aIapId, TDes& aUid ) + { + DEBUG("CHotspotServer::GetClientUid()"); + TInt ret( KErrNotFound ); + TInt count = iClientIaps.Count(); + TInt i = 0; + + while ( i < count ) + { + if ( aIapId == iClientIaps[i].iIapId ) + { + DEBUG("CHotspotServer::GetClientUid() FOUND"); + aUid = iClientIaps[i].iClientUid; + ret = KErrNone; + break; + } + i++; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// SetClientIap +// ----------------------------------------------------------------------------- +// +void CHotSpotServer::SetClientIap( TUint aIapId, TDes& aUid ) + { + DEBUG("CHotspotServer::SetClientIap()"); + SClientIaps clientElement = { aIapId, aUid }; + iClientIaps.Append( clientElement ); + } + +// ----------------------------------------------------------------------------- +// RemoveClientIap +// ----------------------------------------------------------------------------- +// +void CHotSpotServer::RemoveClientIap( TUint aIapId ) + { + DEBUG("CHotspotServer::RemoveClientIap()"); + TInt count = iClientIaps.Count(); + TInt i = 0; + + while ( i < count ) + { + if ( aIapId == iClientIaps[i].iIapId ) + { + DEBUG("CHotspotServer:::RemoveClientIap() FOUND"); + iClientIaps.Remove( i ); + break; + } + i++; + } + } + +// ----------------------------------------------------------------------------- +// GetEasyWlanId +// ----------------------------------------------------------------------------- +// +TInt CHotSpotServer::GetEasyWlanId() + { + DEBUG("CHotspotServer::GetEasyWlanId()"); + return iEasyWlanId; + } + // ========================== OTHER EXPORTED FUNCTIONS ========================= // ----------------------------------------------------------------------------- diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsserver/src/hotspotsession.cpp --- a/hotspotfw/hsserver/src/hotspotsession.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsserver/src/hotspotsession.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -482,9 +482,12 @@ case EHssSetTimerValues: { TUid clientUid( TUid::Uid( aMessage.Int0() ) ); + TBuf uid; + uid.Copy( clientUid.Name() ); + ModifyClientUid( uid ); TUint loginTimerValue = aMessage.Int1(); TUint logoutTimerValue = aMessage.Int2(); - iServer.SetTimerValues( clientUid, loginTimerValue, logoutTimerValue ); + iServer.SetTimerValues( uid, loginTimerValue, logoutTimerValue ); aMessage.Complete( KErrNone ); break; } @@ -669,16 +672,17 @@ iServer.CompleteMessage( indx, KErrCancel ); } - TUid clientUid; TBuf8 extAPI; - TRAP_IGNORE( iIapSettingsHandler->FindClientL( iIapId, clientUid, extAPI ) ); - - // 3rd party client was found - if ( clientUid != TUid::Null() ) + TBuf clientUid; + TInt err = iServer.GetClientUid( iIapId, clientUid ); + + if ( err != KErrNotFound ) { DEBUG("CHotSpotSession::LoginTimeout clientUid = CLIENT"); + ConvertTBufToTUid( clientUid ); TBuf8 nullBuf; - TInt ret = CreateClient( clientUid, nullBuf ); + + TInt ret = CreateClient( iClientUid, nullBuf ); DEBUG1("CHotSpotSession::LoginTimeout CreateClient ret: %d", ret); if ( KErrNone == ret ) { @@ -725,14 +729,19 @@ aMessage.ReadL( 1, iapPckg ); iapName = iapPckg().IapName(); + TBuf bufUid; + bufUid.Copy( clientUid.Name() ); + ModifyClientUid( bufUid ); + TUint32 iapId( 0 ); TInt ret( KErrNone ); - TRAP( ret, iIapSettingsHandler->CreateClientIapL( iapName, iapId, clientUid )); + TRAP( ret, iIapSettingsHandler->CreateClientIapL( iapName, iapId, bufUid )); DEBUG1( "CHotSpotSession::EHssRegister iapId: %d", iapId ); DEBUG1( "CHotSpotSession::EHssRegister ret: %d", ret ); if ( KErrNone == ret ) { + iServer.SetClientIap( iapId, bufUid ); aMessage.Complete( iapId ); } @@ -756,10 +765,10 @@ // Read message TInt iapId = ( TInt )aMessage.Int0(); - + iServer.RemoveClientIap( iapId ); // Check that this is not Easy WLAN - TRAP_IGNORE( EasyWlanIdL() ); - if ( iEasyWlanId != iapId ) + TInt easyWlan = iServer.GetEasyWlanId(); + if ( easyWlan != iapId ) { TRAPD( err, iIapSettingsHandler->DeleteIapL( iapId ) ); // return KErrGeneral if IAP removal is not successful @@ -784,13 +793,12 @@ { DEBUG("CHotSpotSession::ProcessStartLogin"); TInt ret( KErrNotFound ); - TUid clientUid; TBuf8 extAPI; iIapId = aIapId; // Check if Easy WLAN. - TRAP_IGNORE( EasyWlanIdL() ); - if ( iEasyWlanId == aIapId ) + TInt easyWlan = iServer.GetEasyWlanId(); + if ( easyWlan == aIapId ) { DEBUG("CHotSpotSession::ProcessStartLogin Easy WLAN detected"); // Just test internet connectivity and complete message later @@ -799,14 +807,16 @@ return ret; } - iIapSettingsHandler->FindClientL( aIapId, clientUid, extAPI ); + TBuf clientUid; + TInt err = iServer.GetClientUid( aIapId, clientUid ); - // 3rd party client was found - if ( clientUid != TUid::Null() ) + if ( err != KErrNotFound ) { DEBUG("CHotSpotSession::ProcessStartLogin clientUid = CLIENT"); + ConvertTBufToTUid( clientUid ); TBuf8 nullBuf; - ret = CreateClient( clientUid, nullBuf ); + + ret = CreateClient( iClientUid, nullBuf ); if ( KErrNone == ret && iServer.GetLoginFlagValue() ) { @@ -834,9 +844,10 @@ TInt ret( KErrNone ); TBuf8 extAPI; + TBuf clientUid; - iIapSettingsHandler->FindClientL( aIapId, iClientUid, extAPI ); - if ( iClientUid == TUid::Null() ) + TInt err = iServer.GetClientUid( aIapId, clientUid ); + if ( err != KErrNone ) { DEBUG("CHotSpotSession::ProcessStartL clientUid = EMPTY"); @@ -845,6 +856,8 @@ else { DEBUG("CHotSpotSession::ProcessStartL clientUid = CLIENT"); + ConvertTBufToTUid( clientUid ); + TBuf8 nullBuf; // Try first with API extension defined ret = CreateClient( iClientUid, extAPI ); @@ -880,7 +893,7 @@ // Client exists if StartAgain is called. if ( iClient == NULL ) { - TBuf8 nullBuf; + TBuf8 nullBuf; ret = CreateClient( iClientUid, nullBuf ); } @@ -947,11 +960,11 @@ { DEBUG("CHotSpotSession::ProcessCloseL"); TInt ret( KErrNone ); - TUid clientUid; TBuf8 extAPI; - - iIapSettingsHandler->FindClientL( aIapId, clientUid, extAPI ); - if ( clientUid == TUid::Null() ) + TBuf clientUid; + + TInt err = iServer.GetClientUid( aIapId, clientUid ); + if ( err != KErrNone ) { DEBUG("CHotSpotSession::ProcessCloseL clientUid = EMPTY"); // do nothing @@ -962,8 +975,15 @@ DEBUG("CHotSpotSession::ProcessCloseL clientUid = CLIENT"); if ( iClient == NULL ) { + //Convert TBuf to TUid + TLex lex( clientUid ); + TUint value( 0 ); + lex.Val( value, EHex ); + iClientUid = TUid::Null(); + iClientUid.iUid = value; TBuf8 nullBuf; - ret = CreateClient( clientUid, nullBuf ); + + ret = CreateClient( iClientUid, nullBuf ); } else { @@ -1111,22 +1131,36 @@ } // ----------------------------------------------------------------------------- -// EasyWlanIdL +// ModifyClientUid // ----------------------------------------------------------------------------- // -void CHotSpotSession::EasyWlanIdL() +void CHotSpotSession::ModifyClientUid( TDes& aUid ) { - DEBUG("CHotSpotSession::EasyWlanIdL()"); - // Set to default value just in case - iEasyWlanId = KEasyWlanServiceId; - - RCmManagerExt cmManager; - cmManager.OpenL(); - CleanupClosePushL( cmManager ); - - iEasyWlanId = cmManager.EasyWlanIdL(); - DEBUG1("CHotSpotSession::EasyWlanIdL() ret: % d", iEasyWlanId); - CleanupStack::PopAndDestroy( &cmManager ); + DEBUG("CHotSpotSession::ModifyClientUid"); + TInt indx = aUid.Find( KMark1 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + indx = aUid.Find( KMark2 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + } + } + } + +// ----------------------------------------------------------------------------- +// ConvertTBufToTUid +// ----------------------------------------------------------------------------- +// +void CHotSpotSession::ConvertTBufToTUid( TDes& aUid ) + { + DEBUG("CHotSpotSession::ConvertTBufToTUid"); + TLex lex( aUid ); + TUint value( 0 ); + lex.Val( value, EHex ); + iClientUid = TUid::Null(); + iClientUid.iUid = value; } // ----------------------------------------------------------------------------- @@ -1137,32 +1171,32 @@ { DEBUG1( "CHotSpotSession::ConnectionStateChanged() aNewState=%d", aNewState ); switch ( aNewState ) + { + case EWlanConnectionModeSearching: { - case EWlanConnectionModeSearching: - { - break; - } - case EWlanConnectionModeInfrastructure: - case EWlanConnectionModeSecureInfra: - { - iMgtClient->CancelNotifications(); - ProcessAssociationStatus( iIapId, ETrue ); - break; - } - case EWlanConnectionModeAdhoc: - case EWlanConnectionModeNotConnected: - { - iMgtClient->CancelNotifications(); - iServer.SetAssociationFlag( EFalse ); - break; - } - default: - { - iMgtClient->CancelNotifications(); - iServer.SetAssociationFlag( EFalse ); - } + break; + } + case EWlanConnectionModeInfrastructure: + case EWlanConnectionModeSecureInfra: + { + iMgtClient->CancelNotifications(); + ProcessAssociationStatus( iIapId, ETrue ); + break; } - + case EWlanConnectionModeAdhoc: + case EWlanConnectionModeNotConnected: + { + iMgtClient->CancelNotifications(); + iServer.SetAssociationFlag( EFalse ); + break; + } + default: + { + iMgtClient->CancelNotifications(); + iServer.SetAssociationFlag( EFalse ); + } + } + } // end of file diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/hsserver/src/hssiapsettingshandler.cpp --- a/hotspotfw/hsserver/src/hssiapsettingshandler.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/hsserver/src/hssiapsettingshandler.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -77,8 +77,8 @@ // ----------------------------------------------------------------------------- // void CHssIapSettingsHandler::CreateClientIapL( const TDesC& aIapName, - TUint32& aIapId, - const TUid aUid ) + TUint32& aIapId, + const TDesC& aUid ) { DEBUG("CHssIapSettingsHandler::CreateClientIapL"); @@ -106,7 +106,7 @@ plugin.SetStringAttributeL( ECmName, aIapName ); plugin.SetStringAttributeL( EWlanSSID, aIapName ); - plugin.SetStringAttributeL( EWlanServiceExtensionTableName, aUid.Name() ); + plugin.SetStringAttributeL( EWlanServiceExtensionTableName, aUid ); plugin.SetStringAttributeL( ECmConfigDaemonManagerName, KHotSpotPlugin ); plugin.SetBoolAttributeL( ECmProtected, ETrue ); @@ -234,60 +234,11 @@ CleanupClosePushL( plugin ); cmManager.RemoveAllReferencesL( plugin ); - CleanupStack::Pop( &plugin ); - TBool result = plugin.DeleteL(); - DEBUG1("CHssIapSettingsHandler:::DeleteIapL result = %d ", result); - - CleanupStack::PopAndDestroy( &cmManager ); - } -// ----------------------------------------------------------------------------- -// FindClientL -// ----------------------------------------------------------------------------- -// -TInt CHssIapSettingsHandler::FindClientL( const TUint aIapId, TUid& aUid, TDes8& aUidText ) - { - DEBUG("CHssIapSettingsHandler::FindClientL"); - TInt ret( KErrNone ); - aUid = TUid::Null(); - RCmManagerExt cmManager; - cmManager.OpenL(); - CleanupClosePushL( cmManager ); - - RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapId ); - CleanupClosePushL( plugin ); - - HBufC* uid = plugin.GetStringAttributeL( EWlanServiceExtensionTableName ); - - TBuf8 buffer; - buffer.Copy( *uid ); - delete uid; - // Find and remove [ and ]. - // If found [ it's known that buffer contains UID - TInt indx = buffer.Find( KMark1 ); - if ( KErrNotFound != indx ) - { - DEBUG("CHssIapSettingsHandler::FindClientL Client is found"); - buffer.Delete( indx, 1 ); - indx = buffer.Find( KMark2 ); - if ( KErrNotFound != indx ) - { - buffer.Delete( indx, 1 ); - } - // Convert TBuf to TUid - TLex8 lex( buffer ); - TUint value( 0 ); - User::LeaveIfError( lex.Val( value, EHex ) ); - aUid.iUid = value; - aUidText = buffer; - } - - CleanupStack::PopAndDestroy( &plugin ); // Close() called on "plugin" + DEBUG1("CHssIapSettingsHandler:::DeleteIapL result = %d ", result); + CleanupStack::PopAndDestroy( &plugin ); CleanupStack::PopAndDestroy( &cmManager ); - DEBUG("CHssIapSettingsHandler::FindClientL"); - - return ret; } // --------------------------------------------------------- diff -r c2bc3f8c7777 -r dff6ebfd236f hotspotfw/internetconnectivitytestservice/src/ictshttphandler.cpp --- a/hotspotfw/internetconnectivitytestservice/src/ictshttphandler.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/hotspotfw/internetconnectivitytestservice/src/ictshttphandler.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -90,6 +90,11 @@ CIctsHttpHandler::~CIctsHttpHandler() { DEBUG("CIctsHttpHandler::~CIctsHttpHandler()"); + RHTTPTransaction notActive; + if ( iHttpTransaction != notActive ) + { + iHttpTransaction.Close(); + } iHttpSession.Close(); CTimer::Cancel(); iConnection.Close(); @@ -243,7 +248,11 @@ { DEBUG("CIctsHttpHandler::CancelHttpRequestL()"); CTimer::Cancel(); - iHttpTransaction.Cancel(); + RHTTPTransaction notActive; + if ( iHttpTransaction != notActive ) + { + iHttpTransaction.Close(); + } } // --------------------------------------------------------------------------- @@ -253,7 +262,11 @@ void CIctsHttpHandler::RunL() { DEBUG("CIctsHttpHandler::RunL()"); - iHttpSession.Close(); + RHTTPTransaction notActive; + if ( iHttpTransaction != notActive ) + { + iHttpTransaction.Close(); + } iString = KNullDesC; iOwner.HttpEventL( ETimeout, iString ); } @@ -296,10 +309,6 @@ { DEBUG("CIctsHttpHandler::THTTPEvent::ESucceeded"); CTimer::Cancel(); - // Indicates that transaction succeeded. - // Transaction can be closed now. It's not needed anymore. - aTransaction.Close(); - iHttpSession.Close(); iOwner.HttpEventL( EConnectionOk, iString ); iString = KNullDesC; } @@ -332,23 +341,17 @@ RStringF fieldValStr = strP.StringF(hVal.StrF()); const TDesC8& fieldValDesC = fieldValStr.DesC(); iString.Copy(fieldValDesC); - aTransaction.Close(); - iHttpSession.Close(); iOwner.HttpEventL( EHttpAuthenticationNeeded, iString ); } else { // No location header. Can't use authentication -> redirect. - aTransaction.Close(); - iHttpSession.Close(); iOwner.HttpEventL( EConnectionNotOk, iString ); } } else { // Failed for other reason than redirect - aTransaction.Close(); - iHttpSession.Close(); iOwner.HttpEventL( EConnectionNotOk, iString ); } @@ -371,24 +374,21 @@ break; default: - { - DEBUG1( "CIctsHttpHandler::MHFRunL::default iStatus: %d", aEvent.iStatus ); - CTimer::Cancel(); - aTransaction.Close(); - iHttpSession.Close(); - // close the transaction if it's an error - if ( aEvent.iStatus < 0 ) - { - _LIT(string, "Unknown error"); - iString = string; - iOwner.HttpEventL( EConnectionNotOk, iString ); - } - else - { - _LIT(string, "Default"); - iString = string; - iOwner.HttpEventL( EConnectionNotOk, iString ); - } + { + DEBUG1( "CIctsHttpHandler::MHFRunL::default iStatus: %d", aEvent.iStatus ); + CTimer::Cancel(); + if ( aEvent.iStatus < 0 ) + { + _LIT(string, "Unknown error"); + iString = string; + iOwner.HttpEventL( EConnectionNotOk, iString ); + } + else + { + _LIT(string, "Default"); + iString = string; + iOwner.HttpEventL( EConnectionNotOk, iString ); + } } break; } diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlanplugin/group/wlanplugin.mmp --- a/wlanutilities/wlanplugin/group/wlanplugin.mmp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlanplugin/group/wlanplugin.mmp Fri Mar 12 15:48:54 2010 +0200 @@ -29,14 +29,14 @@ SOURCEPATH ../src SOURCE wlanplugin.cpp SOURCE wlanpluginimplementationtable.cpp -SOURCE wlanpluginwlanstate.cpp +SOURCE wlanpluginwlanstate.cpp SOURCE wlanplugindbobserver.cpp SOURCE wlanplugintimeshifter.cpp USERINCLUDE ../data // Component specific internal headers -USERINCLUDE ../inc +USERINCLUDE ../inc SYSTEMINCLUDE ../../inc //Macro to /epoc32 headers @@ -65,17 +65,18 @@ LIBRARY eikcore.lib LIBRARY commonengine.lib // RConeResourceLoader LIBRARY aknskins.lib // AknsUtils.h +LIBRARY egul.lib LIBRARY GSEcomPlugin.lib LIBRARY apgrfx.lib LIBRARY apparc.lib -LIBRARY ws32.lib -LIBRARY wsfwlaninfo.lib -LIBRARY wsfmodel.lib +LIBRARY ws32.lib +LIBRARY wsfwlaninfo.lib +LIBRARY wsfmodel.lib LIBRARY wsfwlaninfosorting.lib LIBRARY commonui.lib LIBRARY aknnotify.lib LIBRARY eiksrv.lib -LIBRARY COMMSDAT.lib -LIBRARY cmmanagerdatabase.lib +LIBRARY COMMSDAT.lib +LIBRARY cmmanagerdatabase.lib DEBUGLIBRARY flogger.lib diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlanplugin/src/wlanplugin.cpp --- a/wlanutilities/wlanplugin/src/wlanplugin.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlanplugin/src/wlanplugin.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -232,7 +232,7 @@ CGulIcon* CWlanPlugin::CreateIconL( const TUid aIconType ) { - CLOG_ENTERFN( "CWlanPlugin::CreateIconL()" ); + CLOG_ENTERFN( "CWlanPlugin::CreateIconL()" ); TFileName iconsFileName; @@ -245,38 +245,49 @@ TInt pic, picmask; TAknsItemID itemid; //if the main icon is asked - if( aIconType == KGSIconTypeLbxItem ) + if ( aIconType == KGSIconTypeLbxItem ) { - if( iWlanState->GetMainIconL( pic, picmask, itemid ) ) + if ( iWlanState->GetMainIconL( pic, picmask, itemid ) ) { - icon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), - itemid, - iconsFileName, - pic, - picmask ); + icon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), + itemid, + iconsFileName, + pic, + picmask ); } else { icon = CGSPluginInterface::CreateIconL( aIconType ); } } - //if the secondary icon is asked - else if( aIconType == KGSIconTypeDColumn ) + //if the secondary icon is asked + else if ( aIconType == KGSIconTypeDColumn ) { - //if there should be icon - if( iWlanState->GetStrengthIconL( pic, picmask, itemid ) ) + //if there should be icon + if ( iWlanState->GetStrengthIconL( pic, picmask, itemid ) ) { - icon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), - itemid, - iconsFileName, - pic, - picmask ); + icon = CGulIcon::NewLC(); + CFbsBitmap* bitmap; + CFbsBitmap* mask; + // Creates bitmap an icon. + AknsUtils::CreateColorIconL( AknsUtils::SkinInstance(), + itemid, + KAknsIIDQsnIconColors, + EAknsCIQsnIconColorsCG13, + bitmap, + mask, + iconsFileName, + pic, + picmask, + KRgbBlack ); + + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + CleanupStack::Pop( icon ); } - //if there should be no icons - else + //if there should be no icons + else { icon = CGSPluginInterface::CreateIconL( aIconType ); } diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlanplugin/src/wlanpluginwlanstate.cpp --- a/wlanutilities/wlanplugin/src/wlanpluginwlanstate.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlanplugin/src/wlanpluginwlanstate.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -135,8 +135,8 @@ if( iEngine->IsConnectedL() ) { - iConnected = ETrue; iEngine->GetConnectedWlanDetailsL( iConnectedWlanInfo ); + iConnected = iConnectedWlanInfo.Connected(); } iDbObserver = CWlanPluginDbObserver::NewL( this ); @@ -173,10 +173,7 @@ // --------------------------------------------------------- void CWlanPluginWlanState::NotifyEngineError( TInt /*aError*/ ) { - CLOG_ENTERFN( "CWlanPluginWlanState::NotifyEngineError()" ); - - iScanning = EFalse; - + CLOG_ENTERFN( "CWlanPluginWlanState::NotifyEngineError()" ); CLOG_LEAVEFN( "CWlanPluginWlanState::NotifyEngineError()" ); } @@ -188,7 +185,6 @@ CLOG_ENTERFN( "CWlanPluginWlanState::ScanDisabledL()" ); iScanning = EFalse; - //UpdateWlanListL(); UpdateParentViewL(); CLOG_LEAVEFN( "CWlanPluginWlanState::ScanDisabledL()" ); @@ -223,8 +219,8 @@ { CLOG_ENTERFN( "CWlanPluginWlanState::WlanConnectionActivatedL()" ); - iConnected = ETrue; iEngine->GetConnectedWlanDetailsL( iConnectedWlanInfo ); + iConnected = iConnectedWlanInfo.Connected(); UpdateParentViewL(); CLOG_LEAVEFN( "CWlanPluginWlanState::WlanConnectionActivatedL()" ); @@ -700,6 +696,7 @@ if( iConnected ) { iEngine->GetConnectedWlanDetailsL( iConnectedWlanInfo ); + iConnected = iConnectedWlanInfo.Connected(); } iWlanInfoBranding->LoadFilterDefinitionsL(); diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/group/aiplugin.mmp --- a/wlanutilities/wlansniffer/aiplugin/group/aiplugin.mmp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/aiplugin/group/aiplugin.mmp Fri Mar 12 15:48:54 2010 +0200 @@ -38,6 +38,11 @@ SOURCE wsfaiview.cpp SOURCE wsfactivewaiter.cpp SOURCE wsfdbobserver.cpp +SOURCE wsfwlanlistactivewrapper.cpp +SOURCE wsfrefreshscanactivewrapper.cpp +SOURCE wsfdisconnectactivewrapper.cpp +SOURCE wsfconnectactivewrapper.cpp +SOURCE wsfactivewrappers.cpp // Plugin's own resources. @@ -109,3 +114,4 @@ DEBUGLIBRARY flogger.lib // End of File. + diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/inc/wsfactivewrappers.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfactivewrappers.h Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,155 @@ +/* + * 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 CWsfActiveWrappers. + * + */ + + + +#ifndef WSFACTIVEWRAPPERS_H +#define WSFACTIVEWRAPPERS_H + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "wsfcommon.h" +#include "wsfaicontroller.h" +#include "wsfmodel.h" + +// FORWARD DECLARATIONS +class CWsfWLANListActiveWrapper; +class CWsfRefreshScanActiveWrapper; +class CWsfDisconnectActiveWrapper; +class CWsfConnectActiveWrapper; + +// CLASS DECLARATION + +/** + * Active object helper class that capsulates active wrapper classes + * + * @lib wsfaiplugin.lib + * @since S60 v5.2 + * + */ +class CWsfActiveWrappers : public CBase + { +public: + // Constructors and destructor + + /** + * Destructor. + * @since S60 5.2 + */ + ~CWsfActiveWrappers(); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfActiveWrappers* NewL(CWsfModel* aModel, + TWsfAiController &aController); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfActiveWrappers* NewLC(CWsfModel* aModel, + TWsfAiController &aController); + +public: + + /** + * Starts disconnecting + * @since S60 5.2 + */ + void Disconnect(); + + /** + * Starts connecting + * @since S60 5.2 + */ + void Connect(TUint aIapID, TWsfIapPersistence aPersistence); + + /** + * Starts refresh scan + * @since S60 5.2 + */ + void RefreshScan(); + + /** + * Starts wlan list refreshing + * @since S60 5.2 + * @param aStarUp is this called called from plugin start up + */ + void RefreshWLANList( TBool aStarUp ); + + /** + * Returns the list of found WLANs. + * Ownership not passed. + * @since S60 5.2 + * @return Array of WLANs + */ + CWsfWlanInfoArray* GetWLANList(); + + /** + * Returns the connected wlan network + * @since S60 5.2 + * @return TWsfWlanInfo + */ + TWsfWlanInfo GetConnectedWLANNetwork(); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CWsfActiveWrappers(); + + /** + * Constructor for performing 2nd stage construction + */ + void ConstructL( CWsfModel* aModel, TWsfAiController &aController ); + +private: + // Data + + /** + * Pointer to CWsfWLANListActiveWrapper + * Own. + */ + CWsfWLANListActiveWrapper* iWLANListActiveWrapper; + + /** + * Pointer to CWsfRefreshScanActiveWrapper + * Own. + */ + CWsfRefreshScanActiveWrapper* iRefreshScanActiveWrapper; + + /** + * Pointer to CWsfDisconnectActiveWrapper + * Own. + */ + CWsfDisconnectActiveWrapper* iDisconnectActiveWrapper; + + /** + * Pointer to CWsfConnectActiveWrapper + * Own. + */ + CWsfConnectActiveWrapper* iConnectActiveWrapper; + + }; + +#endif // WSFACTIVEWRAPPERS_H diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/inc/wsfaicontroller.h --- a/wlanutilities/wlansniffer/aiplugin/inc/wsfaicontroller.h Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfaicontroller.h Fri Mar 12 15:48:54 2010 +0200 @@ -35,6 +35,7 @@ class TWsfWlanInfo; class CWsfWlanInfoArray; class CWsfDbObserver; +class CWsfActiveWrappers; /** @@ -66,11 +67,13 @@ /** * PreInitialization for this class (set the models references) * @since S60 5.0 - * @param aModel appicaton level model reference + * @param aModel applicaton level model reference * @param aAiModel model reference of AiPlugin + * @param aActiveWrappers reference of wrappers holder */ void InitializeL( CWsfModel* aModel, CWsfAiModel* aAiModel, - CWsfDbObserver* aObserver ); + CWsfDbObserver* aObserver, + CWsfActiveWrappers* aActiveWrappers ); /** * Set the UI for the controller @@ -99,11 +102,18 @@ void DisableScanL(); /** - * Propagates the connected network data from the sniffer model + * Start initial refresh * to the AI model * @since S60 5.0 */ - void StartupRefreshL(); + void StartupRefresh(); + + /** + * Propagates the network data from the engine + * to the AI model + * @since S60 5.0 + */ + void StartupRefreshDataReadyL(); /** * Dismisses the AI menu/other dialogs if there was any open @@ -123,6 +133,13 @@ */ void RefreshConnectingL(); + /** + * Propagates the network data from the engine + * to the AI model + * @since S60 5.0 + */ + void WlanListDataReadyL(); + public: // From MWsfStateChangeObserver @@ -269,11 +286,6 @@ * Refreshes the current ui when the ui changes */ void RefreshUiL(); - - /* - * Disconnect active wlan connections - */ - void DisconnectL(); /** * Handle error event @@ -359,6 +371,12 @@ * Indicates whether access point needs testing */ TBool iTestAccessPoint; + + /** + * A pointer to CWsfActiveWrappers + */ + CWsfActiveWrappers* iActiveWrappers; + }; #endif // T_WSFAICONTROLLER_H diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/inc/wsfaiplugin.h --- a/wlanutilities/wlansniffer/aiplugin/inc/wsfaiplugin.h Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfaiplugin.h Fri Mar 12 15:48:54 2010 +0200 @@ -251,21 +251,6 @@ * @param aPtr Pointer for the observer class */ static void PublishCleanup( TAny* aPtr ); - - /** - * Callback function for carrying out refresh at startup - * @since S60 5.0 - * @param aPtr Pointer to this class - * @return Error code - */ - static TInt StartupRefresh( TAny* aPtr ); - - /** - * Callback function for carrying out refresh at startup - * @since S60 5.0 - * @return Error code - */ - TInt StartupRefreshL(); private: // Data @@ -372,11 +357,6 @@ */ TBool iRefreshing; - /** - * Active Object callback for displaying data at startup - */ - CAsyncCallBack* iStartupRefresh; - /* * The periodic that steps the refreshing animation */ @@ -393,7 +373,12 @@ * Own. */ HBufC* iKnownNetworkFound; - + + /** + * A pointer to CWsfActiveWrappers + */ + CWsfActiveWrappers* iActiveWrappers; + }; diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/inc/wsfconnectactivewrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfconnectactivewrapper.h Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,140 @@ +/* + * 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 CWsfConnectActiveWrapper. + * + */ + +#ifndef CWSFCONNECTACTIVEWRAPPER_H +#define CWSFCONNECTACTIVEWRAPPER_H + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include "wsfaicontroller.h" +#include "wsfcommon.h" + +// FORWARD DECLARATIONS +class CWsfModel; + +/** + * Active object that connects WLAN + * + * @lib wsfaiplugin.lib + * @since S60 v5.2 + */ +class CWsfConnectActiveWrapper : public CActive + { +public: + // Constructors and destructor + + /** + * Destructor + * @since S60 5.2 + */ + ~CWsfConnectActiveWrapper(); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfConnectActiveWrapper* NewL( CWsfModel* aModel ); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfConnectActiveWrapper* NewLC( CWsfModel* aModel ); + +public: + + /** + * Function for making the initial request + * @since S60 5.2 + */ + void Start( TUint aIapID, TWsfIapPersistence aPersistence ); + +private: + + /** + * constructor + */ + CWsfConnectActiveWrapper(); + + /** + * Factory function. + * @since S60 5.2 + * @param aModel CWsfModel pointer + */ + void ConstructL( CWsfModel* aModel ); + +private: + // From CActive + /** + * @see CActive + */ + void RunL(); + + /** + * @see CActive + */ + void DoCancel(); + + /** + * @see CActive + */ + TInt RunError( TInt aError ); + +private: + /** + * States of the active object + */ + enum CWsfConnectActiveWrapperState + { + EUninitialized, // Uninitialized + EInitialized, // Initalized + EError + // Error condition + }; + +private: + + /** + * State of the active object + */ + TInt iState; // State of the active object + + /** + * Result + */ + TPckgBuf iPckg; + + /** + * Reference to Model + */ + CWsfModel* iModel; + + /** + * IAP ID + */ + TUint iIapID; + + /** + * Persistence value of IAP + */ + TWsfIapPersistence iPersistence; + + }; + +#endif // CWSFCONNECTACTIVEWRAPPER_H diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/inc/wsfdisconnectactivewrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfdisconnectactivewrapper.h Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,129 @@ +/* + * 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 CWsfDisconnectActiveWrapper. + * + */ + +#ifndef CWSFDISCONNECTACTIVEWRAPPER_H +#define CWSFDISCONNECTACTIVEWRAPPER_H + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include "wsfaicontroller.h" + +// FORWARD DECLARATIONS +class CWsfModel; + +/** + * Active object that disconnects wlan + * + * @lib wsfaiplugin.lib + * @since S60 v5.2 + */ +class CWsfDisconnectActiveWrapper : public CActive + { +public: + // Constructors and destructor + + /** + * Destructor + * @since S60 5.2 + */ + ~CWsfDisconnectActiveWrapper(); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfDisconnectActiveWrapper* NewL( CWsfModel* aModel ); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfDisconnectActiveWrapper* NewLC( CWsfModel* aModel ); + +public: + + /** + * Function for making the initial request + * @since S60 5.2 + */ + void Start(); + +private: + + /** + * constructor + */ + CWsfDisconnectActiveWrapper(); + + /** + * Factory function. + * @since S60 5.2 + * @param aModel CWsfModel pointer + */ + void ConstructL( CWsfModel* aModel ); + +private: + // From CActive + /** + * @see CActive + */ + void RunL(); + + /** + * @see CActive + */ + void DoCancel(); + + /** + * @see CActive + */ + TInt RunError( TInt aError ); + +private: + /** + * States of the active object + */ + enum CWsfDisconnectActiveWrapperState + { + EUninitialized, // Uninitialized + EInitialized, // Initalized + EError + // Error condition + }; + +private: + + /** + * State of the active object + */ + TInt iState; // State of the active object + + /** + * Request result + */ + TPckgBuf iPckg; + + /** + * Reference to Model + */ + CWsfModel* iModel; + + }; + +#endif // CWSFDISCONNECTACTIVEWRAPPER_H diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/inc/wsfrefreshscanactivewrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfrefreshscanactivewrapper.h Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,129 @@ +/* + * 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 CWsfRefreshScanActiveWrapper. + * + */ + +#ifndef CWSFREFRESHSCANACTIVEWRAPPER_H +#define CWSFREFRESHSCANACTIVEWRAPPER_H + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include "wsfaicontroller.h" + +// FORWARD DECLARATIONS +class CWsfModel; + +/** + * Active object that requests scans + * + * @lib wsfaiplugin.lib + * @since S60 v5.2 + */ +class CWsfRefreshScanActiveWrapper : public CActive + { +public: + // Constructors and destructor + + /** + * Destructor + * @since S60 5.2 + */ + ~CWsfRefreshScanActiveWrapper(); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfRefreshScanActiveWrapper* NewL(CWsfModel* aModel); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfRefreshScanActiveWrapper* NewLC(CWsfModel* aModel); + +public: + + /** + * Function for making the initial request + * @since S60 5.2 + */ + void Start(); + +private: + + /** + * constructor + */ + CWsfRefreshScanActiveWrapper(); + + /** + * Factory function. + * @since S60 5.0 + * @param aModel CWsfModel pointer + */ + void ConstructL(CWsfModel* aModel); + +private: + // From CActive + /** + * @see CActive + */ + void RunL(); + + /** + * @see CActive + */ + void DoCancel(); + + /** + * @see CActive + */ + TInt RunError(TInt aError); + +private: + /** + * States of the active object + */ + enum CWsfRefreshScanActiveWrapperState + { + EUninitialized, // Uninitialized + EInitialized, // Initalized + EError + // Error condition + }; + +private: + + /** + * State of the active object + */ + TInt iState; // State of the active object + + /** + * Request result + */ + TPckgBuf iPckg; + + /** + * Reference to Model + */ + CWsfModel* iModel; + + }; + +#endif // CWSFREFRESHSCANACTIVEWRAPPER_H diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/inc/wsfwlanlistactivewrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/inc/wsfwlanlistactivewrapper.h Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,195 @@ +/* + * 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 CWsfWLANListActiveWrapper. + * + */ + +#ifndef CWSFWLANLISTACTIVEWRAPPER_H +#define CWSFWLANLISTACTIVEWRAPPER_H + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include "wsfaicontroller.h" + +// FORWARD DECLARATIONS +class CWsfModel; +class CWsfWlanInfoArray; + +/** + * Active object that fetches wlan list data + * + * @lib wsfaiplugin.lib + * @since S60 v5.2 + */ +class CWsfWLANListActiveWrapper : public CActive + { +public: // Constructors and destructor + + /** + * Destructor + * @since S60 5.2 + */ + ~CWsfWLANListActiveWrapper(); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfWLANListActiveWrapper* NewL( CWsfModel* aModel, + TWsfAiController &aController ); + + /** + * Two-phased constructor. + * @since S60 5.2 + */ + static CWsfWLANListActiveWrapper* NewLC( CWsfModel* aModel, + TWsfAiController &aController ); + +public: + /** + * Function for making the initial request + * @since S60 5.2 + * @param aStarUp is start called from plugin start up + */ + void Start( TBool aStarUp ); + + /** + * Returns the list of found WLANs. + * Ownership not passed. + * @since S60 5.2 + * @return Array of WLANs + */ + CWsfWlanInfoArray* GetWlanList(); + + /** + * Returns the connected WLAN network + * @since S60 5.2 + * @return TWsfWlanInfo + */ + TWsfWlanInfo GetConnectedWLANNetwork(); + +private: + + /** + * constructor + */ + CWsfWLANListActiveWrapper(); + + /** + * Factory function. + * @since S60 5.2 + * @param aModel Whether to react to screensaver events + * @param aController Whether to react to screensaver events + */ + void ConstructL( CWsfModel* aModel, TWsfAiController &aController ); + +private: // From CActive + + /** + * @see CActive + */ + void RunL(); + + /** + * @see CActive + */ + void DoCancel(); + + /** + * @see CActive + */ + TInt RunError( TInt aError ); + +private: + + /** + * States of the active object + */ + enum TCWsfWLANListActiveWrapperState + { + EUninitialized, // Uninitialized + EInitialized, // Initalized + EProcessWLANListData, // Create wlan array from results + EGetConnectedNetwork, // Request connected network + EError + // Error condition + }; + +private: + + /** + * State of the active object + */ + TInt iState; // State of the active object + + /** + * Needed size to allocate result data + */ + TPckgBuf iPckgNeededSize; + + /** + * Data size in engine + */ + TPckgBuf iPckgAllocatedSize; + + /** + * Connected network request result + */ + TPckgBuf iPckg; + + /** + * Reference to Model + */ + CWsfModel* iModel; + + /** + * Array to store WLAN scan results. Owned. + */ + CWsfWlanInfoArray* iArray; + + /** + * TPtr to wlan data + */ + TPtr8 iPtr; + + /** + * Wlan data buffer + */ + HBufC8* iBuffer; + + /** + * Pointer to TWsfAiController + */ + TWsfAiController *iController; + + /** + * Is this object called from plugin startup + */ + TBool iStartUp; + + /** + * Retries to fetch data + */ + TInt iRetriesLeft; + + /** + * Cache of the connected WLAN data + */ + TWsfWlanInfo iConnectedWlan; + + }; + +#endif // CWSFWLANLISTACTIVEWRAPPER_H diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/src/wsfactivewrappers.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfactivewrappers.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,165 @@ +/* + * 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 CWsfActiveWrappers. + * + */ + + + +// INCLUDE FILES +#include "wsflogger.h" +#include "wsfactivewrappers.h" +#include "wsfwlanlistactivewrapper.h" +#include "wsfrefreshscanactivewrapper.h" +#include "wsfdisconnectactivewrapper.h" +#include "wsfconnectactivewrapper.h" + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::CWsfActiveWrappers +// ---------------------------------------------------------------------------- +// +CWsfActiveWrappers::CWsfActiveWrappers() + { + // No implementation required + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::~CWsfActiveWrappers +// ---------------------------------------------------------------------------- +// +CWsfActiveWrappers::~CWsfActiveWrappers() + { + delete iWLANListActiveWrapper; + delete iRefreshScanActiveWrapper; + delete iDisconnectActiveWrapper; + delete iConnectActiveWrapper; + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::NewLC +// ---------------------------------------------------------------------------- +// +CWsfActiveWrappers* CWsfActiveWrappers::NewLC( CWsfModel* aModel, + TWsfAiController &aController ) + { + LOG_ENTERFN( "CWsfActiveWrappers::NewLC" ); + CWsfActiveWrappers* self = new (ELeave) CWsfActiveWrappers(); + CleanupStack::PushL( self ); + self->ConstructL( aModel,aController ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::NewL +// ---------------------------------------------------------------------------- +// +CWsfActiveWrappers* CWsfActiveWrappers::NewL( CWsfModel* aModel, + TWsfAiController &aController ) + { + LOG_ENTERFN( "CWsfActiveWrappers::NewL" ); + CWsfActiveWrappers* self = CWsfActiveWrappers::NewLC( aModel, aController ); + CleanupStack::Pop(); // self; + return self; + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::ConstructL +// ---------------------------------------------------------------------------- +// +void CWsfActiveWrappers::ConstructL( CWsfModel* aModel, + TWsfAiController &aController ) + { + LOG_ENTERFN( "CWsfActiveWrappers::ConstructL" ); + iWLANListActiveWrapper = CWsfWLANListActiveWrapper::NewL( aModel, + aController ); + + iRefreshScanActiveWrapper = CWsfRefreshScanActiveWrapper::NewL( aModel ); + + iDisconnectActiveWrapper = CWsfDisconnectActiveWrapper::NewL( aModel ); + + iConnectActiveWrapper = CWsfConnectActiveWrapper::NewL( aModel ); + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::Disconnect +// ---------------------------------------------------------------------------- +// +void CWsfActiveWrappers::Disconnect() + { + LOG_ENTERFN( "CWsfActiveWrappers::Disconnect" ); + iDisconnectActiveWrapper->Start(); + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::Connect +// ---------------------------------------------------------------------------- +// +void CWsfActiveWrappers::Connect( TUint aIapID, TWsfIapPersistence aPersistence ) + { + LOG_ENTERFN( "CWsfActiveWrappers::Connect" ); + iConnectActiveWrapper->Start( aIapID, aPersistence ); + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::RefreshScan +// ---------------------------------------------------------------------------- +// +void CWsfActiveWrappers::RefreshScan() + { + LOG_ENTERFN( "CWsfActiveWrappers::RefreshScan" ); + iRefreshScanActiveWrapper->Start(); + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::RefreshWLANList +// ---------------------------------------------------------------------------- +// +void CWsfActiveWrappers::RefreshWLANList( TBool aStarUp ) + { + LOG_ENTERFN( "CWsfActiveWrappers::RefreshWLANList" ); + iWLANListActiveWrapper->Start( aStarUp ); + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::GetWLANList +// ---------------------------------------------------------------------------- +// +CWsfWlanInfoArray* CWsfActiveWrappers::GetWLANList() + { + LOG_ENTERFN( "CWsfActiveWrappers::GetWLANList" ); + return iWLANListActiveWrapper->GetWlanList(); + } + + +// ---------------------------------------------------------------------------- +// CWsfActiveWrappers::GetConnectedWLANNetwork +// ---------------------------------------------------------------------------- +// +TWsfWlanInfo CWsfActiveWrappers::GetConnectedWLANNetwork() + { + LOG_ENTERFN( "CWsfActiveWrappers::GetConnectedWLANNetwork" ); + return iWLANListActiveWrapper->GetConnectedWLANNetwork(); + } + + diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/src/wsfaicontroller.cpp --- a/wlanutilities/wlansniffer/aiplugin/src/wsfaicontroller.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfaicontroller.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -16,6 +16,7 @@ */ + // EXTERNAL INCLUDES #include #include @@ -49,6 +50,7 @@ #include "wsfactivewaiter.h" #include "wsflogger.h" #include "wsfdbobserver.h" +#include "wsfactivewrappers.h" // MACROS @@ -98,8 +100,6 @@ void TWsfAiController::DeInitializeL() { LOG_ENTERFN( "TWsfAiController::DeInitializeL" ); - iModel->AbortConnectingL(); - iModel->AbortScanningL(); } @@ -108,17 +108,17 @@ // -------------------------------------------------------------------------- // void TWsfAiController::InitializeL( CWsfModel* aModel, CWsfAiModel* aAiModel, - CWsfDbObserver* aObserver ) + CWsfDbObserver* aObserver, + CWsfActiveWrappers* aActiveWrappers ) { LOG_ENTERFN( "TWsfAiController::InitializeL" ); iModel = aModel; iAiModel = aAiModel; iDbObserver = aObserver; + iActiveWrappers = aActiveWrappers; iDbObserver->SetController( this ); iDbObserver->ActivateItL(); iModel->SetEngineObserver( this ); - - iAiModel->SetConnected( iModel->IsConnectedL() ); } @@ -198,16 +198,31 @@ // -------------------------------------------------------------------------- -// TWsfAiController::StartupRefreshL +// TWsfAiController::StartupRefresh // -------------------------------------------------------------------------- // -void TWsfAiController::StartupRefreshL() +void TWsfAiController::StartupRefresh() { - LOG_ENTERFN( "TWsfAiController::StartupRefreshL" ); - iModel->GetConnectedWlanDetailsL( iConnectedWlan ); + LOG_ENTERFN( "TWsfAiController::StartupRefresh" ); + iActiveWrappers->RefreshWLANList( ETrue ); + } + + +// -------------------------------------------------------------------------- +// TWsfAiController::StartupRefreshDataReadyL +// -------------------------------------------------------------------------- +// +void TWsfAiController::StartupRefreshDataReadyL() + { + LOG_ENTERFN( "TWsfAiController::StartupRefreshDataReadyL" ); + + iInfoArray = iActiveWrappers->GetWLANList(); + iConnectedWlan = iActiveWrappers->GetConnectedWLANNetwork(); + iAiModel->SetConnected( iConnectedWlan.Connected() ); iAiModel->SetConnectedWlanInfo( iConnectedWlan ); - iInfoArray = iModel->GetWlanListL(); + LOG_WRITEF( "Connected = %d", iConnectedWlan.Connected() ); + MDesCArray* data = iAiModel->FormatSingleLineWlanListL( iInfoArray ); // index value to suppress 1 second refreshing state @@ -304,6 +319,32 @@ return; } + iActiveWrappers->RefreshWLANList( EFalse ); + } + + +// -------------------------------------------------------------------------- +// TWsfAiController::WlanListDataReadyL +// -------------------------------------------------------------------------- +// +void TWsfAiController::WlanListDataReadyL() + { + LOG_ENTERFN("TWsfAiController::WlanListDataReadyL" ); + + _ASS_D( iAiModel ); + + iInfoArray = iActiveWrappers->GetWLANList(); + iConnectedWlan = iActiveWrappers->GetConnectedWLANNetwork(); + iAiModel->SetConnected( iConnectedWlan.Connected() ); + iAiModel->SetConnectedWlanInfo( iConnectedWlan ); + + LOG_WRITEF( "Connected = %d", iConnectedWlan.Connected() ); + + if ( !iAiModel->ScanningOn() && !iAiModel->Connected() ) + { + return; + } + _ASS_D( iModel ); _ASS_D( iUi ); @@ -325,10 +366,6 @@ } } } - iInfoArray = iModel->GetWlanListL(); - TBool connected = iModel->GetConnectedWlanDetailsL( iConnectedWlan ); - iAiModel->SetConnected( connected ); - iAiModel->SetConnectedWlanInfo( iConnectedWlan ); MDesCArray* data = iUi->MultilineControl() ? iAiModel->FormatWlanListL( iInfoArray, ETrue ): @@ -388,7 +425,7 @@ void TWsfAiController::ScanEnabledL() { LOG_ENTERFN( "TWsfAiController::ScanEnabledL" ); - iModel->RefreshScanL(); + iActiveWrappers->RefreshScan(); } @@ -401,12 +438,10 @@ { LOG_ENTERFN( "TWsfAiController::WlanConnectionActivatedL" ); iModel->SetConnecting( EFalse ); - iModel->GetConnectedWlanDetailsL( iConnectedWlan ); - iAiModel->SetConnectedWlanInfo( iConnectedWlan ); iAiModel->SetConnected( ETrue ); iAiModel->SetConnecting( EFalse ); - RefreshUiL(); + iActiveWrappers->RefreshWLANList( EFalse ); } @@ -422,25 +457,7 @@ iAiModel->SetConnecting( EFalse ); if ( iAiModel->ScanningOn() ) { - // update the model and refresh ui - if ( iInfoArray ) - { - // check if the array has any items - if ( iInfoArray->Count() ) - { - iInfoArray->SortArrayL(); - TWsfWlanInfo* firstItem = iInfoArray->At( KFirstItemArrayIndex ); - if ( firstItem && firstItem->Connected() ) - { - firstItem->iConnectionState = ENotConnected; - } - } - } - // Abort current scan if exists so that we get - // newest scan results propagated to ui - iModel->AbortScanningL(); - iModel->RefreshScanL(); - RefreshUiL(); + iActiveWrappers->RefreshWLANList( EFalse ); } else { @@ -468,7 +485,6 @@ if ( aResult == KErrNone ) { iAiModel->SetConnected( ETrue ); - iModel->FinalizeConnectL(); if ( !iShouldConnectOnly ) { StartWebBrowserL( iUsedInfo ); @@ -482,7 +498,6 @@ { iAiModel->SetConnected( EFalse ); } - RefreshUiL(); // pop cleanup item CleanupStack::Pop(); } @@ -624,15 +639,16 @@ // Connect if ( iUsedInfo.iIapId ) { - TInt result = KErrNone; - result = iModel->ConnectWithoutConnWaiterL( iUsedInfo.iIapId, - !iTestAccessPoint ); + if ( iTestAccessPoint ) + { + iActiveWrappers->Connect( iUsedInfo.iIapId, EIapExpireOnDisconnect ); + + } + else + { + iActiveWrappers->Connect( iUsedInfo.iIapId, EIapPersistent ); + } - if ( result != KErrNone ) - { - LOG_WRITEF( "Connect failed with error = %d", result ); - User::Leave( result ); - } } // pop cleanup item CleanupStack::Pop(); @@ -794,8 +810,9 @@ // the dialog is ready to receive data... iUi = dialog; - iUi->UpdateHotSpotsL( iAiModel->FormatWlanListL( iModel->GetWlanListL(), EFalse ), - KFirstItemArrayIndex ); + iUi->UpdateHotSpotsL( iAiModel->FormatWlanListL( + iActiveWrappers->GetWLANList(), EFalse ), + KFirstItemArrayIndex ); return dialog->RunLD(); } @@ -846,6 +863,8 @@ } iModel->EnableScanL(); iAiModel->SetScanningOn(); + + LOG_WRITE( "DbObserver enable scan" ); iDbObserver->EnableScanL(); MDesCArray *data = iAiModel->FormatRefreshingL(); @@ -877,20 +896,6 @@ // -------------------------------------------------------------------------- -// TWsfAiController::DisconnectL -// -------------------------------------------------------------------------- -// -void TWsfAiController::DisconnectL() - { - LOG_ENTERFN( "TWsfAiController::DisconnectL" ); - - _ASS_D( iModel ); - - iModel->DisconnectL(); - } - - -// -------------------------------------------------------------------------- // TWsfAiController::DoHandleEngineErrorL // -------------------------------------------------------------------------- // @@ -1163,7 +1168,7 @@ else if ( selectedMode == EAiConnectedDisconnect ) { // disconnect wlan - iModel->DisconnectL(); + iActiveWrappers->Disconnect(); } } } @@ -1188,17 +1193,17 @@ { if ( selectedMode == EAiConnectingDisconnect ) { - if ( iModel->IsConnectedL() ) + if ( !iModel->IsConnecting() ) { // disconnect wlan - iModel->DisconnectL(); + iActiveWrappers->Disconnect(); } else { // disconnect wlan - iModel->AbortConnectingL(); + iModel->AbortConnectingL(); + ConnectingFinishedL( KErrCancel ); } - ConnectingFinishedL( KErrCancel ); } } } @@ -1229,7 +1234,7 @@ else if ( selectedMode == EAiBrowsingDisconnect ) { // disconnect wlan - iModel->DisconnectL(); + iActiveWrappers->Disconnect(); } } } diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/src/wsfaiplugin.cpp --- a/wlanutilities/wlansniffer/aiplugin/src/wsfaiplugin.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfaiplugin.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -46,6 +46,7 @@ #include "wsficonarraycreator.h" #include "wsfdbobserver.h" #include "wsflogger.h" +#include "wsfactivewrappers.h" // define icon id for Navigation Bar icon @@ -80,6 +81,7 @@ // CWsfAiPlugin::~CWsfAiPlugin() { + LOG_ENTERFN( "CWsfAiPlugin::~CWsfAiPlugin" ); // Cancel periodic animation update if ( iAnimationPeriodic ) { @@ -91,14 +93,7 @@ delete iDbObserver; - // Cancel start up refresh - if ( iStartupRefresh ) - { - LOG_WRITE( "Cancel start up refresh" ); - iStartupRefresh->Cancel(); - delete iStartupRefresh; - iStartupRefresh = NULL; - } + delete iActiveWrappers; delete iModel; delete iAiModel; @@ -164,12 +159,15 @@ // then model iAiModel = CWsfAiModel::NewL(); iUi = CWsfAiView::NewL( *this ); - iStartupRefresh = new (ELeave) CAsyncCallBack( - TCallBack( StartupRefresh, this ), - CActive::EPriorityIdle ); + iDbObserver = CWsfDbObserver::NewL(); + + iActiveWrappers = CWsfActiveWrappers::NewL( iModel, iController ); + iController.SetUi( *static_cast( iUi ) ); - iController.InitializeL( iModel, iAiModel, iDbObserver ); + + iController.InitializeL( iModel, iAiModel, iDbObserver, + iActiveWrappers ); } @@ -419,7 +417,7 @@ void CWsfAiPlugin::Start( TStartReason /*aReason*/ ) { LOG_ENTERFN( "CWsfAiPlugin::Start"); - iStartupRefresh->CallBack(); + iController.StartupRefresh(); } // -------------------------------------------------------------------------- @@ -452,7 +450,7 @@ if ( !iAiModel->Connected() && !iModel->IsConnecting() ) { LOG_WRITE( "Call Refresh scan" ); - TRAP_IGNORE( iModel->RefreshScanL() ); + iActiveWrappers->RefreshScan(); } else { @@ -864,32 +862,6 @@ // --------------------------------------------------------------------------- -// CWsfAiPlugin::StartupRefresh -// --------------------------------------------------------------------------- -// -TInt CWsfAiPlugin::StartupRefresh( TAny* aPtr ) - { - LOG_ENTERFN( "CWsfAiPlugin::StartupRefresh" ); - CWsfAiPlugin* self = static_cast( aPtr ); - TRAP_IGNORE( self->StartupRefreshL(); ); - - return 0; - } - - -// --------------------------------------------------------------------------- -// CWsfAiPlugin::StartupRefreshL -// --------------------------------------------------------------------------- -// -TInt CWsfAiPlugin::StartupRefreshL() - { - LOG_ENTERFN( "CWsfAiPlugin::StartupRefresh" ); - iController.StartupRefreshL(); - - return 0; - } - -// --------------------------------------------------------------------------- // CWsfAiPlugin::DoRefreshingStepL // --------------------------------------------------------------------------- // diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/src/wsfconnectactivewrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfconnectactivewrapper.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,166 @@ +/* +* 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 CWsfConnectActiveWrapper. +* +*/ + + + +// INCLUDE FILES +#include "wsflogger.h" +#include "wsfmodel.h" +#include "wsfwlaninfoarray.h" +#include "wsfconnectactivewrapper.h" + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::CWsfConnectActiveWrapper +// -------------------------------------------------------------------------- +// +CWsfConnectActiveWrapper::CWsfConnectActiveWrapper() : + CActive(EPriorityStandard) // Standard priority + { + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::NewLC +// -------------------------------------------------------------------------- +// +CWsfConnectActiveWrapper* CWsfConnectActiveWrapper::NewLC( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfConnectActiveWrapper::NewLC" ); + CWsfConnectActiveWrapper* self = + new (ELeave) CWsfConnectActiveWrapper(); + CleanupStack::PushL(self); + self->ConstructL( aModel ); + return self; + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::NewL +// -------------------------------------------------------------------------- +// +CWsfConnectActiveWrapper* CWsfConnectActiveWrapper::NewL( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfConnectActiveWrapper::NewL" ); + CWsfConnectActiveWrapper* self = + CWsfConnectActiveWrapper::NewLC( aModel ); + CleanupStack::Pop(); // self; + return self; + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::ConstructL +// -------------------------------------------------------------------------- +// +void CWsfConnectActiveWrapper::ConstructL( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfConnectActiveWrapper::ConstructL" ); + CActiveScheduler::Add(this); // Add to scheduler + iModel = aModel; + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::~CWsfConnectActiveWrapper +// -------------------------------------------------------------------------- +// +CWsfConnectActiveWrapper::~CWsfConnectActiveWrapper() + { + LOG_ENTERFN( + "CWsfConnectActiveWrapper::~CWsfConnectActiveWrapper" ); + Cancel(); // Cancel any request, if outstanding + // Delete instance variables if any + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::DoCancel +// -------------------------------------------------------------------------- +// +void CWsfConnectActiveWrapper::DoCancel() + { + LOG_ENTERFN( "CWsfConnectActiveWrapper::DoCancel" ); + TRAP_IGNORE( iModel->AbortConnectingL() ); + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::StartL +// -------------------------------------------------------------------------- +// +void CWsfConnectActiveWrapper::Start(TUint aIapID, TWsfIapPersistence aPersistence ) + { + LOG_ENTERFN( "CWsfConnectActiveWrapper::Start" ); + Cancel(); // Cancel any request, just to be sure + iState = EUninitialized; + iIapID = aIapID; + iPersistence = aPersistence; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::RunL +// -------------------------------------------------------------------------- +// +void CWsfConnectActiveWrapper::RunL() + { + LOG_ENTERFN( "CWsfConnectActiveWrapper::RunL" ); + if (iState == EUninitialized) + { + LOG_WRITE( "Start connect" ); + iModel->ConnectL( iPckg, iIapID, iPersistence, iStatus ); + iState = EInitialized; + SetActive(); // Tell scheduler a request is active + } + else if (iState == EInitialized ) + { + LOG_WRITEF( "request result = %d", iPckg() ); + iModel->SetConnectResultL(iPckg(), iIapID ); + } + else + { + LOG_WRITEF( "iState = %d", iState ); + } + } + + +// -------------------------------------------------------------------------- +// CWsfConnectActiveWrapper::RunError +// -------------------------------------------------------------------------- +// +#ifdef _DEBUG +TInt CWsfConnectActiveWrapper::RunError( TInt aError ) + { + LOG_ENTERFN( "CWsfConnectActiveWrapper::RunError" ); + LOG_WRITEF( "aError = %d", aError ); + TRAP_IGNORE( iModel->SetConnectResultL(iPckg(), iIapID ) ); + return aError; + } +#else +TInt CWsfConnectActiveWrapper::RunError( TInt /*aError*/ ) + { + TRAP_IGNORE( iModel->SetConnectResultL(iPckg(), iIapID ) ); + return KErrNone; + } +#endif + + + diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/src/wsfdisconnectactivewrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfdisconnectactivewrapper.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,158 @@ +/* +* 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 CWsfDisconnectActiveWrapper. +* +*/ + + +// INCLUDE FILES +#include "wsflogger.h" +#include "wsfmodel.h" +#include "wsfwlaninfoarray.h" +#include "wsfdisconnectactivewrapper.h" + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::CWsfDisconnectActiveWrapper +// -------------------------------------------------------------------------- +// +CWsfDisconnectActiveWrapper::CWsfDisconnectActiveWrapper() : + CActive(EPriorityStandard) // Standard priority + { + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::NewLC +// -------------------------------------------------------------------------- +// +CWsfDisconnectActiveWrapper* CWsfDisconnectActiveWrapper::NewLC( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfDisconnectActiveWrapper::NewLC" ); + CWsfDisconnectActiveWrapper* self = + new (ELeave) CWsfDisconnectActiveWrapper(); + CleanupStack::PushL(self); + self->ConstructL( aModel ); + return self; + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::NewL +// -------------------------------------------------------------------------- +// +CWsfDisconnectActiveWrapper* CWsfDisconnectActiveWrapper::NewL( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfDisconnectActiveWrapper::NewL" ); + CWsfDisconnectActiveWrapper* self = + CWsfDisconnectActiveWrapper::NewLC( aModel ); + CleanupStack::Pop(); // self; + return self; + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::ConstructL +// -------------------------------------------------------------------------- +// +void CWsfDisconnectActiveWrapper::ConstructL( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfDisconnectActiveWrapper::ConstructL" ); + CActiveScheduler::Add(this); // Add to scheduler + iModel = aModel; + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::~CWsfDisconnectActiveWrapper +// -------------------------------------------------------------------------- +// +CWsfDisconnectActiveWrapper::~CWsfDisconnectActiveWrapper() + { + LOG_ENTERFN( + "CWsfDisconnectActiveWrapper::~CWsfDisconnectActiveWrapper" ); + Cancel(); // Cancel any request, if outstanding + // Delete instance variables if any + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::DoCancel +// -------------------------------------------------------------------------- +// +void CWsfDisconnectActiveWrapper::DoCancel() + { + LOG_ENTERFN( "CWsfDisconnectActiveWrapper::DoCancel" ); + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::StartL +// -------------------------------------------------------------------------- +// +void CWsfDisconnectActiveWrapper::Start() + { + LOG_ENTERFN( "CWsfDisconnectActiveWrapper::Start" ); + Cancel(); // Cancel any request, just to be sure + iState = EUninitialized; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::RunL +// -------------------------------------------------------------------------- +// +void CWsfDisconnectActiveWrapper::RunL() + { + LOG_ENTERFN( "CWsfDisconnectActiveWrapper::RunL" ); + if (iState == EUninitialized) + { + LOG_WRITE( "disconnect" ); + iModel->Disconnect( iPckg, iStatus ); + iState = EInitialized; + SetActive(); // Tell scheduler a request is active + } + else if (iState == EInitialized ) + { + LOG_WRITEF( "request result = %d", iPckg() ); + } + else + { + LOG_WRITEF( "iState = %d", iState ); + } + } + + +// -------------------------------------------------------------------------- +// CWsfDisconnectActiveWrapper::RunError +// -------------------------------------------------------------------------- +// +#ifdef _DEBUG +TInt CWsfDisconnectActiveWrapper::RunError( TInt aError ) + { + LOG_ENTERFN( "CWsfDisconnectActiveWrapper::RunError" ); + LOG_WRITEF( "aError = %d", aError ); + return aError; + } +#else +TInt CWsfDisconnectActiveWrapper::RunError( TInt /*aError*/ ) + { + return KErrNone; + } +#endif + + + diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/src/wsfrefreshscanactivewrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfrefreshscanactivewrapper.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,159 @@ +/* +* 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 CWsfRefreshScanActiveWrapper. +* +*/ + + +// INCLUDE FILES +#include "wsflogger.h" +#include "wsfmodel.h" +#include "wsfwlaninfoarray.h" +#include "wsfrefreshscanactivewrapper.h" + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::CWsfRefreshScanActiveWrapper +// -------------------------------------------------------------------------- +// +CWsfRefreshScanActiveWrapper::CWsfRefreshScanActiveWrapper() : + CActive(EPriorityStandard) // Standard priority + { + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::NewLC +// -------------------------------------------------------------------------- +// +CWsfRefreshScanActiveWrapper* CWsfRefreshScanActiveWrapper::NewLC( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfRefreshScanActiveWrapper::NewLC" ); + CWsfRefreshScanActiveWrapper* self = + new (ELeave) CWsfRefreshScanActiveWrapper(); + CleanupStack::PushL(self); + self->ConstructL( aModel ); + return self; + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::NewL +// -------------------------------------------------------------------------- +// +CWsfRefreshScanActiveWrapper* CWsfRefreshScanActiveWrapper::NewL( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfRefreshScanActiveWrapper::NewL" ); + CWsfRefreshScanActiveWrapper* self = + CWsfRefreshScanActiveWrapper::NewLC( aModel ); + CleanupStack::Pop(); // self; + return self; + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::ConstructL +// -------------------------------------------------------------------------- +// +void CWsfRefreshScanActiveWrapper::ConstructL( CWsfModel* aModel ) + { + LOG_ENTERFN( "CWsfRefreshScanActiveWrapper::ConstructL" ); + CActiveScheduler::Add(this); // Add to scheduler + iModel = aModel; + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::~CWsfRefreshScanActiveWrapper +// -------------------------------------------------------------------------- +// +CWsfRefreshScanActiveWrapper::~CWsfRefreshScanActiveWrapper() + { + LOG_ENTERFN( + "WsfRefreshScanActiveWrapper::~WsfRefreshScanActiveWrapper" ); + Cancel(); // Cancel any request, if outstanding + // Delete instance variables if any + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::DoCancel +// -------------------------------------------------------------------------- +// +void CWsfRefreshScanActiveWrapper::DoCancel() + { + LOG_ENTERFN( "CWsfRefreshScanActiveWrapper::DoCancel" ); + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::StartL +// -------------------------------------------------------------------------- +// +void CWsfRefreshScanActiveWrapper::Start() + { + LOG_ENTERFN( "CWsfRefreshScanActiveWrapper::Start" ); + Cancel(); // Cancel any request, just to be sure + iState = EUninitialized; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::RunL +// -------------------------------------------------------------------------- +// +void CWsfRefreshScanActiveWrapper::RunL() + { + LOG_ENTERFN( "CWsfRefreshScanActiveWrapper::RunL" ); + if (iState == EUninitialized) + { + LOG_WRITE( "request scan" ); + iModel->RefreshScan( iPckg, iStatus ); + iState = EInitialized; + SetActive(); // Tell scheduler a request is active + } + else if (iState == EInitialized ) + { + LOG_WRITEF( "request result = %d", iPckg() ); + iModel->SetRefreshState( iPckg() ); + } + else + { + LOG_WRITEF( "iState = %d", iState ); + } + } + + +// -------------------------------------------------------------------------- +// CWsfRefreshScanActiveWrapper::RunError +// -------------------------------------------------------------------------- +// +#ifdef _DEBUG +TInt CWsfRefreshScanActiveWrapper::RunError( TInt aError ) + { + LOG_ENTERFN( "CWsfRefreshScanActiveWrapper::RunError" ); + LOG_WRITEF( "aError = %d", aError ); + return aError; + } +#else +TInt CWsfRefreshScanActiveWrapper::RunError( TInt /*aError*/ ) + { + return KErrNone; + } +#endif + + + diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/aiplugin/src/wsfwlanlistactivewrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/aiplugin/src/wsfwlanlistactivewrapper.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -0,0 +1,274 @@ +/* + * 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 CWsfWLANListActiveWrapper. + * + */ + + +// INCLUDE FILES +#include "wsflogger.h" +#include "wsfmodel.h" +#include "wsfwlaninfoarray.h" +#include "wsfaicontroller.h" +#include "wsfwlanlistactivewrapper.h" + + +/** +* Number of retries to fetch wlan data +*/ +static const TInt KRetries = 5; + + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::CWsfWLANListActiveWrapper +// ---------------------------------------------------------------------------- +// +CWsfWLANListActiveWrapper::CWsfWLANListActiveWrapper() : + CActive( EPriorityStandard ), // Standard priority + iPtr( NULL, 0 ) + { + } + + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::NewLC +// ---------------------------------------------------------------------------- +// +CWsfWLANListActiveWrapper* CWsfWLANListActiveWrapper::NewLC( CWsfModel* aModel, + TWsfAiController &aController ) + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::NewLC" ); + CWsfWLANListActiveWrapper* self = + new (ELeave) CWsfWLANListActiveWrapper(); + CleanupStack::PushL(self); + self->ConstructL( aModel, aController ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::NewL +// ---------------------------------------------------------------------------- +// +CWsfWLANListActiveWrapper* CWsfWLANListActiveWrapper::NewL( CWsfModel* aModel, + TWsfAiController &aController ) + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::NewL" ); + CWsfWLANListActiveWrapper* self = CWsfWLANListActiveWrapper::NewLC( + aModel, aController ); + CleanupStack::Pop(); // self; + return self; + } + + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::ConstructL +// ---------------------------------------------------------------------------- +// +void CWsfWLANListActiveWrapper::ConstructL( CWsfModel* aModel, + TWsfAiController &aController ) + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::ConstructL" ); + CActiveScheduler::Add(this); // Add to scheduler + iModel = aModel; + iController = &aController; + iArray = CWsfWlanInfoArray::NewL(); + } + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::~CWsfWLANListActiveWrapper +// ---------------------------------------------------------------------------- +// +CWsfWLANListActiveWrapper::~CWsfWLANListActiveWrapper() + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::~CWsfWLANListActiveWrapper" ); + Cancel(); // Cancel any request, if outstanding + // Delete instance variables if any + if ( iBuffer ) + { + delete iBuffer; + } + delete iArray; + } + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::DoCancel +// ---------------------------------------------------------------------------- +// +void CWsfWLANListActiveWrapper::DoCancel() + { + } + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::Start +// ---------------------------------------------------------------------------- +// +void CWsfWLANListActiveWrapper::Start( TBool aStarUp ) + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::Start" ); + Cancel(); // Cancel any request, just to be sure + iStartUp = aStarUp; + iState = EUninitialized; + iRetriesLeft = KRetries; + iPckgAllocatedSize() = 0; + iPckgNeededSize() = 0; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); + } + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::GetWlanList +// ---------------------------------------------------------------------------- +// +CWsfWlanInfoArray* CWsfWLANListActiveWrapper::GetWlanList() + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::GetWlanList" ); + return iArray; + } + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::GetConnectedWLANNetwork +// ---------------------------------------------------------------------------- +// +TWsfWlanInfo CWsfWLANListActiveWrapper::GetConnectedWLANNetwork() + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::GetConnectedWLANNetwork" ); + return iConnectedWlan; + } + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::RunL +// ---------------------------------------------------------------------------- +// +void CWsfWLANListActiveWrapper::RunL() + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::RunL" ); + if ( iState == EUninitialized ) + { + LOG_WRITE( "Get WLAN list size" ); + iModel->GetWlanListSize( iPckgNeededSize, iStatus ); + iState = EInitialized; + SetActive(); // Tell scheduler a request is active + } + else if ( iState == EInitialized ) + { + LOG_WRITEF( "WLAN data buffer size = %d", iPckgNeededSize() ); + + if ( !iPckgNeededSize() ) + { + LOG_WRITE( "no data.." ); + iState = EProcessWLANListData; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); + } + else + { + // alloc the required size buffer... + delete iBuffer; + iBuffer = NULL; + iBuffer = HBufC8::NewL( iPckgNeededSize() ); + iPtr.Set( iBuffer->Des() ); + + LOG_WRITE( "Get WLAN list" ); + iModel->GetWlanList( iPckgAllocatedSize, iPtr, iStatus ); + iState = EProcessWLANListData; + SetActive(); // Tell scheduler a request is active + } + } + else if ( iState == EProcessWLANListData ) + { + LOG_WRITEF( "actual bytes occupied = %d", iPckgAllocatedSize() ); + + if ( iPckgNeededSize() != iPckgAllocatedSize() ) + { + // the buffer is not long enough... stop + if ( iRetriesLeft > 0 ) + { + LOG_WRITEF( "iRetriesLeft = %d", iRetriesLeft ); + iRetriesLeft--; + iState = EUninitialized; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + return; + } + else + { + // no more retries + User::Leave( KErrOverflow ); + } + } + + iArray->Reset(); + + if ( iPckgAllocatedSize() ) + { + iArray->AppendFromStreamBufferL( iPtr ); + } + + LOG_WRITEF( "Array count=%d startup=%d", iArray->Count(), iStartUp ); + + iModel->GetConnectedWlanDetails( iPckg, iConnectedWlan, iStatus ); + iState = EGetConnectedNetwork; + SetActive(); // Tell scheduler a request is active + } + else if ( iState == EGetConnectedNetwork ) + { + LOG_WRITEF( "request result = %d", iPckg() ); + + if ( !iPckg() ) + { + LOG_WRITE( "result is false, so wlaninfo is marked not connected" ); + iConnectedWlan.iConnectionState = ENotConnected; + } + + LOG_WRITEF( "Connected = %d", iConnectedWlan.Connected() ); + + LOG_WRITEF( "iConnectedWlan state = %d", + iConnectedWlan.iConnectionState ); + + if ( iStartUp ) + { + iController->StartupRefreshDataReadyL(); + } + else + { + iController->WlanListDataReadyL(); + } + } + else + { + LOG_WRITEF( "iState = %d", iState ); + } + } + +// ---------------------------------------------------------------------------- +// CWsfWLANListActiveWrapper::RunError +// ---------------------------------------------------------------------------- +// +#ifdef _DEBUG +TInt CWsfWLANListActiveWrapper::RunError( TInt aError ) + { + LOG_ENTERFN( "CWsfWLANListActiveWrapper::RunError" ); + LOG_WRITEF( "aError = %d", aError ); + return aError; + } +#else +TInt CWsfWLANListActiveWrapper::RunError( TInt /*aError*/ ) + { + return KErrNone; + } +#endif diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/client/bwins/wsfclientu.def --- a/wlanutilities/wlansniffer/engine/client/bwins/wsfclientu.def Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/client/bwins/wsfclientu.def Fri Mar 12 15:48:54 2010 +0200 @@ -1,24 +1,30 @@ EXPORTS - ??0RWsfSession@@QAE@XZ @ 1 NONAME ; RWsfSession::RWsfSession(void) - ?AbortConnectingL@RWsfSession@@QAEXXZ @ 2 NONAME ; void RWsfSession::AbortConnectingL(void) - ?AbortScanningL@RWsfSession@@QAEXXZ @ 3 NONAME ; void RWsfSession::AbortScanningL(void) - ?CancelAll@RWsfSession@@QAEXXZ @ 4 NONAME ; void RWsfSession::CancelAll(void) - ?CancelNotifyEvent@RWsfSession@@QAEXXZ @ 5 NONAME ; void RWsfSession::CancelNotifyEvent(void) - ?Close@RWsfSession@@QAEXXZ @ 6 NONAME ; void RWsfSession::Close(void) - ?Connect@RWsfSession@@QAEHXZ @ 7 NONAME ; int RWsfSession::Connect(void) - ?ConnectWlanBearerL@RWsfSession@@QAEHKW4TWsfIapPersistence@@@Z @ 8 NONAME ; int RWsfSession::ConnectWlanBearerL(unsigned long, enum TWsfIapPersistence) - ?ConnectedAccountNameL@RWsfSession@@QAEPAVHBufC16@@XZ @ 9 NONAME ; class HBufC16 * RWsfSession::ConnectedAccountNameL(void) - ?ControlDisconnectTimerL@RWsfSession@@QAEHI@Z @ 10 NONAME ; int RWsfSession::ControlDisconnectTimerL(unsigned int) - ?DisableScanL@RWsfSession@@QAEHXZ @ 11 NONAME ; int RWsfSession::DisableScanL(void) - ?DisconnectWlanBearerL@RWsfSession@@QAEHXZ @ 12 NONAME ; int RWsfSession::DisconnectWlanBearerL(void) - ?EnableScanL@RWsfSession@@QAEHXZ @ 13 NONAME ; int RWsfSession::EnableScanL(void) - ?GetConnectedWlanDetailsL@RWsfSession@@QAEHAAVTWsfWlanInfo@@@Z @ 14 NONAME ; int RWsfSession::GetConnectedWlanDetailsL(class TWsfWlanInfo &) - ?IsConnectedL@RWsfSession@@QAEHXZ @ 15 NONAME ; int RWsfSession::IsConnectedL(void) - ?IsScanEnabledL@RWsfSession@@QAEHXZ @ 16 NONAME ; int RWsfSession::IsScanEnabledL(void) - ?MonitorAccessPointL@RWsfSession@@QAEXK@Z @ 17 NONAME ; void RWsfSession::MonitorAccessPointL(unsigned long) - ?NotifyEventL@RWsfSession@@QAEXAAVMWsfStateChangeObserver@@@Z @ 18 NONAME ; void RWsfSession::NotifyEventL(class MWsfStateChangeObserver &) - ?RequestScanL@RWsfSession@@QAEHXZ @ 19 NONAME ; int RWsfSession::RequestScanL(void) - ?SetIapPersistenceL@RWsfSession@@QAEHW4TWsfIapPersistence@@@Z @ 20 NONAME ; int RWsfSession::SetIapPersistenceL(enum TWsfIapPersistence) - ?UpdateWlanListL@RWsfSession@@QAEXPAVCWsfWlanInfoArray@@@Z @ 21 NONAME ; void RWsfSession::UpdateWlanListL(class CWsfWlanInfoArray *) - ?ConnectWlanBearerWithoutConnWaiterL@RWsfSession@@QAEHKW4TWsfIapPersistence@@@Z @ 22 NONAME ; int RWsfSession::ConnectWlanBearerWithoutConnWaiterL(unsigned long, enum TWsfIapPersistence) + ?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) + ?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 &) diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/client/eabi/wsfclientu.def --- a/wlanutilities/wlansniffer/engine/client/eabi/wsfclientu.def Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/client/eabi/wsfclientu.def Fri Mar 12 15:48:54 2010 +0200 @@ -1,24 +1,30 @@ EXPORTS _ZN11RWsfSession11EnableScanLEv @ 1 NONAME - _ZN11RWsfSession12DisableScanLEv @ 2 NONAME - _ZN11RWsfSession12IsConnectedLEv @ 3 NONAME - _ZN11RWsfSession12NotifyEventLER23MWsfStateChangeObserver @ 4 NONAME - _ZN11RWsfSession12RequestScanLEv @ 5 NONAME - _ZN11RWsfSession14AbortScanningLEv @ 6 NONAME - _ZN11RWsfSession14IsScanEnabledLEv @ 7 NONAME - _ZN11RWsfSession15UpdateWlanListLEP17CWsfWlanInfoArray @ 8 NONAME - _ZN11RWsfSession16AbortConnectingLEv @ 9 NONAME - _ZN11RWsfSession17CancelNotifyEventEv @ 10 NONAME - _ZN11RWsfSession18ConnectWlanBearerLEm18TWsfIapPersistence @ 11 NONAME - _ZN11RWsfSession18SetIapPersistenceLE18TWsfIapPersistence @ 12 NONAME - _ZN11RWsfSession19MonitorAccessPointLEm @ 13 NONAME - _ZN11RWsfSession21ConnectedAccountNameLEv @ 14 NONAME - _ZN11RWsfSession21DisconnectWlanBearerLEv @ 15 NONAME - _ZN11RWsfSession23ControlDisconnectTimerLEj @ 16 NONAME - _ZN11RWsfSession24GetConnectedWlanDetailsLER12TWsfWlanInfo @ 17 NONAME - _ZN11RWsfSession5CloseEv @ 18 NONAME - _ZN11RWsfSession7ConnectEv @ 19 NONAME - _ZN11RWsfSessionC1Ev @ 20 NONAME - _ZN11RWsfSessionC2Ev @ 21 NONAME - _ZN11RWsfSession35ConnectWlanBearerWithoutConnWaiterLEm18TWsfIapPersistence @ 22 NONAME + _ZN11RWsfSession11GetWlanListER8TPckgBufIjER5TPtr8R14TRequestStatus @ 2 NONAME + _ZN11RWsfSession11RequestScanER8TPckgBufIiER14TRequestStatus @ 3 NONAME + _ZN11RWsfSession12DisableScanLEv @ 4 NONAME + _ZN11RWsfSession12IsConnectedLEv @ 5 NONAME + _ZN11RWsfSession12NotifyEventLER23MWsfStateChangeObserver @ 6 NONAME + _ZN11RWsfSession12RequestScanLEv @ 7 NONAME + _ZN11RWsfSession14AbortScanningLEv @ 8 NONAME + _ZN11RWsfSession14IsScanEnabledLEv @ 9 NONAME + _ZN11RWsfSession15GetWlanListSizeER8TPckgBufIjER14TRequestStatus @ 10 NONAME + _ZN11RWsfSession15UpdateWlanListLEP17CWsfWlanInfoArray @ 11 NONAME + _ZN11RWsfSession16AbortConnectingLEv @ 12 NONAME + _ZN11RWsfSession17CancelNotifyEventEv @ 13 NONAME + _ZN11RWsfSession17ConnectWlanBearerER8TPckgBufIiEm18TWsfIapPersistenceR14TRequestStatus @ 14 NONAME + _ZN11RWsfSession18ConnectWlanBearerLEm18TWsfIapPersistence @ 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 diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/client/inc/wsfsession.h --- a/wlanutilities/wlansniffer/engine/client/inc/wsfsession.h Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/client/inc/wsfsession.h Fri Mar 12 15:48:54 2010 +0200 @@ -120,6 +120,28 @@ * @param aInfoArray Array for the scan results. Ownership not changed. */ IMPORT_C void UpdateWlanListL( CWsfWlanInfoArray* aInfoArray ); + + /** + * Asyncronous request to the server to return wlan list size + * @since S60 5.2 + * @param aPckg request result + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void GetWlanListSize( TPckgBuf& aPckg, + TRequestStatus& aStatus ); + + + /** + * Asyncronous request to the server to return wlan list + * @since S60 5.2 + * @param aPckg request result + * @param aPtr wlan list + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void GetWlanList( TPckgBuf& aPckg, TPtr8& aPtr, + TRequestStatus& aStatus ); /** * Cancel all pending tasks. @@ -143,6 +165,18 @@ IMPORT_C TBool GetConnectedWlanDetailsL( TWsfWlanInfo& aWlanInfo ); /** + * Asyncronous request to the server to return connected wlan network + * @since S60 5.2 + * @param aPckg request result + * @param aWlanInfo The wlaninfo object to fill + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void GetConnectedWlanDetails( TPckgBuf& aPckg, + TWsfWlanInfo& aWlanInfo, + TRequestStatus& aStatus ); + + /** * Start monitoring events for the specified access point * @since S60 5.0 * @param aMonitoredIap The id of the IAP to be monitored @@ -161,15 +195,25 @@ TWsfIapPersistence aPersistence = EIapPersistent ); /** - * Connect to the given WLAN IAP. The function requests connection from - * server without waiting the connection process to finish + * Asyncronous request to the server to connect + * @since S60 5.2 + * @param aPckg request result + * @param aIapId The id of the IAP to connect to + * @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, + TRequestStatus& aStatus ); + + /** + * Sets connection result * @since S60 5.2 - * @param aIapId The id of the IAP to connect to - * @param aPersistence The value of the persistence property - * @return KErrNone if connection request is succesfully sent to server + * @param aResult The connection request result */ - IMPORT_C TInt ConnectWlanBearerWithoutConnWaiterL( TUint32 aIapId, - TWsfIapPersistence aPersistence = EIapPersistent ); + IMPORT_C void SetConnectWlanBearerResult( TInt aResult ); /** * Sets the persistence property of the currently monitored IAP @@ -188,12 +232,32 @@ IMPORT_C TBool DisconnectWlanBearerL(); /** + * Asyncronous request to the server to disconnect + * @since S60 5.2 + * @param aPckg request result + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void DisconnectWlanBearer( TPckgBuf& aPckg, + TRequestStatus& aStatus ); + + /** * Request the server to make a forced scan * @since S60 5.0 * @return ETrue on success */ IMPORT_C TBool RequestScanL(); + /** + * Asyncronous request to the server to make a scan + * @since S60 5.2 + * @param aPckg request result + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void RequestScan( TPckgBuf& aPckg, + TRequestStatus& aStatus ); + /** * Queries if there is an active WLAN connection. * @since S60 5.0 diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/client/src/wsfsession.cpp --- a/wlanutilities/wlansniffer/engine/client/src/wsfsession.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/client/src/wsfsession.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -35,6 +35,11 @@ */ static const TInt KIPCSlots = 6; +/** +* Number of retries to start the server +*/ +static const TInt KRetries = 3; + // --------------------------------------------------------------------------- @@ -110,7 +115,7 @@ LOG_ENTERFN( "RWsfSession::Connect" ); TInt err = StartServer(); - if ( err == KErrNone ) + for (TInt tries = 0; tries < KRetries; tries++) { LOG_WRITE( "server started" ); @@ -118,15 +123,37 @@ LOG_WRITEF( "CreateSession() returned %d", err ); - if ( err == KErrNone ) + if (!err) + { + LOG_WRITE( "connected" ); + TRAP( err, iConnWaiter = new (ELeave) CActiveSchedulerWait() ); + break; + } + if (err != KErrNotFound && err != KErrServerTerminated) { - TRAP( err, iConnWaiter = new (ELeave) CActiveSchedulerWait() ); + LOG_WRITE( "problems session creation - break" ); + break; } + + TInt err = StartServer(); // try to launch the server + + if (!err) + { + LOG_WRITE( "ok - try to connect again" ); + continue; + } + + if (err == KErrAlreadyExists) + { + LOG_WRITE( "someone else started - try to connect again" ); + continue; + } + + LOG_WRITE( "problems - break" ); + break; } - else - { - LOG_WRITEF( "server starting failed with error %d", err ); - } + + LOG_WRITEF( "connect exit value = %d", err ); return err; } @@ -212,6 +239,22 @@ // --------------------------------------------------------------------------- +// RWsfSession::GetConnectedWlanDetails +// --------------------------------------------------------------------------- +// +EXPORT_C void RWsfSession::GetConnectedWlanDetails( TPckgBuf& aPckg, + TWsfWlanInfo& aWlanInfo, + TRequestStatus& aStatus ) + { + LOG_ENTERFN("RWsfSession::GetConnectedWlanDetails"); + TPckg package( aWlanInfo ); + + SendReceive( ESnifferCmdConnectedDetails, TIpcArgs( &aPckg, &package ), + aStatus ); + } + + +// --------------------------------------------------------------------------- // RWsfSession::NotifyEventL // --------------------------------------------------------------------------- // @@ -362,6 +405,28 @@ // --------------------------------------------------------------------------- +// RWsfSession::GetWlanListSize +// --------------------------------------------------------------------------- +// +EXPORT_C void RWsfSession::GetWlanListSize( TPckgBuf &aPckg, TRequestStatus& aStatus ) + { + LOG_ENTERFN("RWsfSession::GetWlanListSize"); + SendReceive( ESnifferCmdWlanDataSize, TIpcArgs( &aPckg ), aStatus ); + } + + +// --------------------------------------------------------------------------- +// RWsfSession::GetWlanList +// --------------------------------------------------------------------------- +// +EXPORT_C void RWsfSession::GetWlanList( TPckgBuf& aPckg, TPtr8& aPtr, TRequestStatus& aStatus ) + { + LOG_ENTERFN("RWsfSession::GetWlanList"); + SendReceive( ESnifferCmdGetWlanInfo, TIpcArgs( &aPckg, &aPtr ), aStatus ); + } + + +// --------------------------------------------------------------------------- // RWsfSession::MonitorAccessPointL // --------------------------------------------------------------------------- // @@ -369,18 +434,10 @@ { LOG_ENTERFN("RWsfSession::MonitorAccessPointL"); - CWsfActiveWaiter *waiter = CWsfActiveWaiter::NewL(); - CleanupStack::PushL( waiter ); - - SendReceive( ESnifferCmdMonitorAp, TIpcArgs( aMonitoredIap ), - waiter->iStatus ); - waiter->WaitForRequest(); - LOG_WRITEF( "message[%d] call returned %d", - ESnifferCmdMonitorAp, - waiter->iStatus.Int() ); - User::LeaveIfError( waiter->iStatus.Int() ); - - CleanupStack::PopAndDestroy( waiter ); + TInt err = Send( ESnifferCmdMonitorAp, TIpcArgs( aMonitoredIap )); + LOG_WRITEF( "message[%d] call returned %d", ESnifferCmdMonitorAp, err ); + + User::LeaveIfError( err ); } @@ -408,6 +465,17 @@ // --------------------------------------------------------------------------- +// RWsfSession::RequestScan +// --------------------------------------------------------------------------- +// +EXPORT_C void RWsfSession::RequestScan(TPckgBuf& aPckg, TRequestStatus& aStatus ) + { + LOG_ENTERFN("RWsfSession::RequestScan"); + SendReceive( ESnifferCmdRequestScan, TIpcArgs( &aPckg ), aStatus ); + } + + +// --------------------------------------------------------------------------- // RWsfSession::ConnectWlanBearerL // --------------------------------------------------------------------------- // @@ -460,42 +528,39 @@ // --------------------------------------------------------------------------- -// RWsfSession::ConnectWlanBearerWithoutConnWaiterL +// RWsfSession::ConnectWlanBearer // --------------------------------------------------------------------------- // -EXPORT_C TInt RWsfSession::ConnectWlanBearerWithoutConnWaiterL( TUint32 aIapId, - TWsfIapPersistence aPersistence ) +EXPORT_C void RWsfSession::ConnectWlanBearer( TPckgBuf& aPckg, + TUint32 aIapId, + TWsfIapPersistence aPersistence, + TRequestStatus& aStatus ) { - LOG_ENTERFN( "RWsfSession::ConnectWlanBearerWithoutConnWaiterL" ); + LOG_ENTERFN( "RWsfSession::ConnectWlanBearer" ); LOG_WRITEF( "IAP id = %d", aIapId ); // mark the beginning of the connection process iEventHandler->SetConnecting( ETrue ); - TInt res( KErrNone ); - TPckgBuf pckg; + SendReceive( ESnifferCmdConnect, TIpcArgs( &aPckg, aIapId, aPersistence ), + aStatus ); + } - CWsfActiveWaiter *waiter = CWsfActiveWaiter::NewL(); - CleanupStack::PushL( waiter ); - SendReceive( ESnifferCmdConnect, TIpcArgs( &pckg, aIapId, aPersistence ), - waiter->iStatus ); - waiter->WaitForRequest(); - LOG_WRITEF( "message[%d] call returned %d", - ESnifferCmdConnect, - waiter->iStatus.Int() ); - User::LeaveIfError( waiter->iStatus.Int() ); - CleanupStack::PopAndDestroy( waiter ); +// --------------------------------------------------------------------------- +// RWsfSession::SetConnectWlanBearerResult +// --------------------------------------------------------------------------- +// +EXPORT_C void RWsfSession::SetConnectWlanBearerResult( TInt aResult ) + { + LOG_ENTERFN( "RWsfSession::SetConnectWlanBearerResult" ); + LOG_WRITEF( "Result = %d", aResult ); - res = pckg(); - - if ( res != KErrNone ) + if ( aResult != KErrNone ) { // on any error the flag should be cleared iEventHandler->SetConnecting( EFalse ); } - - return res; } @@ -541,6 +606,17 @@ // --------------------------------------------------------------------------- +// RWsfSession::DisconnectWlanBearer +// --------------------------------------------------------------------------- +// +EXPORT_C void RWsfSession::DisconnectWlanBearer( TPckgBuf& aPckg, TRequestStatus& aStatus ) + { + LOG_ENTERFN("RWsfSession::DisconnectWlanBearer"); + SendReceive( ESnifferCmdDisconnect, TIpcArgs( &aPckg ), aStatus ); + } + + +// --------------------------------------------------------------------------- // RWsfSession::Close // --------------------------------------------------------------------------- // @@ -550,6 +626,7 @@ delete iEventHandler; iEventHandler = NULL; delete iConnWaiter; iConnWaiter = NULL; + LOG_WRITE( "close session" ); RSessionBase::Close(); } diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/server/group/server.mmp --- a/wlanutilities/wlansniffer/engine/server/group/server.mmp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/server/group/server.mmp Fri Mar 12 15:48:54 2010 +0200 @@ -60,6 +60,8 @@ // Used system libraries +LIBRARY ws32.lib +LIBRARY apgrfx.lib LIBRARY euser.lib LIBRARY bafl.lib LIBRARY estor.lib diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/server/src/wsfsession.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfsession.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfsession.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -535,6 +535,8 @@ if ( scanData ) { + LOG_WRITEF( "scanData->Length() = %d aMessage.GetDesMaxLength(1) = %d", + scanData->Length(), aMessage.GetDesMaxLength( 1 ) ); if ( scanData->Length() > aMessage.GetDesMaxLength( 1 ) ) { // the data has changed @@ -545,6 +547,8 @@ else { // else we have enough buffer... copy the data + sizeData() = scanData->Length(); + aMessage.WriteL( 0, sizeData ); aMessage.WriteL( 1, *scanData, 0 ); } } diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -18,6 +18,8 @@ // EXTERNAL INCLUDES +#include +#include #include #include #include @@ -84,6 +86,11 @@ { 0x101fD9C5 } // DHCP server (dhcpserv.exe) }; +/** +* Browser UID +*/ +const TUid KCRUidBrowser = {0x10008D39}; + // CONSTRUCTION AND DESTRUCTION @@ -730,49 +737,72 @@ { LOG_ENTERFN( "CWsfWlanBearerConnectionMonitor::CheckClientCountL" ); - CWsfActiveWaiter* waiter = CWsfActiveWaiter::NewL(); - - TConnMonClientEnumBuf clientInfo; - - iMonitor.GetPckgAttribute( iConnectionId, 0, - KClientInfo, - clientInfo, - waiter->iStatus ); - waiter->WaitForRequest(); - delete waiter; + RWsSession wsSession; + if ( KErrNone == wsSession.Connect() ) + { + LOG_WRITE( "Find browser task" ); + TApaTaskList taskList( wsSession ); + TApaTask task = taskList.FindApp( KCRUidBrowser ); + if ( task.Exists() ) + { + LOG_WRITE( "Browser is running - auto disconnect to false" ); + iAutoDisconnect = EFalse; + iInactivityStart.UniversalTime(); + } + else + { + LOG_WRITE( "Browser is not running - auto disconnect to true" ); + iAutoDisconnect = ETrue; + } + wsSession.Close(); + } + else + { + LOG_WRITE( "Session connect failed" ); + } - // get the client count - iClientCount = clientInfo().iCount; - - // decrease count by each trivial client (Sniffer server, DHCP etc) - for ( TInt i( 0 ); i < clientInfo().iCount; ++i ) + if ( iAutoDisconnect ) { - for ( TInt j( 0 ); j < KTrivialClientCount; ++j ) + CWsfActiveWaiter* waiter = CWsfActiveWaiter::NewL(); + + TConnMonClientEnumBuf clientInfo; + + iMonitor.GetPckgAttribute( iConnectionId, 0, + KClientInfo, + clientInfo, + waiter->iStatus ); + waiter->WaitForRequest(); + delete waiter; + + // get the client count + iClientCount = clientInfo().iCount; + + // decrease count by each trivial client (Sniffer server, DHCP etc) + for ( TInt i( 0 ); i < clientInfo().iCount; ++i ) { - if ( clientInfo().iUid[i] == KTrivialClientUids[j] ) + for ( TInt j( 0 ); j < KTrivialClientCount; ++j ) { - --iClientCount; - LOG_WRITEF( "trivial client [0x%08X] discarded", - clientInfo().iUid[i].iUid ); - break; + if ( clientInfo().iUid[i] == KTrivialClientUids[j] ) + { + --iClientCount; + LOG_WRITEF( "trivial client [0x%08X] discarded", + clientInfo().iUid[i].iUid ); + break; + } } } - } - + + LOG_WRITEF( "iClientCount = %d (trivial clients:%d)", + iClientCount, + clientInfo().iCount - iClientCount ); - LOG_WRITEF( "iClientCount = %d (trivial clients:%d)", - iClientCount, - clientInfo().iCount - iClientCount ); - - if ( iAutoDisconnect ) - { if ( iClientCount ) { + LOG_WRITE( "reset the inactivity start time to current time" ); // there are more clients than the default ones -> // connection is considered active -> // reset the inactivity start time to current time iInactivityStart.UniversalTime(); - } else { @@ -789,10 +819,11 @@ LOG_WRITE( "inactivity threshold reached, disconnecting..." ); DisconnectBearer(); } + } } - + } @@ -947,9 +978,6 @@ { case ECsNotConnected: { -#ifdef __WINSCW__ - User::After(5000000); -#endif LOG_WRITE( "" ); TInt err( KErrNone ); diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -334,12 +334,13 @@ delete iScanResults; iScanResults = results; +#ifdef _DEBUG + DumpScanResultsL( iScanArray ); +#endif + // we may let go the scan array contents... iScanArray->Reset(); -#ifdef _DEBUG - DumpScanResultsL( iScanArray ); -#endif // notify clients that data is ready if ( iObserver ) { @@ -476,12 +477,15 @@ // void CWsfWlanScanner::DumpScanResultsL( CWsfWlanInfoArray* aArray ) { + LOG_ENTERFN( "CWsfWlanScanner::DumpScanResultsL" ); _LIT( Kopen, "open" ); _LIT( Kwep, "wep" ); _LIT( Kwpa, "wpa" ); _LIT( Kwpa2, "wpa2" ); _LIT( K802, "802.1x" ); - const TDesC* secModes[4] = { &Kopen, &Kwep, &K802, &Kwpa }; + _LIT( KWAPI, "WAPI" ); + _LIT( KUnknown, "Unknown" ); + _LIT( Kpsk, "psk" ); _LIT( Keap, "eap" ); _LIT( Khidden, "" ); @@ -507,6 +511,13 @@ break; case EWlanSecMode802_1x: sm = &K802; + break; + case EWlanSecModeWAPI: + sm = &KWAPI; + break; + default: + sm = &KUnknown; + break; } const TDesC* psk = wi->UsesPreSharedKey()? &Kpsk: diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/mainapplication/src/wsfconnecteddetailsdialog.cpp --- a/wlanutilities/wlansniffer/mainapplication/src/wsfconnecteddetailsdialog.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/mainapplication/src/wsfconnecteddetailsdialog.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -30,10 +30,6 @@ // CONSTANTS LOCAL_D const TInt KUpdateInterval = 1000000; // in micro seconds (1 sec) -// Time item's place in the listbox. -LOCAL_D const TInt KActiveTimeItem = 1; -// Transferred data item's place in the listbox. -LOCAL_D const TInt KTransferredAmountItem = 2; // ================= MEMBER FUNCTIONS ======================= @@ -159,13 +155,8 @@ if ( iList && aItemTextArray->MdcaCount() ) { - iList->Reset(); iModel->SetItemTextArray( aItemTextArray ); - iModel->SetOwnershipType( ELbmDoesNotOwnItemArray ); - // draw updated items - iList->DrawItem( KActiveTimeItem ); - iList->DrawItem( KTransferredAmountItem ); - + iModel->SetOwnershipType( ELbmDoesNotOwnItemArray ); DrawNow(); } } diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/model/bwins/wsfmodelu.def --- a/wlanutilities/wlansniffer/model/bwins/wsfmodelu.def Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/model/bwins/wsfmodelu.def Fri Mar 12 15:48:54 2010 +0200 @@ -6,34 +6,38 @@ ?AbortConnectingL@CWsfModel@@QAEXXZ @ 5 NONAME ; void CWsfModel::AbortConnectingL(void) ?ContinueBrowsingL@CWsfModel@@QAEXXZ @ 6 NONAME ; void CWsfModel::ContinueBrowsingL(void) ?SetRefreshState@CWsfModel@@QAEXH@Z @ 7 NONAME ; void CWsfModel::SetRefreshState(int) - ?SetEngineObserver@CWsfModel@@QAEXPAVMWsfModelObserver@@@Z @ 8 NONAME ; void CWsfModel::SetEngineObserver(class MWsfModelObserver *) - ?ConnectL@CWsfModel@@QAEHK@Z @ 9 NONAME ; int CWsfModel::ConnectL(unsigned long) - ?SetActiveViewL@CWsfModel@@QAEXH@Z @ 10 NONAME ; void CWsfModel::SetActiveViewL(int) - ?NewLC@CWsfModel@@SAPAV1@AAVMWsfStateChangeObserver@@H@Z @ 11 NONAME ; class CWsfModel * CWsfModel::NewLC(class MWsfStateChangeObserver &, int) - ?IsScanEnabledL@CWsfModel@@QAEHXZ @ 12 NONAME ; int CWsfModel::IsScanEnabledL(void) - ?AbortScanningL@CWsfModel@@QAEXXZ @ 13 NONAME ; void CWsfModel::AbortScanningL(void) - ?TestAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@HH@Z @ 14 NONAME ; int CWsfModel::TestAccessPointL(class TWsfWlanInfo &, int, int) - ?CancelNotifyEvents@CWsfModel@@QAEXXZ @ 15 NONAME ; void CWsfModel::CancelNotifyEvents(void) - ??1CWsfModel@@UAE@XZ @ 16 NONAME ; CWsfModel::~CWsfModel(void) - ?CleanUpCancelledLaunchL@CWsfModel@@QAEXXZ @ 17 NONAME ; void CWsfModel::CleanUpCancelledLaunchL(void) - ?LaunchHelperApplicationL@CWsfModel@@QAEXAAVTWsfWlanInfo@@HH@Z @ 18 NONAME ; void CWsfModel::LaunchHelperApplicationL(class TWsfWlanInfo &, int, int) - ?DisableScanL@CWsfModel@@QAEHXZ @ 19 NONAME ; int CWsfModel::DisableScanL(void) - ?GetWlanListL@CWsfModel@@QAEPAVCWsfWlanInfoArray@@XZ @ 20 NONAME ; class CWsfWlanInfoArray * CWsfModel::GetWlanListL(void) - ?GetConnectedWlanDetailsL@CWsfModel@@QAEHAAVTWsfWlanInfo@@@Z @ 21 NONAME ; int CWsfModel::GetConnectedWlanDetailsL(class TWsfWlanInfo &) - ?NewL@CWsfModel@@SAPAV1@AAVMWsfStateChangeObserver@@H@Z @ 22 NONAME ; class CWsfModel * CWsfModel::NewL(class MWsfStateChangeObserver &, int) - ?Refreshing@CWsfModel@@QAEHXZ @ 23 NONAME ; int CWsfModel::Refreshing(void) - ?ContinueBrowsingL@CWsfModel@@QAEXK@Z @ 24 NONAME ; void CWsfModel::ContinueBrowsingL(unsigned long) - ?IctsTestPermission@CWsfModel@@SAHXZ @ 25 NONAME ; int CWsfModel::IctsTestPermission(void) - ?DisconnectL@CWsfModel@@QAEXXZ @ 26 NONAME ; void CWsfModel::DisconnectL(void) - ?IsConnectedL@CWsfModel@@QAEHXZ @ 27 NONAME ; int CWsfModel::IsConnectedL(void) - ?CreateAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@H@Z @ 28 NONAME ; int CWsfModel::CreateAccessPointL(class TWsfWlanInfo &, int) - ?NewLC@CWsfAppLauncher@@SAPAV1@XZ @ 29 NONAME ; class CWsfAppLauncher * CWsfAppLauncher::NewLC(void) - ?RequestNotifyEventsL@CWsfModel@@QAEXAAVMWsfStateChangeObserver@@@Z @ 30 NONAME ; void CWsfModel::RequestNotifyEventsL(class MWsfStateChangeObserver &) - ?LaunchBrowserL@CWsfModel@@UAEXK@Z @ 31 NONAME ; void CWsfModel::LaunchBrowserL(unsigned long) - ?RefreshScanL@CWsfModel@@QAEHXZ @ 32 NONAME ; int CWsfModel::RefreshScanL(void) - ?SetObservedWlanL@CWsfModel@@QAEXABVTDesC8@@@Z @ 33 NONAME ; void CWsfModel::SetObservedWlanL(class TDesC8 const &) - ?TestConnectedAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@H@Z @ 34 NONAME ; int CWsfModel::TestConnectedAccessPointL(class TWsfWlanInfo &, int) - ?FinalizeConnectL@CWsfModel@@QAEXXZ @ 35 NONAME ; void CWsfModel::FinalizeConnectL(void) - ?ConnectWithoutConnWaiterL@CWsfModel@@QAEHKH@Z @ 36 NONAME ; int CWsfModel::ConnectWithoutConnWaiterL(unsigned long, int) - ?CheckIsIapIdValidL@CWsfModel@@QBEXI@Z @ 37 NONAME ; void CWsfModel::CheckIsIapIdValidL(unsigned int) const + ?RefreshScan@CWsfModel@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 8 NONAME ; void CWsfModel::RefreshScan(class TPckgBuf &, class TRequestStatus &) + ?SetEngineObserver@CWsfModel@@QAEXPAVMWsfModelObserver@@@Z @ 9 NONAME ; void CWsfModel::SetEngineObserver(class MWsfModelObserver *) + ?ConnectL@CWsfModel@@QAEHK@Z @ 10 NONAME ; int CWsfModel::ConnectL(unsigned long) + ?CheckIsIapIdValidL@CWsfModel@@QBEXI@Z @ 11 NONAME ; void CWsfModel::CheckIsIapIdValidL(unsigned int) const + ?SetActiveViewL@CWsfModel@@QAEXH@Z @ 12 NONAME ; void CWsfModel::SetActiveViewL(int) + ?NewLC@CWsfModel@@SAPAV1@AAVMWsfStateChangeObserver@@H@Z @ 13 NONAME ; class CWsfModel * CWsfModel::NewLC(class MWsfStateChangeObserver &, int) + ?IsScanEnabledL@CWsfModel@@QAEHXZ @ 14 NONAME ; int CWsfModel::IsScanEnabledL(void) + ?SetConnectResultL@CWsfModel@@QAEXHI@Z @ 15 NONAME ; void CWsfModel::SetConnectResultL(int, unsigned int) + ?AbortScanningL@CWsfModel@@QAEXXZ @ 16 NONAME ; void CWsfModel::AbortScanningL(void) + ?TestAccessPointL@CWsfModel@@QAEHAAVTWsfWlanInfo@@HH@Z @ 17 NONAME ; int CWsfModel::TestAccessPointL(class TWsfWlanInfo &, int, int) + ?CancelNotifyEvents@CWsfModel@@QAEXXZ @ 18 NONAME ; void CWsfModel::CancelNotifyEvents(void) + ??1CWsfModel@@UAE@XZ @ 19 NONAME ; CWsfModel::~CWsfModel(void) + ?LaunchHelperApplicationL@CWsfModel@@QAEXAAVTWsfWlanInfo@@HH@Z @ 20 NONAME ; void CWsfModel::LaunchHelperApplicationL(class TWsfWlanInfo &, int, int) + ?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) + ?GetWlanList@CWsfModel@@QAEXAAV?$TPckgBuf@I@@AAVTPtr8@@AAVTRequestStatus@@@Z @ 35 NONAME ; void CWsfModel::GetWlanList(class TPckgBuf &, class TPtr8 &, class TRequestStatus &) + ?RequestNotifyEventsL@CWsfModel@@QAEXAAVMWsfStateChangeObserver@@@Z @ 36 NONAME ; void CWsfModel::RequestNotifyEventsL(class MWsfStateChangeObserver &) + ?LaunchBrowserL@CWsfModel@@UAEXK@Z @ 37 NONAME ; void CWsfModel::LaunchBrowserL(unsigned long) + ?RefreshScanL@CWsfModel@@QAEHXZ @ 38 NONAME ; int CWsfModel::RefreshScanL(void) + ?Disconnect@CWsfModel@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 39 NONAME ; void CWsfModel::Disconnect(class TPckgBuf &, class TRequestStatus &) + ?SetObservedWlanL@CWsfModel@@QAEXABVTDesC8@@@Z @ 40 NONAME ; void CWsfModel::SetObservedWlanL(class TDesC8 const &) + ?GetConnectedWlanDetails@CWsfModel@@QAEXAAV?$TPckgBuf@H@@AAVTWsfWlanInfo@@AAVTRequestStatus@@@Z @ 41 NONAME ; void CWsfModel::GetConnectedWlanDetails(class TPckgBuf &, class TWsfWlanInfo &, class TRequestStatus &) diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/model/eabi/wsfmodelu.def --- a/wlanutilities/wlansniffer/model/eabi/wsfmodelu.def Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/model/eabi/wsfmodelu.def Fri Mar 12 15:48:54 2010 +0200 @@ -1,42 +1,46 @@ EXPORTS _ZN15CWsfAppLauncher4NewLEv @ 1 NONAME _ZN15CWsfAppLauncher5NewLCEv @ 2 NONAME - _ZN9CWsfModel10RefreshingEv @ 3 NONAME - _ZN9CWsfModel11ActiveViewLEv @ 4 NONAME - _ZN9CWsfModel11DisconnectLEv @ 5 NONAME - _ZN9CWsfModel11EnableScanLEv @ 6 NONAME - _ZN9CWsfModel12DisableScanLEv @ 7 NONAME - _ZN9CWsfModel12GetWlanListLEv @ 8 NONAME - _ZN9CWsfModel12IsConnectedLEv @ 9 NONAME - _ZN9CWsfModel12ObservedWlanEv @ 10 NONAME - _ZN9CWsfModel12RefreshScanLEv @ 11 NONAME - _ZN9CWsfModel14AbortScanningLEv @ 12 NONAME - _ZN9CWsfModel14IsScanEnabledLEv @ 13 NONAME - _ZN9CWsfModel14LaunchBrowserLEm @ 14 NONAME - _ZN9CWsfModel14SetActiveViewLEi @ 15 NONAME - _ZN9CWsfModel15SetRefreshStateEi @ 16 NONAME - _ZN9CWsfModel16AbortConnectingLEv @ 17 NONAME - _ZN9CWsfModel16FinalizeConnectLEv @ 18 NONAME - _ZN9CWsfModel16SetObservedWlanLERK6TDesC8 @ 19 NONAME - _ZN9CWsfModel16TestAccessPointLER12TWsfWlanInfoii @ 20 NONAME - _ZN9CWsfModel17ContinueBrowsingLEm @ 21 NONAME - _ZN9CWsfModel17ContinueBrowsingLEv @ 22 NONAME - _ZN9CWsfModel17SetEngineObserverEP17MWsfModelObserver @ 23 NONAME - _ZN9CWsfModel18CancelNotifyEventsEv @ 24 NONAME - _ZN9CWsfModel18CreateAccessPointLER12TWsfWlanInfoi @ 25 NONAME - _ZN9CWsfModel18IctsTestPermissionEv @ 26 NONAME - _ZN9CWsfModel20RequestNotifyEventsLER23MWsfStateChangeObserver @ 27 NONAME - _ZN9CWsfModel23CleanUpCancelledLaunchLEv @ 28 NONAME - _ZN9CWsfModel24GetConnectedWlanDetailsLER12TWsfWlanInfo @ 29 NONAME - _ZN9CWsfModel24LaunchHelperApplicationLER12TWsfWlanInfoii @ 30 NONAME - _ZN9CWsfModel25ConnectWithoutConnWaiterLEmi @ 31 NONAME - _ZN9CWsfModel25TestConnectedAccessPointLER12TWsfWlanInfoi @ 32 NONAME - _ZN9CWsfModel4NewLER23MWsfStateChangeObserveri @ 33 NONAME - _ZN9CWsfModel5NewLCER23MWsfStateChangeObserveri @ 34 NONAME - _ZN9CWsfModel8ConnectLEm @ 35 NONAME - _ZN9CWsfModelD0Ev @ 36 NONAME - _ZN9CWsfModelD1Ev @ 37 NONAME - _ZN9CWsfModelD2Ev @ 38 NONAME - _ZThn12_N9CWsfModel14LaunchBrowserLEm @ 39 NONAME - _ZNK9CWsfModel18CheckIsIapIdValidLEj @ 40 NONAME + _ZN9CWsfModel10DisconnectER8TPckgBufIiER14TRequestStatus @ 3 NONAME + _ZN9CWsfModel10RefreshingEv @ 4 NONAME + _ZN9CWsfModel11ActiveViewLEv @ 5 NONAME + _ZN9CWsfModel11DisconnectLEv @ 6 NONAME + _ZN9CWsfModel11EnableScanLEv @ 7 NONAME + _ZN9CWsfModel11GetWlanListER8TPckgBufIjER5TPtr8R14TRequestStatus @ 8 NONAME + _ZN9CWsfModel11RefreshScanER8TPckgBufIiER14TRequestStatus @ 9 NONAME + _ZN9CWsfModel12DisableScanLEv @ 10 NONAME + _ZN9CWsfModel12GetWlanListLEv @ 11 NONAME + _ZN9CWsfModel12IsConnectedLEv @ 12 NONAME + _ZN9CWsfModel12ObservedWlanEv @ 13 NONAME + _ZN9CWsfModel12RefreshScanLEv @ 14 NONAME + _ZN9CWsfModel14AbortScanningLEv @ 15 NONAME + _ZN9CWsfModel14IsScanEnabledLEv @ 16 NONAME + _ZN9CWsfModel14LaunchBrowserLEm @ 17 NONAME + _ZN9CWsfModel14SetActiveViewLEi @ 18 NONAME + _ZN9CWsfModel15GetWlanListSizeER8TPckgBufIjER14TRequestStatus @ 19 NONAME + _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 + _ZN9CWsfModel24GetConnectedWlanDetailsLER12TWsfWlanInfo @ 32 NONAME + _ZN9CWsfModel24LaunchHelperApplicationLER12TWsfWlanInfoii @ 33 NONAME + _ZN9CWsfModel25TestConnectedAccessPointLER12TWsfWlanInfoi @ 34 NONAME + _ZN9CWsfModel4NewLER23MWsfStateChangeObserveri @ 35 NONAME + _ZN9CWsfModel5NewLCER23MWsfStateChangeObserveri @ 36 NONAME + _ZN9CWsfModel8ConnectLER8TPckgBufIiEm18TWsfIapPersistenceR14TRequestStatus @ 37 NONAME + _ZN9CWsfModel8ConnectLEm @ 38 NONAME + _ZN9CWsfModelD0Ev @ 39 NONAME + _ZN9CWsfModelD1Ev @ 40 NONAME + _ZN9CWsfModelD2Ev @ 41 NONAME + _ZNK9CWsfModel18CheckIsIapIdValidLEj @ 42 NONAME + _ZThn12_N9CWsfModel14LaunchBrowserLEm @ 43 NONAME + _ZN9CWsfModel23GetConnectedWlanDetailsER8TPckgBufIiER12TWsfWlanInfoR14TRequestStatus @ 44 NONAME diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/model/inc/wsfmodel.h --- a/wlanutilities/wlansniffer/model/inc/wsfmodel.h Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/model/inc/wsfmodel.h Fri Mar 12 15:48:54 2010 +0200 @@ -16,6 +16,7 @@ */ + #ifndef C_WSFMODEL_H #define C_WSFMODEL_H @@ -107,7 +108,28 @@ * @return Array of WLANs */ IMPORT_C CWsfWlanInfoArray* GetWlanListL(); + + /** + * Asyncronous request to the server to return wlan list size + * @since S60 5.2 + * @param aPckg request result + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void GetWlanListSize( TPckgBuf& aPckg, + TRequestStatus& aStatus ); + /** + * Asyncronous request to the server to return wlan list + * @since S60 5.2 + * @param aPckg request result + * @param aPtr wlan list + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void GetWlanList( TPckgBuf& aPckg, TPtr8& aPtr, + TRequestStatus& aStatus ); + /** * Store active views UID * @since S60 5.0 @@ -144,17 +166,25 @@ IMPORT_C int ConnectL( TUint32 aIapId ); /** - * Connects to the given WLAN IAP + * 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 aPersistence The value of the persistence property + * @param aStatus The request status object used to contain + * the completion status of the request. */ - IMPORT_C int ConnectWithoutConnWaiterL( TUint32 aIapId, - TBool aTestedAccessPoint ); + IMPORT_C void ConnectL( TPckgBuf& aPckg, TUint32 aIapId, + TWsfIapPersistence aPersistence, + TRequestStatus& aStatus ); + /** - * Starts auto-disconnect timer for connected network + * Sets connection result * @since S60 5.2 + * @param aResult connection result + * @param aIapId WLAN IAP */ - IMPORT_C void FinalizeConnectL(); + IMPORT_C void SetConnectResultL( TInt aResult, TUint aIapId ); /** * Disconnects WLAN @@ -163,6 +193,16 @@ IMPORT_C void DisconnectL(); /** + * Asyncronous request to the server to disconnect + * @since S60 5.2 + * @param aPckg request result + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void Disconnect( TPckgBuf& aPckg, + TRequestStatus& aStatus ); + + /** * Check if the engine is refreshing * @since S60 5.0 * @return ETrue if first refreshing @@ -259,6 +299,16 @@ */ IMPORT_C TBool RefreshScanL(); + /** + * Asyncronous request to the server to make a scan + * @since S60 5.2 + * @param aPckg request result + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void RefreshScan( TPckgBuf& aPckg, + TRequestStatus& aStatus ); + /** * Launches and helper application to create an accesspoint * @since S60 5.0 @@ -301,6 +351,18 @@ * @return ETrue if success, EFalse otherwise. */ IMPORT_C TBool GetConnectedWlanDetailsL( TWsfWlanInfo& aWlanInfo ); + + /** + * Asyncronous request to the server to return connected network + * @since S60 5.2 + * @param aPckg request result + * @param aWlanInfo The wlaninfo object to fill + * @param aStatus The request status object used to contain + * the completion status of the request. + */ + IMPORT_C void GetConnectedWlanDetails( TPckgBuf& aPckg, + TWsfWlanInfo& aWlanInfo, + TRequestStatus& aStatus ); /** * Queries whether a connecting process is going on @@ -353,14 +415,6 @@ IMPORT_C void LaunchBrowserL( TUint32 aIapId ); - /** - * Cleans up the possibly temporary IAP after user cancelled - * the browser launch - * @since S60 5.0 - */ - IMPORT_C void CleanUpCancelledLaunchL(); - - public: // From MWsfBrowserLaunchObserver /** @@ -528,6 +582,11 @@ * Indicates if "Connect" or "Start Web browsing" is selected. */ TBool iConnectOnly; + + /** + * ICT class. Owned. + */ + CIctsClientInterface* iIct; }; diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/model/src/wsfmodel.cpp --- a/wlanutilities/wlansniffer/model/src/wsfmodel.cpp Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/model/src/wsfmodel.cpp Fri Mar 12 15:48:54 2010 +0200 @@ -96,6 +96,19 @@ // 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; @@ -143,6 +156,7 @@ // EXPORT_C void CWsfModel::SetEngineObserver( MWsfModelObserver* aObserver ) { + LOG_ENTERFN( "CWsfModel::SetEngineObserver" ); iObserver = aObserver; } @@ -161,6 +175,30 @@ // ---------------------------------------------------------------------------- +// CWsfModel::GetWlanListSize +// ---------------------------------------------------------------------------- +// +EXPORT_C void CWsfModel::GetWlanListSize( TPckgBuf& aPckg, + TRequestStatus& aStatus ) + { + LOG_ENTERFN( "CWsfModel::GetWlanListSize" ); + iSession.GetWlanListSize( aPckg, aStatus ); + } + + +// ---------------------------------------------------------------------------- +// CWsfModel::GetWlanList +// ---------------------------------------------------------------------------- +// +EXPORT_C void CWsfModel::GetWlanList( TPckgBuf& aPckg, TPtr8& aPtr, + TRequestStatus& aStatus ) + { + LOG_ENTERFN( "CWsfModel::GetWlanList" ); + iSession.GetWlanList( aPckg, aPtr, aStatus ); + } + + +// ---------------------------------------------------------------------------- // CWsfModel::SetActiveViewL // ---------------------------------------------------------------------------- // @@ -234,16 +272,6 @@ { iObserver->ConnectingFinishedL( err ); } - - TBool timerStarted( EFalse ); - timerStarted = iSession.ControlDisconnectTimerL( - EAdcStartTimer | EAdcTimerReset ); - - if ( !timerStarted ) - { - LOG_WRITE( "auto-disconnect timer couldn't be started!" ); - } - iRefreshing = iSession.RequestScanL(); @@ -252,46 +280,36 @@ // ---------------------------------------------------------------------------- -// CWsfModel::ConnectWithoutConnWaiterL +// CWsfModel::ConnectL // ---------------------------------------------------------------------------- // -EXPORT_C int CWsfModel::ConnectWithoutConnWaiterL( TUint32 aIapId, - TBool aTestedAccessPoint ) +EXPORT_C void CWsfModel::ConnectL( TPckgBuf& aPckg, TUint32 aIapId, + TWsfIapPersistence aPersistence, + TRequestStatus& aStatus ) { - LOG_ENTERFN( "CWsfModel::ConnectWithoutConnWaiterL" ); + LOG_ENTERFN( "CWsfModel::ConnectL" ); if ( iObserver ) { iObserver->ConnectingL( aIapId ); } - if ( aTestedAccessPoint ) - { - return iSession.ConnectWlanBearerWithoutConnWaiterL( aIapId, - EIapPersistent ); - } - else - { - return iSession.ConnectWlanBearerWithoutConnWaiterL( aIapId, - EIapExpireOnDisconnect ); - } + + iSession.ConnectWlanBearer( aPckg, aIapId, aPersistence, aStatus ); } - // ---------------------------------------------------------------------------- -// CWsfModel::FinalizeConnectL +// CWsfModel::SetConnectResultL // ---------------------------------------------------------------------------- // -EXPORT_C void CWsfModel::FinalizeConnectL() +EXPORT_C void CWsfModel::SetConnectResultL( TInt aResult, TUint /*aIapId*/ ) { - LOG_ENTERFN( "CWsfModel::FinalizeConnectL" ); + LOG_ENTERFN( "CWsfModel::SetConnectResultL" ); - TBool timerStarted( EFalse ); - timerStarted = iSession.ControlDisconnectTimerL( - EAdcStartTimer | EAdcTimerReset ); + iSession.SetConnectWlanBearerResult( aResult ); - if ( !timerStarted ) + if ( iObserver && aResult != KErrNone ) { - LOG_WRITE( "auto-disconnect timer couldn't be started!" ); + iObserver->ConnectingFinishedL( aResult ); } } @@ -307,7 +325,21 @@ iConnectedIapId = 0; iConnectedNetId = 0; iConnectOnly = EFalse; - iRefreshing = iSession.RequestScanL(); + iRefreshing = iSession.RequestScanL(); + } + + +// ---------------------------------------------------------------------------- +// CWsfModel::Disconnect +// ---------------------------------------------------------------------------- +// +EXPORT_C void CWsfModel::Disconnect( TPckgBuf& aPckg, TRequestStatus& aStatus ) + { + LOG_ENTERFN( "CWsfModel::Disconnect" ); + iSession.DisconnectWlanBearer( aPckg, aStatus ); + iConnectedIapId = 0; + iConnectedNetId = 0; + iConnectOnly = EFalse; } @@ -387,8 +419,6 @@ { LOG_WRITE( "launching browser..." ); iConnectedIapId = aIapId; - iSession.MonitorAccessPointL( aIapId ); - iSession.ControlDisconnectTimerL( EAdcStopTimer ); iBrowserLauncher->LaunchBrowserL( *this, aIapId ); } else if ( iBrowserLauncher->BrowserIap() == aIapId ) @@ -398,17 +428,6 @@ } } - - -// ---------------------------------------------------------------------------- -// CWsfModel::CleanUpCancelledLaunchL -// ---------------------------------------------------------------------------- -// -EXPORT_C void CWsfModel::CleanUpCancelledLaunchL() - { - LOG_ENTERFN( "CWsfModel::CleanUpCancelledLaunchL" ); - iSession.SetIapPersistenceL( EIapForcedExpiry ); - } // ---------------------------------------------------------------------------- @@ -498,19 +517,6 @@ LOG_WRITEF( "MakeIctIapPersistentL leaved with error = %d", err ); } } - - if ( iKeepConnection ) - { - // trigger the auto-disconnect timer as well - TBool timerStarted( EFalse ); - TRAP_IGNORE( timerStarted = iSession.ControlDisconnectTimerL( - EAdcStartTimer | EAdcTimerReset ) ); - - if ( !timerStarted ) - { - LOG_WRITE( "auto-disconnect timer couldn't be started!" ); - } - } LOG_WRITE( "before AsyncStop" ); // finally stop blocking the caller @@ -519,9 +525,8 @@ { LOG_WRITE( "ICT: AsyncStop" ); iIctWait.AsyncStop(); - } - - + } + } // ----------------------------------------------------------------------------- @@ -797,14 +802,6 @@ if ( err == KErrNone && ictTestPermission == EIctsNeverRun ) { LOG_WRITE( "ICT is set to never run, IAP remains temporary" ); - - if ( !iKeepConnection ) - { - //get the engine monitor the IAP - iSession.MonitorAccessPointL( iIctWlanInfo.iIapId ); - iSession.SetIapPersistenceL( EIapExpireOnShutdown ); - iSession.MonitorAccessPointL( iIctWlanInfo.iIapId ); - } ConnectivityObserver( EConnectionNotOk, KNullDesC ); } @@ -856,13 +853,19 @@ CleanupStack::PopAndDestroy( &cmManager ); LOG_WRITE( "starting ICT test..." ); - CIctsClientInterface* ict = CIctsClientInterface::NewL( - iConnectedIapId, - iConnectedNetId, - *this ); + + if ( iIct ) + { + iIct->CancelStartL(); + delete iIct; + iIct = NULL; + } + + iIct = CIctsClientInterface::NewL( iConnectedIapId, + iConnectedNetId, + *this ); LOG_WRITE( "ICT created" ); - CleanupStack::PushL( ict ); - ict->StartL(); + iIct->StartL(); LOG_WRITE( "ICT: started" ); // enter a waitloop since ICT is a kind of asynchronous service @@ -871,9 +874,8 @@ LOG_WRITE( "ICT: iIctWait started" ); iIctWait.Start(); } - + iIctEnded = EFalse; - CleanupStack::PopAndDestroy( ict ); LOG_WRITE( "ICT test done." ); } @@ -898,6 +900,18 @@ LOG_WRITEF( "iRefreshing = %d", iRefreshing ); return iRefreshing; } + + +// ---------------------------------------------------------------------------- +// CWsfModel::RefreshScan +// ---------------------------------------------------------------------------- +// +EXPORT_C void CWsfModel::RefreshScan( TPckgBuf& aPckg, + TRequestStatus& aStatus ) + { + LOG_ENTERFN( "CWsfModel::RefreshScan" ); + iSession.RequestScan( aPckg, aStatus ); + } // ---------------------------------------------------------------------------- @@ -978,12 +992,6 @@ LOG_ENTERFN( "CWsfModel::BrowserLaunchFailed" ); LOG_WRITEF( "error = %d", aError ); - // do the cleanup if necessary - TRAP_IGNORE( - iSession.SetIapPersistenceL( EIapForcedExpiry ); - iSession.ControlDisconnectTimerL( EAdcStartTimer | EAdcTimerReset ); - ); - if ( iObserver ) { iObserver->BrowserLaunchFailed( aError ); @@ -999,6 +1007,8 @@ { LOG_ENTERFN( "CWsfModel::BrowserLaunchCompleteL" ); + iSession.MonitorAccessPointL( iConnectedIapId ); + if ( iObserver ) { iObserver->BrowserLaunchCompleteL(); @@ -1016,7 +1026,6 @@ // browser has been terminated, do the cleanup if necessary iSession.SetIapPersistenceL( EIapForcedExpiry ); - iSession.ControlDisconnectTimerL( EAdcStartTimer | EAdcTimerReset ); if ( iObserver ) { @@ -1064,6 +1073,17 @@ return iSession.GetConnectedWlanDetailsL( aWlanInfo ); } +// ---------------------------------------------------------------------------- +// CWsfModel::GetConnectedWlanDetails +// ---------------------------------------------------------------------------- +// +EXPORT_C void CWsfModel::GetConnectedWlanDetails( TPckgBuf& aPckg, + TWsfWlanInfo& aWlanInfo, + TRequestStatus& aStatus ) + { + iSession.GetConnectedWlanDetails( aPckg, aWlanInfo, aStatus ); + } + // ---------------------------------------------------------------------------- // CWsfModel::AbortConnectingL diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/widget/widget_2001E637/xuikon/00/wsfwidget.xml --- a/wlanutilities/wlansniffer/widget/widget_2001E637/xuikon/00/wsfwidget.xml Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/widget/widget_2001E637/xuikon/00/wsfwidget.xml Fri Mar 12 15:48:54 2010 +0200 @@ -32,12 +32,10 @@ - - diff -r c2bc3f8c7777 -r dff6ebfd236f wlanutilities/wlansniffer/widget/widget_20026F45/xuikon/00/wsfwidget.xml --- a/wlanutilities/wlansniffer/widget/widget_20026F45/xuikon/00/wsfwidget.xml Fri Feb 19 23:55:42 2010 +0200 +++ b/wlanutilities/wlansniffer/widget/widget_20026F45/xuikon/00/wsfwidget.xml Fri Mar 12 15:48:54 2010 +0200 @@ -28,12 +28,10 @@ - -