# HG changeset patch # User hgs # Date 1276173894 -10800 # Node ID 195ec9e7dd85323c8a01a79a441459d66d9affd4 # Parent f54b8905a6ee1ccfb88429d47b4b332c81280270 201023 diff -r f54b8905a6ee -r 195ec9e7dd85 hotspotfw/hsclient/inc/hssiaphandler.h --- a/hotspotfw/hsclient/inc/hssiaphandler.h Thu May 27 13:55:50 2010 +0300 +++ b/hotspotfw/hsclient/inc/hssiaphandler.h Thu Jun 10 15:44:54 2010 +0300 @@ -109,6 +109,12 @@ void ConvertAsciiToHex( const TDes8& aSource, HBufC8*& aDest ); + /** + * Removes brackets from UID + * @param aUid, UID of the client + */ + void ModifyClientUid( TDes& aUid ); + private: // Data /** diff -r f54b8905a6ee -r 195ec9e7dd85 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Thu May 27 13:55:50 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Thu Jun 10 15:44:54 2010 +0300 @@ -371,8 +371,11 @@ { DEBUG("CHssIapSettingsHandler::GetClientsIapsL"); TBuf<32> buffer; // Temporary buffer for found UID from destination. - TUidName uidClient = aUId.Name(); // UID of the client. TUint32 iapId = 0; // IAP Identifiier. + TBuf uidClient; // UID of the client. + + uidClient.Copy( aUId.Name() ); + ModifyClientUid( uidClient ); RArray destArray = RArray( 10 ); // KCmArrayGranularity instead of 10 CleanupClosePushL( destArray ); @@ -424,4 +427,23 @@ CleanupStack::PopAndDestroy( &destArray ); } +// ----------------------------------------------------------------------------- +// ModifyClientUid +// ----------------------------------------------------------------------------- +// +void CHssIapHandler::ModifyClientUid( TDes& aUid ) + { + DEBUG("CHssIapHandler::ModifyClientUid"); + TInt indx = aUid.Find( KMark1 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + indx = aUid.Find( KMark2 ); + if ( KErrNotFound != indx ) + { + aUid.Delete( indx, 1 ); + } + } + } + // End of File diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/context/commsdat_files/50_default.cre Binary file wlanutilities/wlanqtutilities/ut/context/commsdat_files/50_default.cre has changed diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/context/commsdat_files/default.cre Binary file wlanutilities/wlanqtutilities/ut/context/commsdat_files/default.cre has changed diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.cpp --- a/wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,237 +0,0 @@ -/* -* Copyright (c) 2009 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: -* This is the source file for Connection Utilities test context. -*/ - -#include -#include -#include -#include -#include "wlanqtutilscommon.h" -#include "wlanqtutilstestcontext.h" -#include "wlanqtutilswlanap.h" -#include "wlanqtutilsactiveconn.h" - -// --------------------------------------------------------- -// class WlanQtUtilsCtxEsock -// --------------------------------------------------------- - -WlanQtUtilsCtxEsock::WlanQtUtilsCtxEsock() : startRetValue_(KErrNone) -{ -} - -WlanQtUtilsCtxEsock::~WlanQtUtilsCtxEsock() -{ -} - -void WlanQtUtilsCtxEsock::initialize() -{ - startRetValue_ = KErrNone; -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxActiveConn -// --------------------------------------------------------- - -WlanQtUtilsCtxActiveConn::WlanQtUtilsCtxActiveConn() : - WlanQtUtilsActiveConn(), - connMonBearerType_(EBearerUnknown), - connMonConnectionStatus_(KConnectionUninitialised), - connMonWlanConnectionMode_(-1), - connMonWlanSecurityMode_(-1), - applicationUids_() -{ -} - -WlanQtUtilsCtxActiveConn::~WlanQtUtilsCtxActiveConn() -{ -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxActiveConnections -// --------------------------------------------------------- - -WlanQtUtilsCtxActiveConnections::WlanQtUtilsCtxActiveConnections() : activeConnList_() -{ -} - -WlanQtUtilsCtxActiveConnections::~WlanQtUtilsCtxActiveConnections() -{ - clearActiveConnList(); -} - -void WlanQtUtilsCtxActiveConnections::initialize() -{ - clearActiveConnList(); -} - -void WlanQtUtilsCtxActiveConnections::createDefaultActiveConnList(int numberOfActiveConns, int firstIapId) -{ - clearActiveConnList(); - for (int i = 0; i < numberOfActiveConns; i++) { - WlanQtUtilsCtxActiveConn *activeConn = new WlanQtUtilsCtxActiveConn(); - - activeConn->setConnectionId((i + 1) * 100); - activeConn->setIapId(firstIapId + i); - activeConn->connMonConnectionStatus_ = KConnectionOpen; - activeConn->setConnectionStatus(WlanQtUtilsConnectionStatusConnected); - - // WLAN connection. - activeConn->connMonBearerType_ = EBearerWLAN; - activeConn->setBearerType(WlanQtUtilsBearerTypeWlan); - activeConn->connMonWlanSecurityMode_ = EConnMonSecurityOpen; - activeConn->connMonWlanConnectionMode_ = EConnMonInfraStructure; - activeConnList_.append(activeConn); - } -} - -void WlanQtUtilsCtxActiveConnections::clearActiveConnList() -{ - Q_FOREACH(WlanQtUtilsCtxActiveConn* activeConn, activeConnList_) { - delete activeConn; - } - activeConnList_.clear(); -} - -void WlanQtUtilsCtxActiveConnections::verifyActiveConnList(QList activeConnList) -{ - QCOMPARE(activeConnList.count(), activeConnList_.count()); - - for (int i = 0; i < activeConnList_.count(); i++) { - QCOMPARE(activeConnList[i]->connectionId(), activeConnList_[i]->connectionId()); - QCOMPARE(activeConnList[i]->iapId(), activeConnList_[i]->iapId()); - QCOMPARE(activeConnList[i]->connectionStatus(), activeConnList_[i]->connectionStatus()); - QCOMPARE(activeConnList[i]->bearerType(), activeConnList_[i]->bearerType()); - } -} - -WlanQtUtilsCtxActiveConn *WlanQtUtilsCtxActiveConnections::findActiveConn(uint connectionId) const -{ - WlanQtUtilsCtxActiveConn *activeConn = NULL; - for (int i = 0; i < activeConnList_.count(); i++) { - if (activeConnList_[i]->connectionId() == connectionId) { - activeConn = activeConnList_[i]; - } - } - Q_ASSERT(activeConn != NULL); - return activeConn; -} - -// --------------------------------------------------------- -// class WlanQtUtilsWlanScanResult -// --------------------------------------------------------- - -WlanQtUtilsWlanScanResult::WlanQtUtilsWlanScanResult() : wlanScanResultList_() -{ -} - -WlanQtUtilsWlanScanResult::~WlanQtUtilsWlanScanResult() -{ - clearWlanScanResultList(); -} - -void WlanQtUtilsWlanScanResult::initialize() -{ - clearWlanScanResultList(); -} - -void WlanQtUtilsWlanScanResult::createDefaultWlanScanResultList(int numberOfWlanAps) -{ - clearWlanScanResultList(); - for (int i = 0; i < numberOfWlanAps; i++) { - WlanQtUtilsWlanAp *ap = new WlanQtUtilsWlanAp(); - ap->setSsid("TestWlanAp" + QString::number(i+1)); - ap->setBssid("addMAC"); // TODO: Generate something when bssid retrieval works. - ap->setSignalStrength(20); - ap->setConnectionMode(EConnMonInfraStructure); - ap->setSecurityMode(WlanQtUtilsWlanSecModeOpen); - // TODO: Create constructor to WlanQtUtilsWlanAp which takes all member variables as parameter. - wlanScanResultList_.append(ap); - } -} - -void WlanQtUtilsWlanScanResult::clearWlanScanResultList() -{ - Q_FOREACH(WlanQtUtilsWlanAp* ap, wlanScanResultList_) { - delete ap; - } - wlanScanResultList_.clear(); -} - -void WlanQtUtilsWlanScanResult::verifyWlanScanResultList(QList wlanApList) -{ - QCOMPARE(wlanApList.count(), wlanScanResultList_.count()); - - for (int i = 0; i < wlanScanResultList_.count(); i++) { - QCOMPARE(wlanApList[i]->ssid(), wlanScanResultList_[i]->ssid()); - QCOMPARE(wlanApList[i]->bssid(), wlanScanResultList_[i]->bssid()); - QCOMPARE(wlanApList[i]->signalStrength(), wlanScanResultList_[i]->signalStrength()); - QCOMPARE(wlanApList[i]->connectionMode(), wlanScanResultList_[i]->connectionMode()); - QCOMPARE(wlanApList[i]->securityMode(), wlanScanResultList_[i]->securityMode()); - } -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxConnMon -// --------------------------------------------------------- - -WlanQtUtilsCtxConnMon::WlanQtUtilsCtxConnMon() : wlanScanResult_() -{ -} - -WlanQtUtilsCtxConnMon::~WlanQtUtilsCtxConnMon() -{ -} - -void WlanQtUtilsCtxConnMon::initialize() -{ - wlanScanResult_.initialize(); - activeConnections_.initialize(); -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxIct -// --------------------------------------------------------- - -WlanQtUtilsCtxIct::WlanQtUtilsCtxIct() -{ -} - -WlanQtUtilsCtxIct::~WlanQtUtilsCtxIct() -{ -} - -void WlanQtUtilsCtxIct::initialize() -{ -} - -// --------------------------------------------------------- -// class WlanQtUtilsTestContext -// --------------------------------------------------------- - -WlanQtUtilsTestContext::WlanQtUtilsTestContext() : esock_(), connMon_(), ict_() -{ -} - -WlanQtUtilsTestContext::~WlanQtUtilsTestContext() -{ -} - -void WlanQtUtilsTestContext::initialize() -{ - esock_.initialize(); - connMon_.initialize(); - ict_.initialize(); -} diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.h --- a/wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -/* -* Copyright (c) 2009 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: -* This is the header file for Wlan Qt Utilities test context. -*/ - -#ifndef WLANQTUTILSTESTCONTEXT_H -#define WLANQTUTILSTESTCONTEXT_H - -#include - -#include "wlanqtutilsactiveconn.h" - -class WlanQtUtilsWlanAp; - -/** - * This is context for esock library. - */ -class WlanQtUtilsCtxEsock : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxEsock(); - ~WlanQtUtilsCtxEsock(); - - /** - * Initializes context. - */ - void initialize(); - - /** Return value of RConnection::Start(). */ - int startRetValue_; -}; - -/** - * This class is a helper class for testing purposes. It derives all properties of WlanQtUtilsActiveConn. - * In addition, this class contains member variables for setting some Connection Monitor specific - * values which cannot be easily generated from member variables of WlanQtUtilsActiveConn. - * E.g., connection status has different enum in Connection Monitor and Wlan Qt Utilities. This class - * enables setting both of those. Connmon version is set so that the stub can return it when - * requested, and Wlan Qt Utilities version is used for verifying that tested code returns right - * value. - */ -class WlanQtUtilsCtxActiveConn : public WlanQtUtilsActiveConn -{ -public: - WlanQtUtilsCtxActiveConn(); - ~WlanQtUtilsCtxActiveConn(); - - /** Bearer type in connmon format. */ - int connMonBearerType_; - /** Connection status in connmon format. */ - int connMonConnectionStatus_; - /** WLAN connection mode in connmon format. */ - int connMonWlanConnectionMode_; - /** WLAN security mode in connmon format. */ - int connMonWlanSecurityMode_; - /** Application UIDs that map to application strings. */ - QList applicationUids_; -}; - -/** - * This class represents active connections. - */ -class WlanQtUtilsCtxActiveConnections : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxActiveConnections(); - ~WlanQtUtilsCtxActiveConnections(); - - /** - * Initializes context. - */ - void initialize(); - - /** - * Creates a list of active connections for scan results. - * - * @param[in] numberOfActiveConns Number of active connections that are created. - * @param[in] firstIapId IAP ID of the first connection to be created. - */ - void createDefaultActiveConnList(int numberOfActiveConns, int firstIapId); - - /** - * Verifies that the given active connection list returned by the real application matches - * with the one in the context. - * - * @param[in] activeConnList Active connections that are verified against the context. - */ - void verifyActiveConnList(QList activeConnList); - - /** - * Finds an active connection matching with the given connection ID from the context. - * Asserts if connection with given connection ID is not found. - * - * @param connectionId Connection ID. - * @return Active connection. - */ - WlanQtUtilsCtxActiveConn *findActiveConn(uint connectionId) const; - - /** - * List of active connections that RConnectionMonitor stub will return in response to - * RConnectionMonitor::Get*Attribute() functions. - */ - QList activeConnList_; - - // TODO: We need return values for all different RConnectionMonitor::Get*Attribute() functions - // to test error cases. - -private: - - /** - * Destroys and clears the list of WLAN APs. - */ - void clearActiveConnList(); -}; - -/** - * This class represents WLAN APs that represent the results of WLAN scanning triggered by - * RConnectionMonitor::GetPckgAttribute() - */ -class WlanQtUtilsWlanScanResult : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsWlanScanResult(); - ~WlanQtUtilsWlanScanResult(); - - /** - * Initializes context. - */ - void initialize(); - - /** - * Creates a list of WLAN APs for scan results. - * - * @param[in] numberOfWlanAps Number of WLAN APs that are created. - */ - void createDefaultWlanScanResultList(int numberOfWlanAps); - - /** - * Verifies that the given WLAN AP list returned by the real application matches - * with the one in the context. - * - * @param[in] wlanApList WLAN APs that are verified against the context. - */ - void verifyWlanScanResultList(QList wlanApList); // TODO: Maybe boolean return value - - /** - * List of WLAN access points that RConnectionMonitor stub will return in response to - * RConnectionMonitor::GetPckgAttribute(). - */ - QList wlanScanResultList_; - -private: - - /** - * Destroys and clears the list of WLAN APs. - */ - void clearWlanScanResultList(); -}; - -/** - * Test context for RConnectionMonitor. - */ -class WlanQtUtilsCtxConnMon : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxConnMon(); - ~WlanQtUtilsCtxConnMon(); - - /** - * Initializes context. - */ - void initialize(); - - /** Results of WLAN scanning. */ - WlanQtUtilsWlanScanResult wlanScanResult_; - - /** List of active connections. */ - WlanQtUtilsCtxActiveConnections activeConnections_; -}; - -/** - * Test context for Internet connectivity test library. - */ -class WlanQtUtilsCtxIct : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxIct(); - ~WlanQtUtilsCtxIct(); - - /** - * Initializes context. - */ - void initialize(); -}; - -/** - * Test context. The purpose of this context is to provide values that are used in stubs - * and in verification of outputs in test cases. - * - * In stubs, context is used to verify the inputs of parameters and to set output - * parameters into a specific value. - * - * In test cases, context is used to verify that the output parameters match with the once - * set in the stub. - */ -class WlanQtUtilsTestContext : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsTestContext(); - ~WlanQtUtilsTestContext(); - - /** - * Initializes context. - */ - void initialize(); - - /** Context for esock library. */ - WlanQtUtilsCtxEsock esock_; - /** Context for connmon library. */ - WlanQtUtilsCtxConnMon connMon_; - /** Context for ICTS library. */ - WlanQtUtilsCtxIct ict_; -}; - -#endif /* WLANQTUTILSTESTCONTEXT_H */ - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnmonstub.cpp --- a/wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnmonstub.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,637 +0,0 @@ -/* -* Copyright (c) 2009 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: -* This is a source file for connmon library stub functions -*/ - -#include -#include -#include -#include -#include "wlanqtutilswlanap.h" - -#ifdef __WINS__ - -// TODO: This function is copied from ConnMonWLANNetworksArrayPckg_v2.cpp because this -// function, although being in rconnmon.h, is not in the interface because IMPORT_C/EXPORT_C -// declarations are not used for this particular constructor. The only change that was made to -// this version was to remove traces and some empty lines. This function is needed when -// creating output in RConnectionMonitor::GetPckgAttribute() for WLAN scan results. -// This is needed for both UT and emulator compilation. -CConnMonWlanNetworksPtrArrayPckg::CConnMonWlanNetworksPtrArrayPckg( - const RPointerArray& aRef, - TUint aBufLen ) - { - RPointerArray items; - TUint len( 0 ); - - for ( TUint i( 0 ); i < aRef.Count(); ++i ) - { - const HBufC* item( aRef[i]->ToBuf() ); - if ( item ) - { - // Is there room in buffer - TUint countFields( 3 ); // aRef.Count(); items->Count(); item->Length() - if ( (countFields + len + item->Length()) > aBufLen ) - { - delete item; - item = NULL; - break; - } - items.Append( item ); - ++( len += item->Length() ); // ++ is for item's size - } - else - { - ; // There was a trace. - } - } - // Check that given buflen (aBufLen) is not smaller than one - // item (TConnMonWLANNetwork) + aRef count + items count - // + item length - if ( items.Count() == 0 && aRef.Count() > 0 ) - { - aBufLen = 2; // aRef.Count(), items.Count() - } - - iBuf = HBufC::New( aBufLen ); // Set size exactly to a buffer length - if ( !iBuf ) - { - items.ResetAndDestroy(); - items.Close(); - return; - } - iBuf->Des().Append( aRef.Count() ); // Total amount of data - iBuf->Des().Append( items.Count() ); // Amount of transferring data - for ( TUint i(0); iDes().Append( items[i]->Length() ); - iBuf->Des().Append( *items[i] ); - } - items.ResetAndDestroy(); - items.Close(); - } - -// ----------------------------------------------------------------------------- -// CConnMonEventBase::CConnMonEventBase -// ----------------------------------------------------------------------------- -// -CConnMonEventBase::CConnMonEventBase( const TInt aEventType, const TUint aConnectionId ) - { - iEventType = aEventType; - iConnectionId = aConnectionId; - } - -// Destructor -CConnMonEventBase::~CConnMonEventBase() - { - } - -// ----------------------------------------------------------------------------- -// CConnMonEventBase::EventType -// ----------------------------------------------------------------------------- -// -TInt CConnMonEventBase::EventType() const - { - return iEventType; - } - -// ----------------------------------------------------------------------------- -// CConnMonConnectionStatusChange::CConnMonConnectionStatusChange -// ----------------------------------------------------------------------------- -// -CConnMonConnectionStatusChange::CConnMonConnectionStatusChange( - const TUint aConnectionId, - const TUint aSubConnectionId, - const TInt aConnectionStatus ) : - CConnMonEventBase(EConnMonConnectionStatusChange, aConnectionId) - { - iSubConnectionId = aSubConnectionId; - iConnectionStatus = aConnectionStatus; - } - -// Destructor -CConnMonConnectionStatusChange::~CConnMonConnectionStatusChange() - { - } - -#ifdef WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------- -// Stub functions for connmon library, used in UT -// ---------------------------------------------- - -#include "wlanqtutilstestcontext.h" - -extern WlanQtUtilsTestContext testContext; - -EXPORT_C void RConnectionMonitor::GetConnectionCount( - TUint& aConnectionCount, - TRequestStatus& aStatus) -{ - aConnectionCount = testContext.connMon_.activeConnections_.activeConnList_.count(); - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C TInt RConnectionMonitor::GetConnectionInfo( - const TUint aIndex, - TUint& aConnectionId, - TUint& aSubConnectionCount ) const -{ - aConnectionId = testContext.connMon_.activeConnections_.activeConnList_[aIndex - 1]->connectionId(); - aSubConnectionCount = 0; - return KErrNone; // TODO: put return value into context. -} - -EXPORT_C void RConnectionMonitor::GetIntAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TInt& aValue, - TRequestStatus& aStatus ) -{ - WlanQtUtilsCtxActiveConn *activeConn = testContext.connMon_.activeConnections_.findActiveConn(aConnectionId); - if (aAttribute == KBearer) { - aValue = activeConn->connMonBearerType_; - } else if (aAttribute == KConnectionStatus) { - aValue = activeConn->connMonConnectionStatus_; - } else { - Q_ASSERT(false); - } - User::RequestComplete(&aStatus, KErrNone); // TODO: Take return value from the context. -} - -EXPORT_C void RConnectionMonitor::GetUintAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TUint& aValue, - TRequestStatus& aStatus ) -{ - WlanQtUtilsCtxActiveConn *activeConn = testContext.connMon_.activeConnections_.findActiveConn(aConnectionId); - if (aAttribute == KIAPId) { - aValue = activeConn->iapId(); - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); // TODO: Take return value from the context. -} - -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint aConnectionId, - const TUint aSubConnectionId, - const TUint aAttribute, - TDes8& aValue, - TRequestStatus& aStatus ) const -{ - // This is copy-paste from real implementation and we'll use that for other requests. - TIpcArgs args(aConnectionId, aSubConnectionId, aAttribute, &aValue); - SendReceive(EReqGetPckgAttribute, args, aStatus); -} - -// --------------------------------------------------------- -// connUtils2ConnMonSecModeMap() -// Local function to map WlanQtUtilsWlanSecMode into Connection -// monitor's security mode. Currently for UT use only. -// --------------------------------------------------------- -// -static TUint connUtils2ConnMonSecModeMap(WlanQtUtilsWlanSecMode connUtilsWlanSecMode) -{ - TUint ret; - switch (connUtilsWlanSecMode) { - case WlanQtUtilsWlanSecModeWep: - ret = EConnMonSecurityWep; - break; - case WlanQtUtilsWlanSecMode802_1x: - ret = EConnMonSecurity802d1x; - break; - case WlanQtUtilsWlanSecModeWpa: - ret = EConnMonSecurityWpa; - break; - case WlanQtUtilsWlanSecModeWpa2: - ret = EConnMonSecurityWpaPsk; - break; - default: - ret = EConnMonSecurityOpen; - break; - } - return ret; -} - - - -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint /* aConnectionId */, - const TUint /* aSubConnectionId */, - const TUint /* aAttribute */, - TDes16& aValue, - TRequestStatus& aStatus ) const - { - // TODO: verify input parameters, i.e., first three params... - - RConnMonWlanNetworksPtrArray wlanPtrArray; - RBuf vendorData; - - for (int i = 0; i < testContext.connMon_.wlanScanResult_.wlanScanResultList_.count(); i++) { - WlanQtUtilsWlanAp* ap = testContext.connMon_.wlanScanResult_.wlanScanResultList_[i]; - TBufC name(ap->ssid().utf16()); - - TBufC bssid16(QString("addMAC").utf16()); - TBuf8 bssid; - bssid.Copy(bssid16); - - CConnMonWlanNetwork* wlanAp = CConnMonWlanNetwork::NewL( - name, - ap->connectionMode(), - ap->signalStrength(), - connUtils2ConnMonSecModeMap(ap->securityMode()), - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp); - } - - CConnMonWlanNetworksPtrArrayPckg wlanBuf(wlanPtrArray, 2560); - aValue.Copy(wlanBuf.Buf()->Des()); - - User::RequestComplete(&aStatus, KErrNone); // TODO: enable return value modification. - } - -#else // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------------- -// Stub functions for connmon library, used in emulator -// ---------------------------------------------------- - -#if 0 -// In emulator, there are always two active connections. -// The following functions return different properties of these active connection -// so that it's easy to test in emulator. - -EXPORT_C void RConnectionMonitor::GetConnectionCount( - TUint& aConnectionCount, - TRequestStatus& aStatus) -{ - aConnectionCount = 2; - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C TInt RConnectionMonitor::GetConnectionInfo( - const TUint aIndex, - TUint& aConnectionId, - TUint& aSubConnectionCount ) const -{ - if (aIndex == 1) { - aConnectionId = 10; - } else if (aIndex == 2) { - aConnectionId = 20; - } else { - Q_ASSERT(false); - } - - aSubConnectionCount = 0; - return KErrNone; -} - -EXPORT_C void RConnectionMonitor::GetIntAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TInt& aValue, - TRequestStatus& aStatus ) -{ - if (aAttribute == KBearer) { - if (aConnectionId == 10) { - aValue = EBearerGPRS; - } else if (aConnectionId == 20) { - aValue = EBearerWLAN; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KConnectionStatus) { - if (aConnectionId == 10) { - aValue = KConnectionOpen; - } else if (aConnectionId == 20) { - aValue = KStartingConnection; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KSignalStrength) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = 78; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KNetworkMode) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = EConnMonInfraStructure; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KSecurityMode) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = EConnMonSecurityWpaPsk; - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetUintAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TUint& aValue, - TRequestStatus& aStatus ) -{ - if (aAttribute == KIAPId) { - if (aConnectionId == 10) { - aValue = 1; - } else if (aConnectionId == 20) { - aValue = 10; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KDownlinkData) { - if (aConnectionId == 10) { - aValue = 123; - } else if (aConnectionId == 20) { - aValue = 12345; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KUplinkData) { - if (aConnectionId == 10) { - aValue = 987654321; - } else if (aConnectionId == 20) { - aValue = 1234567890; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KTransmitPower) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = 50; - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetBoolAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TBool& aValue, - TRequestStatus& aStatus ) -{ - if (aAttribute == KConnectionActive) { - if (aConnectionId == 10) { - aValue = EFalse; - } else if (aConnectionId == 20) { - aValue = ETrue; - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetStringAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TDes& aValue, - TRequestStatus& aStatus ) const -{ - if (aAttribute == KIAPName) { - if (aConnectionId == 10) { - _LIT(iapNameLit, "PACKET DATA 1"); - TBufC iapName(iapNameLit); - aValue = iapName.Des(); - } else if (aConnectionId == 20) { - _LIT(iapNameLit, "WLAN IAP 3"); - TBufC iapName(iapNameLit); - aValue = iapName.Des(); - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KNetworkName) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - _LIT(ssidLit, "WLAN SSID 3"); - TBufC ssid(ssidLit); - aValue = ssid.Des(); - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KAccessPointName) { - if (aConnectionId == 10) { - _LIT(iapNameLit, "PACKET DATA 1"); - TBufC iapName(iapNameLit); - aValue = iapName.Des(); - } else if (aConnectionId == 20) { - Q_ASSERT(false); - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint aConnectionId, - const TUint aSubConnectionId, - const TUint aAttribute, - TDes8& aValue, - TRequestStatus& aStatus ) const -{ - if (aAttribute == KStartTime) { - if (aConnectionId == 10) { - TDateTime dateTime(2009, EMarch, 31-1, 15, 15, 15, 0); - TTime time(dateTime); - TConnMonTimeBuf timePckg(time); - aValue.Copy(timePckg); - } else if (aConnectionId == 20) { - TTime time; - time.UniversalTime(); - TConnMonTimeBuf timePckg(time); - aValue.Copy(timePckg); - } else { - Q_ASSERT(false); - } - User::RequestComplete(&aStatus, KErrNone); - } else if (aAttribute == KClientInfo) { - TConnMonClientEnum applications; - if (aConnectionId == 10) { - applications.iCount = 1; - applications.iUid[0].iUid = 0x10008D39; // Web - applications.iUid[1].iUid = 0; - applications.iUid[2].iUid = 0; - applications.iUid[3].iUid = 0; - applications.iUid[4].iUid = 0; - applications.iUid[5].iUid = 0; - applications.iUid[6].iUid = 0; - applications.iUid[7].iUid = 0; - applications.iUid[8].iUid = 0; - applications.iUid[9].iUid = 0; - } else if (aConnectionId == 20) { - applications.iCount = 7; - applications.iUid[0].iUid = 0x101fd9c5; // KBannedServerUID - applications.iUid[1].iUid = 0x1020728E; // KFeedsServerUid - applications.iUid[2].iUid = 0x10008D60; // KDownloadMgrServerUid - applications.iUid[3].iUid = 0x1000484b; // KMessagingServerUid - applications.iUid[4].iUid = 0x102033E6; // KJavaVMUid - applications.iUid[5].iUid = 0x102073CA; // KSUPLServerUid - applications.iUid[6].iUid = 0x200212F3; // Connect Screen - applications.iUid[7].iUid = 0; - applications.iUid[8].iUid = 0; - applications.iUid[9].iUid = 0; - } else { - Q_ASSERT(false); - } - TPckgBuf< TConnMonClientEnum > applicationsPckg( applications ); - aValue.Copy(applicationsPckg); - User::RequestComplete(&aStatus, KErrNone); - } else { - // This is copy-paste from real implementation and we'll use that for other requests. - TIpcArgs args( aConnectionId, aSubConnectionId, aAttribute, &aValue ); - SendReceive( EReqGetPckgAttribute, args, aStatus ); - } -} -#endif - -// This function returns WLAN scan results. -// Six results in every second scan and the others have two. -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint /* aConnectionId */, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TDes16& aValue, - TRequestStatus& aStatus ) const { - - if (aAttribute == KWlanNetworks) { - RConnMonWlanNetworksPtrArray wlanPtrArray; - RBuf vendorData; - - TBufC bssid16(QString("addMAC").utf16()); - TBuf8 bssid; - bssid.Copy(bssid16); - - _LIT(wlanAp1Name, "Test AP 1"); - TBufC name1(wlanAp1Name); - CConnMonWlanNetwork* wlanAp1 = CConnMonWlanNetwork::NewL( - name1, - EConnMonInfraStructure, - 20, - EConnMonSecurityOpen, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp1); - - _LIT(wlanAp2Name, "Test AP 2"); - TBufC name2(wlanAp2Name); - CConnMonWlanNetwork* wlanAp2 = CConnMonWlanNetwork::NewL( - name2, - EConnMonAdHoc, - 20, - EConnMonSecurityOpen, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp2); - - static bool refresh = true; - - if (refresh) { - _LIT(wlanAp3Name, "Test AP 3"); - TBufC name3(wlanAp3Name); - CConnMonWlanNetwork* wlanAp3 = CConnMonWlanNetwork::NewL( - name3, - EConnMonInfraStructure, - 20, - EConnMonSecurityWep, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp3); - - _LIT(wlanAp4Name, "Test AP 4"); - TBufC name4(wlanAp4Name); - CConnMonWlanNetwork* wlanAp4 = CConnMonWlanNetwork::NewL( - name4, - EConnMonInfraStructure, - 20, - EConnMonSecurityOpen, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp4); - - _LIT(wlanAp5Name, "Test AP 5"); - TBufC name5(wlanAp5Name); - CConnMonWlanNetwork* wlanAp5 = CConnMonWlanNetwork::NewL( - name5, - EConnMonInfraStructure, - 20, - EConnMonSecurityWpa, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp5); - - _LIT(wlanAp6Name, "Test AP 6"); - TBufC name6(wlanAp6Name); - CConnMonWlanNetwork* wlanAp6 = CConnMonWlanNetwork::NewL( - name6, - EConnMonInfraStructure, - 20, - EConnMonSecurityWpaPsk, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp6); - - refresh = false; - } else { - refresh = true; - } - - CConnMonWlanNetworksPtrArrayPckg wlanBuf(wlanPtrArray, 2560); // TODO: buffer size to more dynamic or use constant - aValue.Copy(wlanBuf.Buf()->Des()); - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -#endif // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG -#endif // __WINS__ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnteststub.cpp --- a/wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnteststub.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2009 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: -* This is a source file for connmon library stub functions -*/ - -#include - -#ifdef __WINS__ - -#ifdef WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------- -// Stub functions for ICT library, used in UT -// ---------------------------------------------- - -#include "wlanqtutilstestcontext.h" - -extern WlanQtUtilsTestContext testContext; - -// ---------------------------------------------------- -// NewL is not stubbed -> parameters are not checked at all -// ---------------------------------------------------- - -/** - * Empty implementation to prevent actual ICT from starting. Result callback is called directly - * in the test cases. - */ -EXPORT_C void CIctsClientInterface::StartL() - { - } - -#endif // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------------- -// No stubs used in emulator -// ---------------------------------------------------- -#endif // __WINS__ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsesockstub.cpp --- a/wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsesockstub.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2009 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: -* This is a source file for esock library stub functions -*/ - -#include - -#ifdef __WINS__ - -#ifdef WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------- -// Stub functions for esock library, used in UT -// ---------------------------------------------- - -#include "wlanqtutilstestcontext.h" - -extern WlanQtUtilsTestContext testContext; - -/** - * Returns value from test context. - * - * TConnPref value cannot be verified easily because the real value passed to the function is - * TCommDbConnPref. Dynamic cast from TConnPref to TCommDbConnPref does not work because - * TConnPref does not have virtual functions which means that type information for the - * class hierarchy is not created by the compiler. - */ -void RConnection::Start(class TConnPref &, class TRequestStatus &aStatus) -{ - User::RequestComplete(&aStatus, testContext.esock_.startRetValue_); -} - -#else // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------------- -// Stub functions for esock library, used in emulator -// ---------------------------------------------------- - -/** - * Return always success in emulator. - */ -void RConnection::Start(class TConnPref &, class TRequestStatus &aStatus) -{ - User::RequestComplete(&aStatus, KErrNone); -} - -#endif // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG -#endif // __WINS__ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/t_wlanqtutils/t_wlanqtutils.pro --- a/wlanutilities/wlanqtutilities/ut/t_wlanqtutils/t_wlanqtutils.pro Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -# -# Copyright (c) 2009 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: -# - -QT += testlib - -TEMPLATE = app -TARGET = t_wlanqtutils - -TARGET.CAPABILITY = ALL -TCB - -DEPENDPATH += . - -#Store generated .moc files to their own directory -MOC_DIR = moc - -#BUILD_DLL macro is used to define export macro -DEFINES += BUILD_WLANQTUTILITIES_DLL - -#Following macros MW_LAYER_SYSTEMINCLUDE and OS_LAYER_SYSTEMINCLUDE are defined -#in X:\QT\mkspecs\features\symbian\platform_paths.prf that is always inluded in -#QT compilation - -INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ - $$OS_LAYER_SYSTEMINCLUDE \ - . \ - ../../base/inc \ - ../../wrapper/inc \ - ../../traces \ - /epoc32/include/domain/osextensions - -# Input -HEADERS += testwlanqtutils.h \ - ../context/wlanqtutilstestcontext.h \ - ../../base/inc/wlanqtutils.h \ - ../../base/inc/wlanqtutils_p.h \ - ../../base/inc/wlanqtutilsiap.h \ - ../../base/inc/wlanqtutilswlaniap.h \ - ../../base/inc/wlanqtutilswlanap.h \ - ../../base/inc/wlanqtutilsactiveconn.h \ - ../../wrapper/inc/wlanqtutilscmmwrapper.h \ - ../../wrapper/inc/wlanqtutilsconmonwrapper.h \ - ../../wrapper/inc/wlanqtutilsconntestwrapper.h \ - ../../wrapper/inc/wlanqtutilsesockwrapper.h \ - ../../traces/OstTraceDefinitions.h - -SOURCES += testwlanqtutils.cpp \ - ../context/wlanqtutilstestcontext.cpp \ - ../../base/src/wlanqtutils.cpp \ - ../../base/src/wlanqtutils_p.cpp \ - ../../base/src/wlanqtutilsiap.cpp \ - ../../base/src/wlanqtutilswlaniap.cpp \ - ../../base/src/wlanqtutilswlanap.cpp \ - ../../base/src/wlanqtutilsactiveconn.cpp \ - ../../wrapper/src/wlanqtutilscmmwrapper.cpp \ - ../../wrapper/src/wlanqtutilsconmonwrapper.cpp \ - ../../wrapper/src/wlanqtutilsconntestwrapper.cpp \ - ../../wrapper/src/wlanqtutilsesockwrapper.cpp - -symbian: { - HEADERS += ../../wrapper/inc/wlanqtutilscmmwrapper_s60_p.h \ - ../../wrapper/inc/wlanqtutilsconmonwrapper_s60_p.h \ - ../../wrapper/inc/wlanqtutilsconntestwrapper_s60_p.h \ - ../../wrapper/inc/wlanqtutilsesockwrapper_s60_p.h - - SOURCES += ../../wrapper/src/wlanqtutilscmmwrapper_s60.cpp \ - ../../wrapper/src/wlanqtutilsconmonwrapper_s60.cpp \ - ../../wrapper/src/wlanqtutilsconntestwrapper_s60.cpp \ - ../../wrapper/src/wlanqtutilsesockwrapper_s60.cpp \ - ../stubs/wlanqtutilsconnmonstub.cpp \ - ../stubs/wlanqtutilsconnteststub.cpp \ - ../stubs/wlanqtutilsesockstub.cpp -} - -LIBS += -lcmmanager -lconnmon -lcommdb -lesock -lictsclientinterface - -#UT flag is set -DEFINES += WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -coverage_test: { -message(*** Coverage test mode build - no OST traces.) -#NO_OST_TRACES flag is set -DEFINES += WLANQTUTILS_NO_OST_TRACES_FLAG 'Q_ASSERT(test)=' -} -else { -message(*** Normal Symbian-mode build.) -} \ No newline at end of file diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.cpp --- a/wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,683 +0,0 @@ -/* -* Copyright (c) 2009 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: -* This is the source file for testing Wlan Qt Utilities library. -*/ - -#include -#include -#include -#include -#include -#include "wlanqtutilscommon.h" -#include "wlanqtutilswlanap.h" -#include "wlanqtutilsiap.h" -#include "wlanqtutilswlaniap.h" -#include "wlanqtutils.h" -#include "wlanqtutils_p.h" -#include "wlanqtutilsconmonwrapper.h" -#include "wlanqtutilsconmonwrapper_s60_p.h" -#include "wlanqtutilsconntestwrapper.h" -#include "wlanqtutilsconntestwrapper_s60_p.h" -#include "testwlanqtutils.h" -#include "wlanqtutilstestcontext.h" - -WlanQtUtilsTestContext testContext; - -const QString TestWlanQtUtils::commsDatDefault_ = "default.cre"; - -// --------------------------------------------------------- -// FRAMEWORK FUNCTIONS -// --------------------------------------------------------- - -/** - * This function will be called before the first test function is executed. - */ -void TestWlanQtUtils::initTestCase() -{ - wlanQtUtils_ = NULL; - signalScanReady_ = NULL; - signalWlanNetworkOpened_ = NULL; - signalWlanNetworkClosed_ = NULL; - - //If Active scheduler exists then don't install a new one as it will cause panic - if (CActiveScheduler::Current() == NULL) { - CActiveScheduler *scheduler = new CActiveScheduler(); - CActiveScheduler::Install(scheduler); - } -} - -/** - * This function will be called after the last test function was executed. - */ -void TestWlanQtUtils::cleanupTestCase() -{ - // CommsDat file is initialized. - subTestLoadCommsDatFile(commsDatDefault_); - - // TODO: Can we get rid of this delay? - QWARN(": \n *********** \n * PASSED! * \n *********** \n\n\n"); - QWARN(": \n *** Window will be closed in 5s... \n\n\n"); - QTest::qSleep(5000); -} - -/** - * This function will be called before each test function is executed. - */ -void TestWlanQtUtils::init() -{ - // CommsDat file is initialized. - subTestLoadCommsDatFile(commsDatDefault_); - - testContext.initialize(); - - QVERIFY(wlanQtUtils_ == NULL); - QVERIFY(signalScanReady_ == NULL); - QVERIFY(signalWlanNetworkOpened_ == NULL); - QVERIFY(signalWlanNetworkClosed_ == NULL); - subTestNewWlanQtUtils(); -} - -/** - * This function will be called after each test function is executed. - */ -void TestWlanQtUtils::cleanup() -{ - delete wlanQtUtils_; - wlanQtUtils_ = NULL; - - QCOMPARE(signalScanReady_->count(), 0); - delete signalScanReady_; - signalScanReady_ = NULL; - - QCOMPARE(signalWlanNetworkOpened_->count(), 0); - delete signalWlanNetworkOpened_; - signalWlanNetworkOpened_ = NULL; - - QCOMPARE(signalWlanNetworkClosed_->count(), 0); - delete signalWlanNetworkClosed_; - signalWlanNetworkClosed_ = NULL; -} - -// --------------------------------------------------------- -// TEST CASES -// --------------------------------------------------------- - -/** - * Test available WLAN APs when scan is triggered by client. - * Two scan results have the same SSID and the latter one of those will be removed. - * Two scan results have the same SSID but different security mode - * and both are included in the results. - */ -void TestWlanQtUtils::testAvailableWlanAps() -{ - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(10); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[0]->setSsid("Same SSID"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[2]->setSsid("Same SSID"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[5]->setSsid("Same SSID, different SecMode"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[5]->setSecurityMode(WlanQtUtilsWlanSecModeWpa); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[8]->setSsid("Same SSID, different SecMode"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[8]->setSecurityMode(WlanQtUtilsWlanSecModeOpen); - - // Request a scan to get result signal - wlanQtUtils_->scanWlans(); - - // Let active object run and verify signal. - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get and verify the list of available WLAN APs. - QList iaps; - QList aps; - wlanQtUtils_->availableWlanAps(iaps, aps); - - // First remove AP that has duplicate SSID. - // Then order APs alphabetically. - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(2); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.move(4, 1); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.move(7, 1); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.move(8, 3); - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: Free AP pointers too. -} - -/** - * Test available WLAN APs when there are also WLAN IAPs available. - */ -void TestWlanQtUtils::testAvailableWlanApsWithIaps() -{ - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(7); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[1]->setSsid("WLAN IAP 3"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[1]->setSecurityMode(WlanQtUtilsWlanSecModeWpa); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[3]->setSsid(""); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[5]->setSsid("WLAN IAP 1"); - // Todo: security mode not compared yet due to an issue with CMM vs ConnMon WLAN security - // modes under investigation - // SSID is found in Internet Snap, but security mode does not match: - // testContext.connMon_.wlanScanResult_.wlanScanResultList_[6]->setSsid("WLAN IAP 2"); - // testContext.connMon_.wlanScanResult_.wlanScanResultList_[6]->setSecurityMode(WlanQtUtilsWlanSecModeWpa); - - // Request a scan to get result signal - wlanQtUtils_->scanWlans(); - - // Let active object run and verify signal. - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get and verify the list of available WLAN APs. - QList iaps; - QList aps; - wlanQtUtils_->availableWlanAps(iaps, aps); - - // Verify WLAN AP list. First, remove scan results that will not appear - // because they are hidden WLANs or WLAN IAPs. - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(5); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(3); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(1); - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - - // Verify WLAN IAP list - QCOMPARE(iaps.count(), 2); - QCOMPARE(iaps[0]->id(), 5); - QCOMPARE(iaps[0]->name(), QString("WLAN IAP 1")); - QCOMPARE(iaps[0]->bearerType(), WlanQtUtilsBearerTypeWlan); - QCOMPARE(iaps[0]->ssid(), QString("WLAN IAP 1")); - QCOMPARE(iaps[1]->id(), 7); - QCOMPARE(iaps[1]->name(), QString("WLAN IAP 3")); - QCOMPARE(iaps[1]->bearerType(), WlanQtUtilsBearerTypeWlan); - QCOMPARE(iaps[1]->ssid(), QString("WLAN IAP 3")); - iaps.clear(); // TODO: Free IAP pointers too. - aps.clear(); // TODO: Free AP pointers too. -} - -/** - * Test refereshing of WLAN APs when client requests sequential scans. - */ -void TestWlanQtUtils::testAvailableWlanApsSequence() -{ - // **************** Before 1st scan ******************** - QList iaps; - QList aps; - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify we have no results - QCOMPARE(aps.count(), 0); - QCOMPARE(iaps.count(), 0); - - // **************** 1st scan ******************** - // 6 APs are required for this scan - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(6); - - wlanQtUtils_->scanWlans(); - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get the results for the 1st scan - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify the results for the scan - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: free memory of pointers too. - - // **************** 2nd scan ******************** - // 2 APs are required for this scan - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(2); - - wlanQtUtils_->scanWlans(); - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get the results for the 2nd scan - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify the results for the scan - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: Free memory - - // **************** 3rd scan ******************** - // 4 APs are required for the 3rd scan - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(4); - - wlanQtUtils_->scanWlans(); - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get the results for the 3rd scan - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify the results for the scan - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: Free memory -} - -/** - * This function tests creation of WLAN IAP in a succesful manner. - * - WLAN scan is made because otherwise we cannot verify that IAP creation is successful. - * - Check that there are no available WLAN IAPs. - * - Fetch SNAP list. - * - Create WLAN IAP. - * - Check that WLAN IAP has been created and that this IAP is not in WLAN AP scan results. - */ -void TestWlanQtUtils::testCreateWlanIapOk() -{ - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(1); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[0]->setSsid("New WLAN IAP"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[0]->setSecurityMode(WlanQtUtilsWlanSecModeWpa2); - - // Create a new instance in order to test functionality triggered in constructor. - WlanQtUtils *utils = new WlanQtUtils(); - QSignalSpy spy(utils, SIGNAL(wlanScanReady())); - QVERIFY(spy.isValid() == true); - subTestSignalWaitAndTake(&spy, NULL); - - // Ensure there are no WLAN IAPs but there is one scan result. - QList iaps; - QList aps; - utils->availableWlanAps(iaps, aps); - - QCOMPARE(iaps.count(), 0); - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - - // Execute createWlanIap() function - WlanQtUtilsWlanAp wlanAp("New WLAN IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = utils->createWlanIap(&wlanAp); - - // Verify that created IAP is in the IAP list and AP list is empty. - utils->availableWlanAps(iaps, aps); - QCOMPARE(iaps.count(), 1); - QCOMPARE(iaps[0]->id(), iapId); - QCOMPARE(iaps[0]->name(), QString("New WLAN IAP")); - QCOMPARE(iaps[0]->bearerType(), WlanQtUtilsBearerTypeWlan); - QCOMPARE(iaps[0]->ssid(), QString("New WLAN IAP")); - // Todo: should be Wpa2, CMM vs ConnMon WLAN security modes under investigation - QCOMPARE(iaps[0]->securityMode(), WlanQtUtilsWlanSecModeWpa); - QCOMPARE(aps.count(), 0); - iaps.clear(); // TODO: memory leak. - delete utils; -} - -/** - * This function tests connecting to IAP in a succesful manner. - */ -void TestWlanQtUtils::testConnectIapOk() -{ - testContext.esock_.startRetValue_ = KErrNone; - - // Esock stub completes connection creation immediately - wlanQtUtils_->connectIap(5); - - // Connection creation in ConnMon interface - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Connection status change in ConnMon interface - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - - // Receive signal for connection opening (caused by connectIap, which completed immediately) - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); - - // Connection status change to opened in ConnMon interface. Sub test cases between test - // cases check that no extra signals are sent - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); -} - -/** - * This function tests connecting to IAP in unsuccesful manner. - */ -void TestWlanQtUtils::testConnectIapErr() -{ - testContext.esock_.startRetValue_ = KErrGeneral; - - wlanQtUtils_->connectIap(7); - - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 7); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonDeleteConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkClosed_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 7); -} - -// TODO: testDisconnectFail cases are needed when fail branches are -// implemented into the connmon wrapper -/** - * This function tests IAP disconnecting functionality. - */ -void TestWlanQtUtils::testDisconnectIapOk() -{ - // Create and connect an IAP we can then disconnect - WlanQtUtilsWlanAp wlanAp("Disconnect IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - testContext.esock_.startRetValue_ = KErrNone; - wlanQtUtils_->connectIap(iapId); - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // The disconnect function does not have any return values or - // signals related to the disconnection, thus plain - // function call is done for the test. - wlanQtUtils_->disconnectIap(iapId); -} - -/** - * This function tests IAP getter with existing IAP ID. - */ -void TestWlanQtUtils::testIapFound() -{ - // Create the IAP we want to find with the getter - WlanQtUtilsWlanAp wlanAp("testIapFound", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - - // Execute the function under test and check that we got the correct IAP - WlanQtUtilsIap *iap = wlanQtUtils_->iap(iapId); - QVERIFY(iap != NULL); - QCOMPARE(iap->id(), iapId); - QCOMPARE(iap->name(), QString("testIapFound")); - QCOMPARE(iap->bearerType(), WlanQtUtilsBearerTypeWlan); -} - -/** - * This function tests IAP getter with non-existing IAP ID. - */ -void TestWlanQtUtils::testIapNotFound() -{ - // Execute the function under test and check that we get no IAP as result - WlanQtUtilsIap *iap = wlanQtUtils_->iap(1000); - QVERIFY(iap == NULL); -} - -/** - * This function tests connected WLAN IAP getter with existing connection. - */ -void TestWlanQtUtils::testConnectedWlanIdFound() -{ - // Create the IAP we want to find with the getter - WlanQtUtilsWlanAp wlanAp("testConnectedWlanIdFound", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, iapId); - - // Send event for connection creation. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Send events for connection status change -> opened. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KStartingConnection)); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // Execute the function under test and check that we get valid ID as result - int id = wlanQtUtils_->connectedWlanId(); - QCOMPARE(id, iapId); -} - -/** - * This function tests connected WLAN IAP getter with connection existing already during dll construction. - */ -void TestWlanQtUtils::testConnectedWlanIdFoundConstructor() -{ - // IAP ID 5 exists in default commsdat file - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - - // Create a new instance in order to test functionality triggered in constructor. - WlanQtUtils *utils = new WlanQtUtils(); - - // Execute the function under test and check that we get valid ID as result - int id = utils->connectedWlanId(); - QCOMPARE(id, 5); - - delete utils; -} - -/** - * This function tests connected WLAN IAP getter without existing connection. - */ -void TestWlanQtUtils::testConnectedWlanIdNotFound() -{ - // Execute the function under test and check that we get invalid ID as result - int id = wlanQtUtils_->connectedWlanId(); - QCOMPARE(id, WlanQtUtilsInvalidIapId); -} - -/** - * Test WLAN scan triggering interface. - */ -void TestWlanQtUtils::testScanWlans() -{ - // Execute function under test - wlanQtUtils_->scanWlans(); - - // No need to verify scan results here, testAvailableWlanAps* test cases - // are for that. Just make sure the result signal is received. - subTestSignalWaitAndTake(signalScanReady_, NULL); -} - -/** - * This function tests Wlan network opening signal when network is not opened by the dll. - */ -void TestWlanQtUtils::testWlanNetworkOpened() -{ - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - - // Send event for connection creation. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Send events for connection status change -> opened. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); -} - -/** - * This function tests Wlan network closing signal when network is not closed by the dll. - */ -void TestWlanQtUtils::testWlanNetworkClosed() -{ - // First create a connection - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - - // Send event for connection creation. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Send events for connection status change -> opened. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); - - // Send event for connection status change -> closed. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerClosed)); - - // Send event for connection deletion. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonDeleteConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - subTestSignalWaitAndTake(signalWlanNetworkClosed_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); -} - -/** - * This function tests ICT when connection test passes. - */ -void TestWlanQtUtils::testConnectionTestPass() -{ - // Create and connect an IAP we can then test - WlanQtUtilsWlanAp wlanAp("Connection test IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - testContext.esock_.startRetValue_ = KErrNone; - wlanQtUtils_->connectIap(iapId); - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // Connection test automatically started at this point. Call result function explicitly - // No interface exists that we could check that the IAP is moved to Internet SNAP correctly - TBuf<5> string; - wlanQtUtils_->d_ptr->connTestWrapper_->d_ptr_->ConnectivityObserver(EConnectionOk, string); -} - -/** - * This function tests ICT when connection test fails. - */ -void TestWlanQtUtils::testConnectionTestFail() -{ - // Create and connect an IAP we can then test - WlanQtUtilsWlanAp wlanAp("Connection test IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - testContext.esock_.startRetValue_ = KErrNone; - wlanQtUtils_->connectIap(iapId); - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // Connection test automatically started at this point. Call result function explicitly - // No interface exists that we could check that IAP is not moved to another SNAP - // Todo: Repeat for all possible error codes to gain coverage - TBuf<5> string; - wlanQtUtils_->d_ptr->connTestWrapper_->d_ptr_->ConnectivityObserver(EHttpAuthenticationNeeded, string); -} - -// --------------------------------------------------------- -// SUB TEST CASES -// --------------------------------------------------------- - -/** - * This function waits for active objects to get time to run, takes the arguments of the - * first signal and returns them from the given signal spy. - * This function also verifies that the number of signals is 1. - * - * @param[in] spy Signal spy. - * @param[out] arguments Arguments of the first signal in the given signal spy. NULL if arguments not needed. - */ -void TestWlanQtUtils::subTestSignalWaitAndTake(QSignalSpy* spy, QList* arguments) -{ - QTest::qWait(1); - QCOMPARE(spy->count(), 1); - QList arguments_tmp = spy->takeFirst(); - if (arguments != NULL) { - *arguments = arguments_tmp; - } -} - -/** - * This function loads given CommsDat file, replacing current one. - * If CommsDat file doesn't exist, it can be re-created by commanding WST script. - * Using help switch is a quick way: - * run_wst HELP - * - * @param newCommsdatFilename Filename of the new CommsDat to be loaded. - */ -void TestWlanQtUtils::subTestLoadCommsDatFile(QString newCommsdatFilename) -{ - // EPOC's CommsDat filename - const QString epocCommsdatFilename("cccccc00.cre"); - // EPOC's directory for CommsDat file - const QString commsdatDir("c:\\private\\10202be9\\persists\\"); - // Created backup directory under EPOC for CommsDat files - const QString storeDir("c:\\private\\10202be9\\persists\\backup\\"); - QString nameOld = commsdatDir + epocCommsdatFilename; - QString nameDefault = storeDir + newCommsdatFilename; - - // First remove the old CommsDat file. - Q_ASSERT(QFile::remove(nameOld) == TRUE); - - // Copy the stored default CommsDat file. - Q_ASSERT(QFile::copy(nameDefault, nameOld) == TRUE); -} - -/** - * - */ -void TestWlanQtUtils::subTestNewWlanQtUtils() -{ - if (wlanQtUtils_ != NULL) { - delete wlanQtUtils_; - } - wlanQtUtils_ = new WlanQtUtils(); - - if (signalScanReady_ != NULL) { - delete signalScanReady_; - } - signalScanReady_ = new QSignalSpy(wlanQtUtils_, SIGNAL(wlanScanReady())); - QVERIFY(signalScanReady_->isValid() == true); - - if (signalWlanNetworkOpened_ != NULL) { - delete signalWlanNetworkOpened_; - } - signalWlanNetworkOpened_ = new QSignalSpy(wlanQtUtils_, SIGNAL(wlanNetworkOpened(int))); - QVERIFY(signalWlanNetworkOpened_->isValid() == true); - - if (signalWlanNetworkClosed_ != NULL) { - delete signalWlanNetworkClosed_; - } - signalWlanNetworkClosed_ = new QSignalSpy(wlanQtUtils_, SIGNAL(wlanNetworkClosed(int))); - QVERIFY(signalWlanNetworkClosed_->isValid() == true); - - // Let first active objects to run. First WLAN scan is done in engine contructor. - subTestSignalWaitAndTake(signalScanReady_, NULL); -} - -// Create main function using QTest marco. -QTEST_MAIN(TestWlanQtUtils) diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.h --- a/wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 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: -* This is the header file for testing Wlan Qt Utilities library. -*/ - -#ifndef TESTWLANQTUTILS_H_ -#define TESTWLANQTUTILS_H_ - -#include - -class QSignalSpy; -class WlanQtUtils; - -class TestWlanQtUtils: public QObject -{ - Q_OBJECT - -private slots: - - // Functions from QTest framework. - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - - // Test functions for public interface. - void testAvailableWlanAps(); - void testAvailableWlanApsWithIaps(); - void testAvailableWlanApsSequence(); - - void testCreateWlanIapOk(); - - void testConnectIapOk(); - void testConnectIapErr(); - - void testDisconnectIapOk(); - - void testIapFound(); - void testIapNotFound(); - - void testConnectedWlanIdFound(); - void testConnectedWlanIdFoundConstructor(); - void testConnectedWlanIdNotFound(); - - void testScanWlans(); - - void testWlanNetworkOpened(); - void testWlanNetworkClosed(); - - // Test functions for private implementation (tested via public interface) - void testConnectionTestPass(); - void testConnectionTestFail(); - -private: - - // Helper functions, that is, sub test cases. - void subTestSignalWaitAndTake(QSignalSpy *spy, QList *arguments); - void subTestLoadCommsDatFile(QString newCommsdatFilename); - void subTestNewWlanQtUtils(); - - // Member variables. - WlanQtUtils *wlanQtUtils_; - QSignalSpy *signalScanReady_; - QSignalSpy *signalWlanNetworkOpened_; - QSignalSpy *signalWlanNetworkClosed_; - - /* Default CommsDat file name - SNAP ID=3: Internet: - IAP ID = 1: packet data 1 - IAP ID = 3: packet data 2 - IAP ID = 4: packet data 3 - IAP ID = 5: WLAN IAP 1, EWlanSecModeOpen - IAP ID = 6: WLAN IAP 2, EWlanSecModeWep, w2key - IAP ID = 7: WLAN IAP 3, EWlanSecModeWpa, wlan3key - SNAP ID = 4: Multimedia msg. - SNAP ID = 5: WAP services - SNAP ID = 6: My Snap: - IAP ID = 8: Home WLAN, EWlanSecModeOpen - IAP ID = 9: Streaming - */ - static const QString commsDatDefault_; -}; - -#endif /* TESTWLANQTUTILS_H_ */ - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/wst/run_wst.bat --- a/wlanutilities/wlanqtutilities/wst/run_wst.bat Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -::============================================================================= -:: Copyright (c) 2009 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: -:: -::============================================================================= - -:: Script(s) uses following environment settings: -:: - CD -:: - DATE -:: - TIME -:: - TEMP - - -::----------------------------------------------------------------------------- -:: Do the preparations: -:: - Don't show the commands -:: - Use local parameters -- don't pollute the global one -:: - Dim the lights for time of script execution -:: - Store the current working directory -::----------------------------------------------------------------------------- - -@echo off -echo *** RUN_WST: START: -setlocal -color 08 -pushd . -if not exist run_wst.bat goto INVALID_DIR - - -::----------------------------------------------------------------------------- -:: Set the local variables -::----------------------------------------------------------------------------- - -echo *** RUN_WST: SET VARIABLES: -set wst_root_dir=%cd% -set wst_log_dir=%wst_root_dir%\wst_log -set wst_report_dir=%wst_root_dir%\wst_report -set log_file=%wst_log_dir%\wst_log.txt -set build_script=%wst_root_dir%\wst_script\wst_make.bat -set epoc_commsdat_dir=\epoc32\winscw\c\private\10202be9\persists -if not exist %epoc_commsdat_dir% goto INVALID_DIR -set epoc_backup_dir=%epoc_commsdat_dir%\backup -set ut_commsdat_dir=%wst_root_dir%\..\ut\context\commsdat_files -if not exist %ut_commsdat_dir% goto INVALID_DIR -set ut_commsdat_file_default=%ut_commsdat_dir%\default.cre -if not exist %ut_commsdat_file_default% goto INVALID_DIR -set ut_commsdat_files=%ut_commsdat_dir%\*.cre -if not exist %ut_commsdat_files% goto INVALID_DIR - - -::----------------------------------------------------------------------------- -:: Copy commsdat file to emulator directory and also to backup directory -::----------------------------------------------------------------------------- - -echo *** RUN_WST: COPY FILES: -copy %ut_commsdat_file_default% %epoc_commsdat_dir%\cccccc00.cre /y -if not exist %epoc_backup_dir% mkdir %epoc_backup_dir% -copy %ut_commsdat_files% %epoc_backup_dir% /y - - -::----------------------------------------------------------------------------- -:: Check that script exists -::----------------------------------------------------------------------------- - -echo *** RUN_WST: SOME CHECKS: -if not exist %build_script% goto INVALID_DIR -:: Create output directory if it does not exist -if not exist %wst_log_dir% mkdir %wst_log_dir% -if not exist %wst_report_dir% mkdir %wst_report_dir% -:: Create log file -echo *** WST_LOG: BEGIN *** > %log_file% - - -::----------------------------------------------------------------------------- -:: Check parameters -::----------------------------------------------------------------------------- - -set command=ERROR -if [%1]==[] set command=CLEAN_OLD_FILES COMPILE_WLANQTUTILS COMPILE_TEST_CASES RUN_TEST_CASES GENERATE_REPORTS SHOW_RESULTS -if [%1]==[CLEAN_OLD] set command=CLEAN_OLD_FILES -if [%1]==[WLANQTUTILS] set command=COMPILE_WLANQTUTILS -if [%1]==[CASES] set command=COMPILE_TEST_CASES -if [%1]==[RUN] set command=RUN_TEST_CASES -if [%1]==[REPORTS] set command=GENERATE_REPORTS -if [%1]==[RESULTS] set command=SHOW_RESULTS -if [%1]==[BROWSE] set command=START_BROWSER -if [%1]==[/?] goto HELP -if [%1]==[HELP] goto HELP -if [%1]==[/h] goto HELP -if [%1]==[-h] goto HELP - -::----------------------------------------------------------------------------- -:PARSE_COMMANDS -::----------------------------------------------------------------------------- - -echo *** RUN_WST: COMMAND: %command% -echo *** RUN_WST: CALL SCRIPT: -for %%i IN ( %command% ) DO ( - call %build_script% %wst_root_dir% wst_log.txt %%i - for /f "tokens=3 delims= " %%x in ('find /C " Error " %log_file%') do ( - if not [%%x]==[0] goto ERROR - ) -) - -goto THE_END - - -::----------------------------------------------------------------------------- -:INVALID_DIR -::----------------------------------------------------------------------------- - -echo *** RUN_WST: INVALID DIR: -echo *** Test script sub-script not found! -echo *** Please be sure to run the script in same directory, -echo *** i.e. .\run_wst.bat , and NOT .\wst\run_wst.bat - -goto THE_END - - -::----------------------------------------------------------------------------- -:ERROR -::----------------------------------------------------------------------------- - -echo *** RUN_WST: ERROR: -color 48 -echo Error in compilation: -findstr /C:" Error " < %log_file% -echo. -Echo Quitting WST. - -goto THE_END - - -::----------------------------------------------------------------------------- -:HELP -::----------------------------------------------------------------------------- - -echo *** RUN_WST: HELP: -echo Run Wlan Qt Utilities Workstation Testing -echo. -echo RUN_WST [param] -echo. -echo param -echo [none] - Do all, from CLEAN_OLD to RESULTS -echo. -echo CLEAN_OLD - Clean metrics and other generated files -echo WLANQTUTILS - Build only Wlan Qt Utilities components -echo CASES - Build only Tester components -echo RUN - Run Tester -echo REPORTS - Generate reports -echo RESULTS - Show results -echo BROWSE - Start browser -echo. - - -::----------------------------------------------------------------------------- -:THE_END -::----------------------------------------------------------------------------- - -echo *** RUN_WST: END: -color -popd diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlanqtutilities/wst/wst_script/wst_make.bat --- a/wlanutilities/wlanqtutilities/wst/wst_script/wst_make.bat Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -::============================================================================= -:: Copyright (c) 2009 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: -:: -::============================================================================= -:: -:: Following commands are implemented: -:: - CLEAN_OLD_FILES -:: - COMPILE_WLANQTUTILS -:: - COMPILE_TEST_CASES -:: - RUN_TEST_CASES -:: - GENERATE_REPORTS -:: - SHOW_RESULTS -:: - START_BROWSER -::============================================================================= - -::----------------------------------------------------------------------------- -:: Do the preparations: -:: - Don't show the commands -:: - Use local parameters -- don't pollute the global one -::----------------------------------------------------------------------------- -@echo off - -echo *** WST_MAKE: START: -setlocal - -::----------------------------------------------------------------------------- -:: Check input -:: -:: Parameters that are required: -:: 1) wst_root_dir -:: 2) log_file_name -:: 3) the command -::----------------------------------------------------------------------------- - -:: (1) -if not exist %1 goto ERROR -if [%1]==[] goto ERROR -set wst_root_dir=%1 -set wst_log_dir=%1\wst_log -set wst_report_dir=%1\wst_report -set wlanqtutils_root_dir=%1\.. -set wlanqtutils_test_dir=%1\..\ut\t_wlanqtutils - -:: (2) -if [%2]==[] goto ERROR -set log_file_name=%2 -set log_file=%wst_log_dir%\%log_file_name% -if not exist %log_file% goto ERROR -echo *** DATE AND TIME: %date%, %time% >> %log_file% -echo *** WST_MAKE: INFO: Wlan Qt Utilities root dir: %wlanqtutils_root_dir% -echo *** WST_MAKE: INFO: Wlan Qt Utilities test dir: %wlanqtutils_test_dir% -echo *** WST_MAKE: INFO: WST log dir: %wst_log_dir% -echo *** WST_MAKE: INFO: WST log file: %log_file% - -:: (3) -if [%3]==[] goto ERROR -goto %3 - -:: Error if label not found. -goto ERROR - -::----------------------------------------------------------------------------- -:CLEAN_OLD_FILES -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: CLEAN_OLD_FILES: -echo *** WST_LOG: CLEAN_OLD_FILES >> %log_file% - -move %wst_log_dir%\%log_file_name% %wst_root_dir% -del /F /S /Q %wst_log_dir%\* -del /F /S /Q %wst_report_dir%\* -rmdir /S /Q %wst_log_dir%\CMTHTML -rmdir /S /Q %wst_log_dir%\CTCHTML -move %wst_root_dir%\%log_file_name% %wst_log_dir% -del \epoc32\winscw\c\data\wlanqtutils_qtest_log.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:COMPILE_WLANQTUTILS -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: COMPILE_WLANQTUTILS: -echo *** WST_LOG: COMPILE_WLANQTUTILS >> %log_file% - -cd %wlanqtutils_root_dir% -call qmake >> %log_file% 2>&1 -call bldmake bldfiles >> %log_file% 2>&1 -call abld reallyclean winscw >> %log_file% 2>&1 -call abld build winscw udeb >> %log_file% 2>&1 - -goto THE_END - -::----------------------------------------------------------------------------- -:COMPILE_TEST_CASES -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: COMPILE_TEST_CASES: -echo *** WST_LOG: COMPILE_TEST_CASES >> %log_file% - -cd %wlanqtutils_test_dir% -call qmake "CONFIG += coverage_test" >> %log_file% 2>&1 -call bldmake bldfiles >> %log_file% 2>&1 -call abld reallyclean winscw >> %log_file% 2>&1 -:: Call CTC instrumentation script. Source directories hard coded, because NO_EXCLUDE does not like % characters... -call ctcwrap -C EXCLUDE=* -C NO_EXCLUDE+..\..\base\src\*.cpp,..\..\wrapper\src\*.cpp -n %wst_log_dir%\MON.sym -i m -v abld build winscw udeb >> %log_file% 2>&1 - -goto THE_END - -::----------------------------------------------------------------------------- -:RUN_TEST_CASES -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: RUN_TEST_CASES: -echo *** WST_LOG: RUN_TEST_CASES >> %log_file% - -call \epoc32\release\winscw\udeb\t_wlanqtutils.exe -o c:\data\wlanqtutils_qtest_log.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:GENERATE_REPORTS -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: GENERATE_REPORTS: -echo *** WST_LOG: GENERATE_REPORTS >> %log_file% - -cd %wst_log_dir% - -call ctcpost -p %wst_log_dir%\ctc_coverage.txt -call ctc2html -nsb -i %wst_log_dir%\ctc_coverage.txt - -call dir /s /b %wlanqtutils_root_dir%\*.cpp > %wst_log_dir%\raw_filelist.txt - -call findstr /I /V "moc_" %wst_log_dir%\raw_filelist.txt > %wst_log_dir%\filelist.txt -call cmt -f %wst_log_dir%\filelist.txt -o cmt_metrics.txt >> %log_file% -call cmt2html -nsb -i cmt_metrics.txt - -:: Clean up temp files -call del %wst_log_dir%\*filelist.txt - -echo *** WST_MAKE: COPY LOGS: -call copy %TEMP%\epocwind.out %wst_log_dir%\epocwind.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:SHOW_RESULTS -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: SHOW_RESULTS: -echo *** WST_LOG: SHOW_RESULTS >> %log_file% -echo *** Module tests: -call findstr /C:"Totals: " \epoc32\winscw\c\data\wlanqtutils_qtest_log.txt -echo *** Coverage: -call findstr /C:"Number of " %wst_log_dir%\ctc_coverage.txt -call findstr /C:"TER " %wst_log_dir%\ctc_coverage.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:START_BROWSER -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: START_BROWSER: -echo *** WST_LOG: START_BROWSER >> %log_file% -echo. -echo Starting up browser to show the results - -start %wst_root_dir%\wst_report\coverage.html - -goto THE_END - -::----------------------------------------------------------------------------- -:ERROR -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: ERROR: -endlocal -echo wst_make *** Error (unknown parameter) >> %log_file% - -goto THE_END - -::----------------------------------------------------------------------------- -:THE_END -::----------------------------------------------------------------------------- -echo *** WST_MAKE: END: diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansettingsui/group/bld.inf --- a/wlanutilities/wlansettingsui/group/bld.inf Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2001-2010 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: Build information for the wlansettingsui -* -*/ - - -#include - -PRJ_EXPORTS - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/inc/wlansniffer.h --- a/wlanutilities/wlansniffer/inc/wlansniffer.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#ifndef WLANSNIFFER_H -#define WLANSNIFFER_H - -#include - -class QTranslator; -class WlanSnifferMainWindow; -class WlanQtUtils; - -class WlanSniffer : public HbApplication - { - Q_OBJECT - -public: - WlanSniffer(int argc, char* argv[]); - virtual ~WlanSniffer(); - - /** - * This function (from QObject) handles timers. Initiates a new WLAN scan. - * - * @param Unused. - */ - void timerEvent(QTimerEvent *event); - - WlanQtUtils *wlanQtUtils() const; - -private slots: - void exitApplication(); - -private: - QTranslator* mTranslator; - WlanQtUtils *mWlanQtUtils; - // Todo: why does the example use QSharedPointer for these? - WlanSnifferMainWindow *mMainWindow; // owned - int mScanTimerId; - }; - -#endif - -// End of File diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/inc/wlansnifferlistview.h --- a/wlanutilities/wlansniffer/inc/wlansnifferlistview.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#ifndef WLANSNIFFERLISTVIEW_H -#define WLANSNIFFERLISTVIEW_H - -#include -#include "wlanqtutilscommon.h" - -class HbListWidget; -class HbListWidgetItem; -class HbLabel; -class WlanSniffer; -class WlanQtUtilsWlanIap; -class WlanQtUtilsWlanAp; - -class WlanSnifferListView : public HbView - { - Q_OBJECT - -public: - WlanSnifferListView(WlanSniffer *appRef); - virtual ~WlanSnifferListView(); - - void update(); - void updateConnectionOpened(int iapId); - void updateConnectionClosed(int iapId); - -signals: - void detailsTriggered(int); - void completeServiceTriggered(); - -public slots: - void handleContextMenuClosed(); - -private slots: - void handleListItemActivated(HbListWidgetItem *item); - void handleListItemLongPressed(HbListWidgetItem *item, const QPointF &coords); - void handleListItemDisconnect(); - void handleDisconnect(); - -private: - QString signalStrengthIconChoose(int signalStrength, WlanQtUtilsWlanSecMode secMode); - HbListWidgetItem *wlanListItemIapCreate(const WlanQtUtilsWlanIap *iap); - HbListWidgetItem *wlanListItemApCreate(const WlanQtUtilsWlanAp *ap); - -private: - HbListWidget *mWlanList; - HbLabel *mStatusLabel; - WlanSniffer *mAppRef; - int mConnectingIapId; - /*! - * Data identifying the network for which the context menu has been - * opened: WlanQtUtilsAp class, or int IAP ID - */ - QVariant mContextMenuData; - HbMenu *mContextMenu; //!< Context menu reference, if one is open - }; - -#endif diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/inc/wlansniffermainwindow.h --- a/wlanutilities/wlansniffer/inc/wlansniffermainwindow.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#ifndef WLANSNIFFERMAINWINDOW_H -#define WLANSNIFFERMAINWINDOW_H - -#include - -#include - -class HbAction; -class WlanSnifferListView; -class WlanSniffer; -class WlanSnifferService; - -class WlanSnifferMainWindow : public HbMainWindow - { - Q_OBJECT - -public: - WlanSnifferMainWindow(WlanSniffer *appRef); - virtual ~WlanSnifferMainWindow(); - -public slots: - void toListView(); - void toDetailsView(int iapId); - - void updateListView(); - void updateListViewConnectionOpened(int iapId); - void updateListViewConnectionClosed(int iapId); - -signals: - void exitTriggered(); - -private slots: - void completeService(); - -private: - // Methods to add views to the main window - void addListView(); - -private: - WlanSniffer *mAppRef; - WlanSnifferListView *mListView; - WlanSnifferService* mService; - }; - -#endif diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/inc/wlansnifferservice.h --- a/wlanutilities/wlansniffer/inc/wlansnifferservice.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2009 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: -* -*/ - -#ifndef WLANSNIFFERSERVICE_H -#define WLANSNIFFERSERVICE_H - -#include - -class WlanSnifferService: public XQServiceProvider -{ - Q_OBJECT - -public: - WlanSnifferService( QObject *parent = 0 ); - ~WlanSnifferService(); - void complete(); - -signals: - void toListView(); - void exitTriggered(); - -public slots: - void listView(); - -private: - int mAsyncRequestIndex; -}; - -#endif // WLANSNIFFERSERVICE_H diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/qgn_indi_wifi_protected_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wifi_protected_add.svg Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/qgn_indi_wlan_secure_network_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_secure_network_add.svg Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_good_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_good_add.svg Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_low_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_low_add.svg Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_med_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_med_add.svg Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/qgn_prop_cmon_wlan_conn.svg --- a/wlanutilities/wlansniffer/res/qgn_prop_cmon_wlan_conn.svg Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/qgn_prop_wlan_bearer.svg --- a/wlanutilities/wlansniffer/res/qgn_prop_wlan_bearer.svg Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/service_conf.xml --- a/wlanutilities/wlansniffer/res/service_conf.xml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - WLAN Sniffer - - List View - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/wlansniffer.qrc --- a/wlanutilities/wlansniffer/res/wlansniffer.qrc Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - wlansnifferlistview.docml - - - - qgn_indi_wifi_protected_add.svg - qgn_indi_wlan_secure_network_add.svg - qgn_indi_wlan_signal_good_add.svg - qgn_indi_wlan_signal_low_add.svg - qgn_indi_wlan_signal_med_add.svg - qgn_prop_cmon_wlan_conn.svg - qgn_prop_wlan_bearer.svg - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/res/wlansnifferlistview.docml --- a/wlanutilities/wlansniffer/res/wlansnifferlistview.docml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - -
- - - - - -
diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/rom/wlansniffer.iby --- a/wlanutilities/wlansniffer/rom/wlansniffer.iby Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#ifndef WLANSNIFFER_IBY -#define WLANSNIFFER_IBY - -#include - -#ifdef __PROTOCOL_WLAN - -file=ABI_DIR\BUILD_DIR\wlansniffer.exe PROGRAMS_DIR\wlansniffer.exe -data=\epoc32\data\z\private\10003a3f\import\Apps\wlansniffer_reg.rsc \private\10003a3f\import\apps\wlansniffer_reg.rsc -data=\epoc32\data\z\resource\apps\wlansniffer.rsc \resource\apps\wlansniffer.rsc - -#endif // __PROTOCOL_WLAN - -#endif // WLANSNIFFER_IBY diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/rom/wlansniffer_resources.iby --- a/wlanutilities/wlansniffer/rom/wlansniffer_resources.iby Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#ifndef WLANSNIFFER_RESOURCES_IBY -#define WLANSNIFFER_RESOURCES_IBY - -#include -#include - -#ifdef __PROTOCOL_WLAN - -data=DATAZ_/QT_TRANSLATIONS_DIR/wlansniffer.qm QT_TRANSLATIONS_DIR/wlansniffer.qm - -#endif // __PROTOCOL_WLAN - -#endif // WLANSNIFFER_RESOURCES_IBY diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/src/main.cpp --- a/wlanutilities/wlansniffer/src/main.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#ifdef WLANSNIFFER_SERVICETRACES -#include "xqservicelog.h" -#endif - -#include "qsysteminfo.h" - -#include "wlansniffer.h" - -using namespace QtMobility; - -int main(int argc, char *argv[]) -{ - // Check WLAN dynamic configuration & exit if WLAN is not enabled - QSystemInfo sysinfo; - if (!sysinfo.hasFeatureSupported(QSystemInfo::WlanFeature)) { - return -1; - } - -#ifdef WLANSNIFFER_SERVICETRACES - qInstallMsgHandler(XQSERVICEMESSAGEHANDLER); -#endif - - WlanSniffer app(argc, argv); - - return app.exec(); -} - -// End of File diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/src/wlansniffer.cpp --- a/wlanutilities/wlansniffer/src/wlansniffer.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#include -#include - -#include "wlanqtutils.h" - -#include "wlansniffer.h" -#include "wlansniffermainwindow.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansnifferTraces.h" -#endif - -// Scan interval is 10 seconds -const int scanTimerInterval = 10000; - -WlanSniffer::WlanSniffer(int argc, char* argv[]) : - HbApplication(argc, argv), - mWlanQtUtils(new WlanQtUtils()) -{ - OstTraceFunctionEntry0( WLANSNIFFER_WLANSNIFFER_ENTRY ); - - // Start the first scan immediately so that results are available as - // soon as possible. Start also the timer for periodic scanning. - mWlanQtUtils->scanWlans(); - mScanTimerId = startTimer(scanTimerInterval); - - // Install localization - mTranslator = new QTranslator(this); - QString lang = QLocale::system().name(); - QString path = "Z:/resource/qt/translations/"; - mTranslator->load("wlansniffer_" + lang, path); - qApp->installTranslator(mTranslator); - - mMainWindow = new WlanSnifferMainWindow(this); - - connect( - mWlanQtUtils, - SIGNAL(wlanScanReady()), - mMainWindow, - SLOT(updateListView())); - - connect( - mWlanQtUtils, - SIGNAL(wlanNetworkOpened(int)), - mMainWindow, - SLOT(updateListViewConnectionOpened(int))); - - connect( - mWlanQtUtils, - SIGNAL(wlanNetworkClosed(int)), - mMainWindow, - SLOT(updateListViewConnectionClosed(int))); - - connect( - mMainWindow, - SIGNAL(exitTriggered()), - this, - SLOT(exitApplication())); - - OstTraceFunctionExit0( WLANSNIFFER_WLANSNIFFER_EXIT ); -} - -WlanSniffer::~WlanSniffer() -{ - OstTraceFunctionEntry0( WLANSNIFFER_WLANSNIFFERDESTR_ENTRY ); - - killTimer(mScanTimerId); - - delete mMainWindow; - delete mWlanQtUtils; - - OstTraceFunctionExit0( WLANSNIFFER_WLANSNIFFERDESTR_EXIT ); -} - -void WlanSniffer::timerEvent(QTimerEvent *event) -{ - OstTraceFunctionEntry0( WLANSNIFFER_TIMEREVENT_ENTRY ); - - Q_UNUSED(event); - // Request a new scan. Timer events come periodically. - mWlanQtUtils->scanWlans(); - - OstTraceFunctionExit0( WLANSNIFFER_TIMEREVENT_EXIT ); -} - -WlanQtUtils *WlanSniffer::wlanQtUtils() const -{ - OstTraceFunctionEntry0( WLANSNIFFER_WLANQTUTILS_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFER_WLANQTUTILS_EXIT ); - return mWlanQtUtils; -} - -void WlanSniffer::exitApplication() -{ - OstTraceFunctionEntry0( WLANSNIFFER_EXITAPPLICATION_ENTRY ); - - exit(); - - OstTraceFunctionExit0( WLANSNIFFER_EXITAPPLICATION_EXIT ); -} diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/src/wlansnifferlistview.cpp --- a/wlanutilities/wlansniffer/src/wlansnifferlistview.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,330 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "wlanqtutils.h" -#include "wlanqtutilswlanap.h" -#include "wlanqtutilswlaniap.h" -#include "wlanqtutilscommon.h" - -#include "wlansniffer.h" -#include "wlansnifferlistview.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansnifferlistviewTraces.h" -#endif - -WlanSnifferListView::WlanSnifferListView(WlanSniffer *appRef) : - mWlanList(NULL), - mStatusLabel(NULL), - mAppRef(appRef), - mConnectingIapId(0), - mContextMenu(NULL) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEW_ENTRY ); - - bool ok = false; - HbDocumentLoader loader; - loader.load(":/docml/wlansnifferlistview.docml", &ok); - Q_ASSERT_X(ok, "Wlan Sniffer", "Invalid docml file"); - - // Load the view by name from the xml file - QGraphicsWidget *widget = loader.findWidget("occ_list"); - Q_ASSERT_X(widget != 0, "Wlan Sniffer", "View not found"); - // Set the WlanListView view to be the widget that was loaded from the xml - setWidget(widget); - - HbMenu *viewMenu = qobject_cast(loader.findWidget("viewMenu")); - Q_ASSERT_X(viewMenu != 0, "Wlan Sniffer", "Menu not found"); - setMenu(viewMenu); - - mWlanList = qobject_cast(loader.findWidget("listWidget")); - Q_ASSERT_X(mWlanList != 0, "Wlan Sniffer", "List not found"); - - mStatusLabel = qobject_cast(loader.findWidget("statusLabel")); - Q_ASSERT_X(mStatusLabel != 0, "Wlan Sniffer", "Label not found"); - - connect( - mWlanList, - SIGNAL(activated(HbListWidgetItem *)), - this, - SLOT(handleListItemActivated(HbListWidgetItem *))); - connect( - mWlanList, - SIGNAL(longPressed(HbListWidgetItem *, const QPointF &)), - this, - SLOT(handleListItemLongPressed(HbListWidgetItem *, const QPointF &))); - - // Set correct orientation when drawing view first time. Orientation change - // on the fly is not yet implemented - if (HbInstance::instance()->allMainWindows().value(0)->orientation() == Qt::Horizontal) { - bool loaded = false; - loader.load( ":/docml/wlansnifferlistview.docml", "landscape", &loaded ); - } // else: portrait is ok by default - - // We need to create a custom navigation action in case the application was - // launched as embedded via QtHighway - if (XQServiceUtil::isEmbedded()) { - HbAction *completeAction = new HbAction(Hb::BackNaviAction, this); - setNavigationAction(completeAction); - connect( - completeAction, - SIGNAL(triggered(bool)), - this, - SIGNAL(completeServiceTriggered())); - // TODO: What to do when exit action is ran? Should we close whole control panel? - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEW_EXIT ); -} - -WlanSnifferListView::~WlanSnifferListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEWDESTR_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEWDESTR_EXIT ); -} - -void WlanSnifferListView::update() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_UPDATE_ENTRY ); - - // Do not update list while the context menu is open - if (mContextMenu == NULL) { - QList aps; - QList iaps; - - mAppRef->wlanQtUtils()->availableWlanAps(iaps, aps); - - mWlanList->clear(); - - // Loop the IAPs and APs and create the list items (lists are ordered already by Wlan Qt Utilities) - foreach (WlanQtUtilsWlanIap *iap, iaps) { - mWlanList->addItem(wlanListItemIapCreate(iap)); - } - // Loop the AP's and create the list items - foreach (WlanQtUtilsWlanAp *ap, aps) { - mWlanList->addItem(wlanListItemApCreate(ap)); - } - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_UPDATE_EXIT ); -} - -void WlanSnifferListView::updateConnectionOpened(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONOPENED_ENTRY ); - - mStatusLabel->setPlainText( - hbTrId("txt_occ_grid_connected_to_1").arg(mAppRef->wlanQtUtils()->iap(iapId)->name())); - // Redraw the list so that the connected network moves on top - update(); - mConnectingIapId = 0; - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONOPENED_EXIT ); -} - -void WlanSnifferListView::updateConnectionClosed(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONCLOSED_ENTRY ); - - (void)iapId; - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_not_connected")); - mConnectingIapId = 0; - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONCLOSED_EXIT ); -} - -void WlanSnifferListView::handleContextMenuClosed() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLECONTEXTMENUCLOSED_ENTRY ); - - // Menu deletes itself, but we need to cleanup the member variable - // in order to enable list updating again - mContextMenu = NULL; - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLECONTEXTMENUCLOSED_EXIT ); -} - -void WlanSnifferListView::handleListItemActivated(HbListWidgetItem *item) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMACTIVATED_ENTRY ); - - QVariant data = item->data(); - if (data.canConvert()) { - // Item was an IAP. Connect the IAP or show details view depending on connection state - WlanQtUtilsIap *iap = mAppRef->wlanQtUtils()->iap(data.toInt()); - if (iap->connectionStatus() == WlanQtUtilsConnectionStatusConnected) { - // Switch to details view - emit detailsTriggered(data.toInt()); - } else { - // Connect the IAP - mConnectingIapId = iap->id(); - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_connecting_to_1").arg(iap->name())); - mAppRef->wlanQtUtils()->connectIap(mConnectingIapId); - } - } else { - // Item has to be a WLAN AP, which can't already be connected. Create an IAP and connect it. - Q_ASSERT(data.canConvert()); - WlanQtUtilsWlanAp ap = data.value(); - mConnectingIapId = mAppRef->wlanQtUtils()->createWlanIap(&ap); - WlanQtUtilsIap *iap = mAppRef->wlanQtUtils()->iap(mConnectingIapId); - Q_ASSERT(iap); - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_connecting_to_1").arg(iap->name())); - mAppRef->wlanQtUtils()->connectIap(mConnectingIapId); - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMACTIVATED_EXIT ); -} - -void WlanSnifferListView::handleListItemLongPressed(HbListWidgetItem *item, const QPointF &coords) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMLONGPRESSED_ENTRY ); - - Q_ASSERT(mContextMenu == NULL); - - if (item->data().canConvert() && item->data().toInt() == - mAppRef->wlanQtUtils()->connectedWlanId()) { - // Connected IAP, add "Disconnect" action - mContextMenu = new HbMenu(); - // Remember the item that was long pressed - mContextMenuData = item->data(); - mContextMenu->addAction( - hbTrId("txt_common_menu_disconnect"), - this, - SLOT(handleListItemDisconnect())); - // Show the menu and connect closure signal (to re-enable list refreshing) - bool connectStatus = connect( - mContextMenu, - SIGNAL(aboutToClose()), - this, - SLOT(handleContextMenuClosed())); - Q_ASSERT(connectStatus); - mContextMenu->setAttribute(Qt::WA_DeleteOnClose); - mContextMenu->setTimeout(HbPopup::ContextMenuTimeout); - mContextMenu->setPreferredPos(coords); - mContextMenu->show(); - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMLONGPRESSED_EXIT ); -} - -/*! - Handles a "Disconnect" action selected from the context menu for a list item. - */ -void WlanSnifferListView::handleListItemDisconnect() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMDISCONNECT_ENTRY ); - - // "Disconnect" was only added, if the item was an IAP and data was - // the IAP ID - Q_ASSERT(mContextMenuData.canConvert()); - mAppRef->wlanQtUtils()->disconnectIap(mContextMenuData.toInt()); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMDISCONNECT_EXIT ); -} - -// Todo: This is a temporary solution - real WLAN status indication & listening -// is implemented later on. -void WlanSnifferListView::handleDisconnect() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLEDISCONNECT_ENTRY ); - - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_not_connected")); - // Redraw the list so that disconnected network is not shown anymore - update(); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLEDISCONNECT_EXIT ); -} - -// Todo: no place for separate secure WLAN icon in the widget -> custom layout needed? -// Todo: check the signal strength values -QString WlanSnifferListView::signalStrengthIconChoose(int signalStrength, WlanQtUtilsWlanSecMode secMode) -{ - (void)secMode; - QString iconName; - if (signalStrength <= WlanQtUtilsWlanSignalStrengthGood) { - iconName = "qtg_small_signal_good"; - } else if (signalStrength <= WlanQtUtilsWlanSignalStrengthLow) { - iconName = "qtg_small_signal_medium"; - } else { - iconName = "qtg_small_signal_low"; - } - - return iconName; -} - -HbListWidgetItem *WlanSnifferListView::wlanListItemIapCreate(const WlanQtUtilsWlanIap *iap) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANLISTITEMIAPCREATE_ENTRY ); - - HbListWidgetItem* item = new HbListWidgetItem(); - item->setText(iap->name()); -#if 1 // TODO: How to show secure/open network info?? - if (iap->securityMode() == WlanQtUtilsWlanSecModeOpen) { - item->setSecondaryText("Open"); - } else { - item->setSecondaryText("Secure"); - } -#endif - - if (iap->connectionStatus() == WlanQtUtilsConnectionStatusConnected) { - item->setIcon(HbIcon("qtg_small_online")); - } else { - item->setIcon(HbIcon("qtg_small_wlan")); - } - item->setSecondaryIcon(HbIcon(signalStrengthIconChoose(iap->signalStrength(), iap->securityMode()))); - QVariant data(iap->id()); - item->setData(data); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANLISTITEMIAPCREATE_EXIT ); - return item; -} - -HbListWidgetItem *WlanSnifferListView::wlanListItemApCreate(const WlanQtUtilsWlanAp *ap) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANLISTITEMAPCREATE_ENTRY ); - - HbListWidgetItem* item = new HbListWidgetItem(); - item->setText(ap->ssid()); -#if 1 // TODO: How to show secure/open network info?? - if (ap->securityMode() == WlanQtUtilsWlanSecModeOpen) { - item->setSecondaryText("Open"); - } else { - item->setSecondaryText("Secure"); - } -#endif - item->setSecondaryIcon(HbIcon(signalStrengthIconChoose(ap->signalStrength(), ap->securityMode()))); - QVariant data; - data.setValue(*ap); - item->setData(data); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANLISTITEMAPCREATE_EXIT ); - return item; -} - -// End of File diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/src/wlansniffermainwindow.cpp --- a/wlanutilities/wlansniffer/src/wlansniffermainwindow.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#include - -#include "wlansniffermainwindow.h" -#include "wlansnifferlistview.h" -#include "wlansnifferservice.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansniffermainwindowTraces.h" -#endif - - -WlanSnifferMainWindow::WlanSnifferMainWindow(WlanSniffer *appRef) : - mAppRef(appRef), - mService(0) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOW_ENTRY ); - - mService = new WlanSnifferService(this); - connect(mService,SIGNAL(toListView()),this,SLOT(toListView())); - connect(mService,SIGNAL(returnValueDelivered()),this,SIGNAL(exitTriggered())); - - // Add the views to the main window - addListView(); - - // Check if sniffer is used via a service - if (!XQServiceUtil::isEmbedded()) { - // Show the main window (which will display the first view that was added) - show(); - } - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOW_EXIT ); -} - -WlanSnifferMainWindow::~WlanSnifferMainWindow() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOWDESTR_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOWDESTR_EXIT ); -} - -void WlanSnifferMainWindow::toListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_TOLISTVIEW_ENTRY ); - - setCurrentView(mListView); - show(); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_TOLISTVIEW_EXIT ); -} - -void WlanSnifferMainWindow::toDetailsView(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_TODETAILSVIEW_ENTRY ); - - // TODO: Launch details view via QtHighway?? - (void)iapId; - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_TODETAILSVIEW_EXIT ); -} - -void WlanSnifferMainWindow::updateListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEW_ENTRY ); - - mListView->update(); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEW_EXIT ); -} - -void WlanSnifferMainWindow::updateListViewConnectionOpened(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONOPENED_ENTRY ); - - mListView->updateConnectionOpened(iapId); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONOPENED_EXIT ); -} - -void WlanSnifferMainWindow::updateListViewConnectionClosed(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONCLOSED_ENTRY ); - - mListView->updateConnectionClosed(iapId); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONCLOSED_EXIT ); -} - -void WlanSnifferMainWindow::completeService() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_COMPLETESERVICE_ENTRY ); - - mService->complete(); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_COMPLETESERVICE_EXIT ); -} - -void WlanSnifferMainWindow::addListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_ADDLISTVIEW_ENTRY ); - - mListView = new WlanSnifferListView(mAppRef); - addView(mListView); - - bool connectStatus = connect( - mListView, - SIGNAL(detailsTriggered(int)), - this, - SLOT(toDetailsView(int))); - Q_ASSERT(connectStatus == true); - connectStatus = connect( - mListView, - SIGNAL(completeServiceTriggered()), - this, - SLOT(completeService())); - Q_ASSERT(connectStatus == true); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_ADDLISTVIEW_EXIT ); -} diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/src/wlansnifferservice.cpp --- a/wlanutilities/wlansniffer/src/wlansnifferservice.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2009 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: - * - */ - -#include "wlansnifferservice.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansnifferserviceTraces.h" -#endif - - -WlanSnifferService::WlanSnifferService(QObject* parent) - : XQServiceProvider("com.nokia.services.wlansniffer.list", parent) -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICE_ENTRY ); - - publishAll(); - - OstTraceFunctionExit0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICE_EXIT ); -} - -WlanSnifferService::~WlanSnifferService() -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICEDESTR_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICEDESTR_EXIT ); -} - -void WlanSnifferService::complete() -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_COMPLETE_ENTRY ); - - QVariant returnValue(true); - bool status = completeRequest(mAsyncRequestIndex, returnValue); - Q_ASSERT(status); - - OstTraceFunctionExit0( WLANSNIFFERSERVICE_COMPLETE_EXIT ); -} - -void WlanSnifferService::listView() -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_LISTVIEW_ENTRY ); - - mAsyncRequestIndex = setCurrentRequestAsync(); - emit toListView(); - - OstTraceFunctionExit0( WLANSNIFFERSERVICE_LISTVIEW_EXIT ); -} diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wlansniffer/traces/OstTraceDefinitions.h --- a/wlanutilities/wlansniffer/traces/OstTraceDefinitions.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2009 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: - */ - -#ifndef __OSTTRACEDEFINITIONS_H__ -#define __OSTTRACEDEFINITIONS_H__ -#include -#endif diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/cwpsactiverunner.h --- a/wlanutilities/wpswizard/inc/cwpsactiverunner.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2010 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: WPS Wizard: Wrapper for middleware calls -* -*/ - -#ifndef CWPSACTIVERUNNER_H_ -#define CWPSACTIVERUNNER_H_ - -// System includes -#include -#include -#include -#include - -// User includes -#include "mwpsactiverunnercallback.h" - -// Forward declarations -// External data types -// Constants - - -/*! - * The wrapper class for wlan management engine calls - */ -// Class declaration -class CWpsActiveRunner : public CActive - { - -public: - static CWpsActiveRunner* NewL(MWpsActiveRunnerCallback& aObserver); - virtual ~CWpsActiveRunner(); -public: - - void InitL(); - void RunL(); - void DoCancel(); - TInt RunError(TInt aError); - void StartSetup(RBuf8& aSsid, int aPin); - -private: - CWpsActiveRunner(MWpsActiveRunnerCallback& aObserver); - void ConstructL(); - void InitializeL(); -private: - MWpsActiveRunnerCallback& iObserver; -#ifdef __arm - CWlanMgmtClient* iWLANMgmtClient; - CArrayFixSeg* iIapParametersArray; -#else - //Temporary for testing in WINSCW. - RTimer iTimer; - void RunProtectedSetup_Stub(); -#endif - }; - -#endif /* CWPSACTIVERUNNER_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/mwpsactiverunnercallback.h --- a/wlanutilities/wpswizard/inc/mwpsactiverunnercallback.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2010 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: Interface class for the middleware callback -* -*/ -#ifndef MWPSACTIVERUNNERCALLBACK_H_ -#define MWPSACTIVERUNNERCALLBACK_H_ - -// System includes -#include -#include - -// User includes -// Forward declarations -// External data types -// Constants - -// Class declaration -class MWpsActiveRunnerCallback - { -public: - /*! - * Callback to notify the completion of middleware API call - */ - IMPORT_C virtual void WpsActiveRunnerStopped(QList< - TWlanProtectedSetupCredentialAttribute>& aCredentials, - TInt aError) = 0; - }; - -#endif /* MWPSACTIVERUNNERCALLBACK_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizard.h --- a/wlanutilities/wpswizard/inc/wpswizard.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard API - * - */ - -/* - * %version: 1 % - */ - - -#ifndef WPSWIZARD_H_ -#define WPSWIZARD_H_ - - - -#include -#include "wlanwizardplugin.h" - -#ifdef BUILD_WPS_WIZARD_DLL -#define WPS_WIZARD_EXPORT Q_DECL_EXPORT -#else -#define WPS_WIZARD_EXPORT Q_DECL_IMPORT -#endif - -class WlanWizardHelpper; -class WpsWizardPrivate; - - -/*! - * @addtogroup group_ - * @{ - */ - -class WPS_WIZARD_EXPORT WpsWizard: public QObject, public WlanWizardPlugin -{ -private: - Q_OBJECT - friend class WpsWizardPrivate; -public: - enum BearerType - { - BearerTypeWlan, - }; -public: - WpsWizard( - WlanWizardHelpper *wizardHelpper, - BearerType bearerType, int referenceId); - ~WpsWizard(); - - void storeSettings(); - -public: // From WlanWizardPlugin - bool summary(WlanWizardPlugin::Summary sum, QString &item, QString &value); - - - -private: - Q_DISABLE_COPY(WpsWizard) - WpsWizardPrivate *d_ptr; -}; - -/*! @} */ - - - - -#endif /* WPSWIZARD_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizard_p.h --- a/wlanutilities/wpswizard/inc/wpswizard_p.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2010 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: WPS wizard private implementation -* -*/ - -#ifndef WPSWIZARD_P_H_ -#define WPSWIZARD_P_H_ - -// System includes -#include -#include -#include -#include -#include - -// User includes -#include "wlanwizardhelpper.h" -#include "wpswizard.h" - -// Forward declarations -class HbStackedWidget; -class HbWidget; -class HbLabel; -class HbView; -class HbAction; -class HbDocumentLoader; -class WlanWizardHelpper; - - -// External data types -// Constants - -// Class declaration -class WpsWizardPrivate : public QObject - { - - friend class WpsWizard; - -public: - WpsWizardPrivate(WpsWizard* wizard, WlanWizardHelpper *wizardHelpper, int bearerType, int referenceId); - ~WpsWizardPrivate(); -public: - /*! - * Based on the input either disables or enables next button - */ - void enableNextButton(bool enable); - /*! - * Moves automatically to the next page - */ - void nextPage(); - /*! - * Returns the SSID of the network - */ - QString getSsid(); - /*! - * Stores the settings received from the AP - */ - void storeSettings(int aIndex); - /*! - * Stores multiple settings received from the AP - */ - void storeSettingsArray( - QList& aCredentials); - QList getSettingsArray(); - /*! - * Stores the generated PIN - */ - void setPin(int random); - /*! - * Returns the generated PIN - */ - int getPin(); - -private: - Q_DISABLE_COPY(WpsWizardPrivate) - /*! - * Returns id of next page. updates settings EapWizard. - */ - void createPages(); - -private: - WpsWizard *q_ptr; - WlanWizardHelpper *mWizardHelpper; - QTranslator *mTranslator; - TWlanProtectedSetupCredentialAttribute mWpsAttr; - QList mIapList; - int mBearerType; - int mReferenceId; - int mRandomNumber; - }; - -#endif /* WPSWIZARD_P_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizardpage.h --- a/wlanutilities/wpswizard/inc/wpswizardpage.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2010 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: API for wizard pages -* -*/ - -#ifndef WPSWIZARDPAGE_H_ -#define WPSWIZARDPAGE_H_ - - -// System includes - -// User includes -#include "wlanwizardpage.h" - -// Forward declarations -class WpsWizardPrivate; -class HbWidget; - - -// External data types -// Constants - -// Class declaration -class WpsWizardPage : public QObject, public WlanWizardPage - { -public: - enum WpsPageIds - { - PageWpsWizardStep2 = WlanWizardPage::PageWpsStart, - PageWpsWizardStep3_Button, - PageWpsWizardStep3_Number, - PageWpsWizardStep4, - PageWpsWizardStep5, - PageWpsWizardStep6 - }; -public: - WpsWizardPage(WpsWizardPrivate* parent); - virtual ~WpsWizardPage(); - - /*! - * Creates a visualization of the page. - */ - virtual HbWidget* initializePage() = 0; - /*! - * Returns id of next page. updates settings EapWizard. - */ - virtual int nextId(bool &removeFromStack) const = 0; - /*! - * Returns how many steps should be gone backwars. - */ - virtual int stepsBackwards(); - /*! - * This method is called when a visualization is displayed to detect - * whether next button should be enabled or not. - */ - virtual bool validate() const; - /*! - * This method is called when Previous button has been pressed. - */ - virtual void previousTriggered() = 0; - /*! - * This method is called when Cancel button has been pressed. - */ - virtual void cancelTriggered() = 0; - WpsWizardPrivate* mWizard; -private: - Q_DISABLE_COPY(WpsWizardPage) - }; - -/*! @} */ - -#endif /* WPSWIZARDPAGE_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizardstepfive.h --- a/wlanutilities/wpswizard/inc/wpswizardstepfive.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2010 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: WPS wizard page step 5 -* -*/ -#ifndef WPSWIZARDSTEPFIVE_H_ -#define WPSWIZARDSTEPFIVE_H_ - - -// System includes -#include - -// User includes -#include "wpswizardpage.h" - -// Forward declarations -class HbRadioButtonList; -class HbWidget; -class HbLabel; -class HbProgressBar; -class WpsWizardPrivate; - - -// External data types -// Constants - -// Class declaration -class WpsPageStepFive : public WpsWizardPage - { -Q_OBJECT -public: - WpsPageStepFive(WpsWizardPrivate* parent); - ~WpsPageStepFive(); - -public: - /*! - * Creates a visualization of the page. - */ - HbWidget* initializePage(); - /*! - * Returns id of next page. updates settings EapWizard. - */ - int nextId(bool &removeFromStack) const; - /*! - * Returns how many steps should be gone backwards. - */ - int stepsBackwards(); - /*! - * This method is called when Previous button has been pressed. - */ - void previousTriggered(); - /*! - * This method is called when Cancel button has been pressed. - */ - void cancelTriggered(); - /*! - * This method is called when a visualization is displayed to detect - * whether next button should be enabled or not. - */ - bool validate() const; - -public slots: - void itemSelected(int index); - -private: - Q_DISABLE_COPY(WpsPageStepFive) - HbWidget *mWidget; - HbRadioButtonList *mRadio; - HbLabel *mTitle; - HbLabel *mHeading; - bool mValid; - }; - -/*! @} */ - -#endif /* WPSWIZARDSTEPFIVE_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizardstepfour.h --- a/wlanutilities/wpswizard/inc/wpswizardstepfour.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2010 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: WPS wizard page step 4 -* -*/ -#ifndef WPSWIZARDSTEPFOUR_H_ -#define WPSWIZARDSTEPFOUR_H_ - - -// System includes -#include -#include - -// User includes -#include "wpswizardpage.h" -#include "mwpsactiverunnercallback.h" -#include "cwpsactiverunner.h" - -// Forward declarations -class HbRadioButtonList; -class HbWidget; -class HbLabel; -class HbProgressBar; -class WpsWizardPrivate; - -// External data types -// Constants - -// Class declaration -class WpsPageStepFour : public WpsWizardPage, public MWpsActiveRunnerCallback - { -Q_OBJECT -public: - WpsPageStepFour(WpsWizardPrivate* parent); - ~WpsPageStepFour(); - -public: - /*! - * Creates a visualization of the page. - */ - HbWidget* initializePage(); - /*! - * Returns id of next page. updates settings EapWizard. - */ - int nextId(bool &removeFromStack) const; - /*! - * Returns how many steps should be gone backwards. - */ - int stepsBackwards(); - /*! - * This method is called when Previous button has been pressed. - */ - void previousTriggered(); - /*! - * This method is called when Cancel button has been pressed. - */ - void cancelTriggered(); - /*! - * This method is called when a visualization is displayed to detect - * whether next button should be enabled or not. - */ - bool validate() const; - /*! - * From mwpsactiverunnercallback.h - * This method is called from the active runner class to notify the end - * of operation - */ - void WpsActiveRunnerStopped( - QList& aCredentials, - TInt aError); - -public slots: - -private: - Q_DISABLE_COPY(WpsPageStepFour) - void StartWpsRunner(); - - HbWidget *mWidget; - HbRadioButtonList *mRadio; - HbLabel *mTitle; - HbLabel *mHeading; - HbProgressBar *mProgressBar; - CWpsActiveRunner *mWpsActiveRunner; - int mWpsErrorCode; - int countCredentials; - bool mValid; - - }; - -/*! @} */ - -#endif /* WPSWIZARDSTEPFOUR_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizardstepthreebutton.h --- a/wlanutilities/wpswizard/inc/wpswizardstepthreebutton.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2010 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: Step 3 Button press mode -* -*/ - -#ifndef WPSWIZARDSTEPTHREEBUTTON_H_ -#define WPSWIZARDSTEPTHREEBUTTON_H_ - -// System includes -#include - -// User includes -#include "wpswizardpage.h" - -// Forward declarations -class HbRadioButtonList; -class HbWidget; -class HbLabel; -class WpsWizardPrivate; - -// External data types - -// Constants - -// Class declaration -class WpsPageStepThreeButton : public WpsWizardPage - { -Q_OBJECT -public: - WpsPageStepThreeButton(WpsWizardPrivate* parent); - ~WpsPageStepThreeButton(); - -public: - /*! - * Creates a visualization of the page. - */ - HbWidget* initializePage(); - /*! - * Returns id of next page. updates settings EapWizard. - */ - int nextId(bool &removeFromStack) const; - /*! - * Returns how many steps should be gone backwards. - */ - int stepsBackwards(); - /*! - * This method is called when Previous button has been pressed. - */ - void previousTriggered(); - /*! - * This method is called when Cancel button has been pressed. - */ - void cancelTriggered(); - /*! - * This method is called when a visualization is displayed to detect - * whether next button should be enabled or not. - */ - bool validate() const; - -public slots: - -private: - Q_DISABLE_COPY(WpsPageStepThreeButton) - HbWidget *mWidget; - HbRadioButtonList *mRadio; - HbLabel *mTitle; - HbLabel *mHeading; - bool mValid; - }; - -/*! @} */ - -#endif /* WPSWIZARDSTEPTHREEBUTTON_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h --- a/wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2010 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: Step 3 Number mode -* -*/ - -#ifndef WPSWIZARDSTEPTHREENUMBER_H_ -#define WPSWIZARDSTEPTHREENUMBER_H_ - - -// System includes -#include - -// User includes -#include "wpswizardpage.h" - -// Forward declarations -class HbRadioButtonList; -class HbWidget; -class HbLabel; -class WpsWizardPrivate; - -// External data types -// Constants - -// Class declaration -class WpsPageStepThreeNumber : public WpsWizardPage - { - Q_OBJECT - public: - WpsPageStepThreeNumber(WpsWizardPrivate* parent); - ~WpsPageStepThreeNumber(); - public: - /*! - * Creates a visualization of the page. - */ - HbWidget* initializePage(); - /*! - * Returns id of next page. updates settings EapWizard. - */ - int nextId(bool &removeFromStack) const; - /*! - * Returns how many steps should be gone backwards. - */ - int stepsBackwards(); - /*! - * This method is called when Previous button has been pressed. - */ - void previousTriggered(); - /*! - * This method is called when Cancel button has been pressed. - */ - void cancelTriggered(); - /*! - * This method is called when a visualization is displayed to detect - * whether next button should be enabled or not. - */ - bool validate() const; - - private: - /*! - * This method computes a random number based on current syste time - */ - int computeRandNumber(); - /*! - * This method computes the check sum on the input number - */ - int computeCheckSum(int aPin); - - private slots: - - private: // data - Q_DISABLE_COPY(WpsPageStepThreeNumber) - HbWidget *mWidget; - HbRadioButtonList *mRadio; - HbLabel *mTitle; - HbLabel *mHeading; - bool mValid; - }; - -/*! @} */ - -#endif /* WPSWIZARDSTEPTHREENUMBER_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/inc/wpswizardsteptwo.h --- a/wlanutilities/wpswizard/inc/wpswizardsteptwo.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2010 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: WPS wizard page 2 -* -*/ -#ifndef WPSWIZARDSTEPTWO_H_ -#define WPSWIZARDSTEPTWO_H_ - -// System includes -#include - -// User includes -#include "wpswizardpage.h" - -// Forward declarations -class HbRadioButtonList; -class HbWidget; -class HbLabel; -class WpsWizardPrivate; - - -// External data types -// Constants - - -// Class declaration -class WpsPageStepTwo : public WpsWizardPage - { -Q_OBJECT -public: - WpsPageStepTwo(WpsWizardPrivate* parent); - ~WpsPageStepTwo(); - -public: - /*! - * Creates a visualization of the page. - */ - HbWidget* initializePage(); - /*! - * Returns id of next page. updates settings EapWizard. - */ - int nextId(bool &removeFromStack) const; - /*! - * Returns how many steps should be gone backwards. - */ - int stepsBackwards(); - /*! - * This method is called when Previous button has been pressed. - */ - void previousTriggered(); - /*! - * This method is called when Cancel button has been pressed. - */ - void cancelTriggered(); - /*! - * This method is called when a visualization is displayed to detect - * whether next button should be enabled or not. - */ - bool validate() const; - -public slots: - /*! - * To receive the signal when an item is selected in the list view - */ - void itemSelected(int index); - -private: - Q_DISABLE_COPY(WpsPageStepTwo) - - HbWidget *mWidget; - HbRadioButtonList *mRadio; - HbLabel *mTitle; - HbLabel *mHeading; - bool mValid; - int mItemSelected; - }; - - -#endif /* WPSWIZARDSTEPTWO_H_ */ diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/occ_wps_P1.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P1.docml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/occ_wps_P2.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P2.docml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/occ_wps_P3.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P3.docml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/occ_wps_P4.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P4.docml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/occ_wps_P5.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P5.docml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/occ_wps_P6.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P6.docml Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/resource.qrc --- a/wlanutilities/wpswizard/resources/resource.qrc Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - occ_wps_P1.docml - occ_wps_P2.docml - occ_wps_P3.docml - occ_wps_P4.docml - occ_wps_P5.docml - occ_wps_P6.docml - - - - wpswizardplugin.qm - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/wpswizardplugin.qm Binary file wlanutilities/wpswizard/resources/wpswizardplugin.qm has changed diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/resources/wpswizardplugin.ts --- a/wlanutilities/wpswizard/resources/wpswizardplugin.ts Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - Configure manually - Configure manually - qtl_list_popup_sec_add - occ_wps_01 - list - oc - False - - - - Use PIN code - Use PIN code - qtl_list_popup_sec_add - occ_wps_01 - list - oc - False - - - - First, press button on the wireless station to initiate the setup process, then select ‘Next’. - First, press button on the wireless station to initiate the setup process, then select ‘Next’. - qtl_dialog_pri5 - occ_wps_02 - dialog - oc - False - - - - Settings received for multiple WLAN networks. Select the network to use: - Settings received for multiple WLAN networks. Select the network to use: - qtl_dialog_pri5 - occ_wps_05 - dialog - oc - False - - - - Enter ‘%1 on the wireless station then select ‘Next’. - Enter ‘%1 on the wireless station then select ‘Next’. - qtl_dialog_pri5 - occ_wps_03 - dialog - oc - False - - - - Selected network supports Wi-Fi Protected Setup™ for receiving settings automatically. - Selected network supports Wi-Fi Protected Setup™ for receiving settings automatically. - qtl_dialog_pri5 - occ_wps_01 - dialog - oc - False - - - - Negotiating - Negotiating - qtl_dialog_pri3 - occ_wps_04 - dialog - oc - False - - - - Use push-button - Use push-button - qtl_list_popup_sec_add - occ_wps_01 - list - oc - False - - - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/rom/wpswizard.iby --- a/wlanutilities/wpswizard/rom/wpswizard.iby Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2010 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: -* -*/ - -#ifndef WPSWIZARD_IBY -#define WPSWIZARD_IBY - -#include - -//#ifdef __PROTOCOL_WLAN - -file=ABI_DIR\BUILD_DIR\wpswizard.dll SHARED_LIB_DIR\wpswizard.dll - -//#endif // __PROTOCOL_WLAN - -#endif // WPSWIZARD_IBY diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/cwpsactiverunner.cpp --- a/wlanutilities/wpswizard/src/cwpsactiverunner.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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 middleware wrapper class - * - * - */ - - -// User includes -#include "cwpsactiverunner.h" -#include "wlanmgmtcommon.h" - -//Need to check this. -const TInt KArrayGranularity = 4; - -/*! - \class CWpsActiveRunner - \brief CWpsActiveRunner is a wrapper class wlan Mgmt engine interface - */ - - -/*! - * Creates the instance of active runner which encapsulates the wlan mgmt - * interface middleware calls - * - * - * \param MWpsActiveRunnerCallback call back interface to notify the completion of the middleware calls - */ -CWpsActiveRunner* CWpsActiveRunner::NewL(MWpsActiveRunnerCallback& aObserver) -{ - CWpsActiveRunner* self = new (ELeave) CWpsActiveRunner( aObserver ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} -/*! - * Creates the instance of active runner which encapsulates the wlan mgmt - * interface middleware calls - * - * - * \param MWpsActiveRunnerCallback call back interface to notify the completion of the middleware calls - */ -CWpsActiveRunner::CWpsActiveRunner(MWpsActiveRunnerCallback& aObserver) : - CActive(EPriorityStandard), iObserver(aObserver) -{ -#ifdef __arm - iIapParametersArray = NULL; - iWLANMgmtClient = NULL; -#endif -} - -/*! - * Initializes the member variables - * - * - * \return integer error code indicating the result of the operation - */ -void CWpsActiveRunner::InitL() -{ - CActiveScheduler::Add(this); -#ifdef __arm - InitializeL(); -#else - iTimer.CreateLocal(); -#endif - -} - -void CWpsActiveRunner::ConstructL() -{ - InitL(); -} - -/*! - * Initializes the member variables for making the middleware calls - * - */ - -void CWpsActiveRunner::InitializeL() -{ -#ifdef __arm - if (!iWLANMgmtClient) - iWLANMgmtClient = CWlanMgmtClient::NewL(); - if (!iIapParametersArray) - iIapParametersArray = new (ELeave) CArrayFixSeg< - TWlanProtectedSetupCredentialAttribute> (KArrayGranularity); -#endif -} - -/*! - * Destructor - * - */ - -CWpsActiveRunner::~CWpsActiveRunner() -{ - Cancel(); -#ifdef __arm - delete iWLANMgmtClient; - delete iIapParametersArray; -#else - iTimer.Cancel(); - iTimer.Close(); -#endif -} - -/*! - * Initiates the call to the middleware - */ -void CWpsActiveRunner::StartSetup(RBuf8& aSsid, int aPin) -{ -#ifdef __arm - TWlanSsid ssid; - TWlanWpsPin pin; - - ssid.Copy(aSsid); - TBuf8<32> pinCode; - pinCode.AppendNum(aPin); - pin.Copy(pinCode); - iWLANMgmtClient->RunProtectedSetup(iStatus,ssid,pin,*iIapParametersArray); -#else - iTimer.After(iStatus, 4 * 1000000); -#endif - SetActive(); - -} - -/*! - * RunL implementation - */ -void CWpsActiveRunner::RunL() -{ - TInt completionCode = iStatus.Int(); - QList credentials; - - if (completionCode < KErrNone) { - //Raise Error - iObserver.WpsActiveRunnerStopped(credentials, completionCode); - } - else { -#ifdef __arm - TInt len = iIapParametersArray->Length(); - TInt count; - for(count=0;countCount();count++) - { - TWlanProtectedSetupCredentialAttribute attr =(*iIapParametersArray)[count]; - credentials.append(attr); - } - iObserver.WpsActiveRunnerStopped(credentials,completionCode); -#else - - RunProtectedSetup_Stub(); -#endif - } - -} - -/*! - * Cancels the ongoing call - */ -void CWpsActiveRunner::DoCancel() -{ -#ifdef __arm - if(iWLANMgmtClient) - iWLANMgmtClient->CancelProtectedSetup(); -#else - iTimer.Cancel(); -#endif -} - -/*! - * Handles the error usecase - */ -TInt CWpsActiveRunner::RunError(TInt aError) -{ - QList credentials; -#ifdef __arm - if(iWLANMgmtClient) - iWLANMgmtClient->CancelProtectedSetup(); -#else - iTimer.Cancel(); -#endif - - iObserver.WpsActiveRunnerStopped(credentials, aError); -} - -#ifndef __arm -void CWpsActiveRunner::RunProtectedSetup_Stub() -{ - QList credentials; - TWlanProtectedSetupCredentialAttribute attr1 = { EWlanOperatingModeInfrastructure, // iOperatingMode - EWlanAuthenticationModeOpen, // iAuthenticationMode - EWlanIapSecurityModeWpa, // iSecurityMode, - _L8( "STUB01" ), // iSsid - _L8( "" ), // iWepKey1 - _L8( "" ), // iWepKey2 - _L8( "" ), // iWepKey3 - _L8( "" ), // iWepKey4 - EWlanDefaultWepKey1, // iWepDefaultKey - _L8( "testtest" ) - // iWpaPreSharedKey - }; - - TWlanProtectedSetupCredentialAttribute attr2 = { EWlanOperatingModeAdhoc, - EWlanAuthenticationModeOpen, EWlanIapSecurityModeWep, _L8( "STUB02" ), _L8( "12345" ), - _L8( "" ), _L8( "" ), _L8( "" ), EWlanDefaultWepKey1, _L8( "" ) }; - - credentials.append(attr1); - credentials.append(attr2); - - iObserver.WpsActiveRunnerStopped(credentials, KErrNone); -} -#endif diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizard.cpp --- a/wlanutilities/wpswizard/src/wpswizard.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard: API implementation. - * - */ - - -// System includes -#include -#include -#include -#include -#include -#include -#include -#include - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpswizardTraces.h" -#endif - -// User includes -// WLAN Wizard -#include "wlanwizardhelpper.h" - -// Wizard -#include "wpswizard.h" -#include "wpswizard_p.h" - -// Wizard Pages -#include "wpswizardsteptwo.h" -#include "wpswizardstepthreebutton.h" -#include "wpswizardstepthreenumber.h" -#include "wpswizardstepfour.h" -#include "wpswizardstepfive.h" - - -class WlanWizardHelpper; - -/*! -* Creates the WpsWizard object -* -* \param WlanWizardHelpper* Helper class to from the framework -* \param BearerType Indicates the bearer type Eg. Wlan -* -*/ - -WpsWizard::WpsWizard(WlanWizardHelpper *wizardHelpper, BearerType bearerType, - int referenceId) : - d_ptr(new WpsWizardPrivate(this, wizardHelpper, bearerType, referenceId)) - { - OstTraceFunctionEntry1(WPSWIZARD_WPSWIZARD_ENTRY, this) - OstTraceFunctionExit1(WPSWIZARD_WPSWIZARD_EXIT, this) - } - -/*! -* Destructor -* -*/ - -WpsWizard::~WpsWizard() - { - OstTraceFunctionEntry1(WPSWIZARD_WPSWIZARD_ENTRY, this); - delete d_ptr; - OstTraceFunctionExit1(WPSWIZARD_WPSWIZARD_EXIT, this); - } - -/*! -* StoreSettings: Stores the settings in the commsdat database -* -*/ - -void WpsWizard::storeSettings() - { - OstTraceFunctionEntry1(WPSWIZARD_STORESETTINGS_ENTRY, this); - OstTraceFunctionExit1(WPSWIZARD_STORESETTINGS_EXIT, this); - } - -/*! -* Creates the summary page, valid only for EAP usecase -* -* \param WlanWizardPlugin::Summary indicates the type of summary item -* \param QString &item item name -* \param QString &value item value -* -* \return the status of the summary operation -*/ - -bool WpsWizard::summary(WlanWizardPlugin::Summary sum, QString &item, - QString &value) - { - OstTraceFunctionEntry1(WPSWIZARD_SUMMARY_ENTRY, this); - OstTraceFunctionExit1(WPSWIZARD_SUMMARY_EXIT, this); - return true; - } diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizardpage.cpp --- a/wlanutilities/wpswizard/src/wpswizardpage.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard: API for wizard pages. - * - */ - -// System includes -#include - -// User includes -#include "wpswizardpage.h" - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpswizardpageTraces.h" -#endif - -#define WPS_DEFAULT_STEPBACK 1 - - /*! - * Constructor for the WPS page baseclass - * - * \param WpsWizardPrivate* pointer to the implementation class - */ - -WpsWizardPage::WpsWizardPage(WpsWizardPrivate* parent) : - mWizard(parent) -{ -OstTraceFunctionEntry1(WPSWIZARDPAGE_WPSWIZARDPAGE_ENTRY, this) -OstTraceFunctionExit1(WPSWIZARDPAGE_WPSWIZARDPAGE_EXIT, this) -} - -/*! -* Destructor -*/ -WpsWizardPage::~WpsWizardPage() -{ - OstTraceFunctionEntry1(WPSWIZARDPAGE_WPSWIZARDPAGE_ENTRY, this) - mWizard = NULL; -OstTraceFunctionExit1(WPSWIZARDPAGE_WPSWIZARDPAGE_EXIT, this) -} - -/*! -* Determines how many pages to step back. -* \return number of pages to step backwards -*/ -int WpsWizardPage::stepsBackwards() -{ - OstTraceFunctionEntry1(WPSWIZARDPAGE_STEPBACKWARDS_ENTRY, this) - OstTraceFunctionExit1(WPSWIZARDPAGE_STEPBACKWARDS_EXIT, this) - return WPS_DEFAULT_STEPBACK; -} - -/*! -* Validates the contents of the page -*/ -bool WpsWizardPage::validate() const -{ - OstTraceFunctionEntry1(WPSWIZARDPAGE_VALIDATE_ENTRY, this) - OstTraceFunctionExit1(WPSWIZARDPAGE_VALIDATE_EXIT, this) - return true; -} diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizardprivate.cpp --- a/wlanutilities/wpswizard/src/wpswizardprivate.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard: Private implementation. - * - */ - -/* - * %version: 1 % - */ - -// System includes -#include -#include -#include -#include -#include -#include -#include -#include - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpswizardprivateTraces.h" -#endif - -// User includes -#include "wlanwizardhelpper.h" -// Wizard -#include "wpswizard.h" -#include "wpswizard_p.h" -// Wizard Pages -#include "wpswizardsteptwo.h" -#include "wpswizardstepthreebutton.h" -#include "wpswizardstepthreenumber.h" -#include "wpswizardstepfour.h" -#include "wpswizardstepfive.h" - - -class WlanWizardHelpper; - -/*! - * Constructor for the private implementation of wps wiazard - * - * \param WpsWizard* pointer to the framework object - * \param WlanWizardHelpper * pointer to the wizard helpper class - * - */ -WpsWizardPrivate::WpsWizardPrivate(WpsWizard* wizard, - WlanWizardHelpper *wizardHelpper, int bearerType, int referenceId) : - q_ptr(wizard), mBearerType(bearerType), mReferenceId(referenceId), - mWizardHelpper(wizardHelpper), mRandomNumber(0) - - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_ENTRY, this); - - // TODO: load localization file - mTranslator = new QTranslator(this); - mTranslator->load(":/loc/wpswizardplugin.qm"); - qApp->installTranslator(mTranslator); - - createPages(); - - OstTraceFunctionExit1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_EXIT, this); - } - -/*! - * Destructor - */ -WpsWizardPrivate::~WpsWizardPrivate() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_ENTRY, this); - // have to delete the memory that was allocated in this object - mIapList.clear(); - delete mTranslator; - OstTraceFunctionExit1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_EXIT, this); - } - -/*! - * Provides the caller with the functionality to enable/disable the 'Next' button - * - * \param bool to indicate whether to enable or disable the 'next button' - */ -void WpsWizardPrivate::enableNextButton(bool enable) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_ENABLENEXTBUTTON_ENTRY, this); - mWizardHelpper->enableNextButton(enable); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_ENABLENEXTBUTTON_EXIT, this); - } - -/*! - * Provides the functionality to automatically move to the next page. - */ -void WpsWizardPrivate::nextPage() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_NEXTPAGE_ENTRY, this); - mWizardHelpper->nextPage(); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_NEXTPAGE_EXIT, this); - } - -/*! - * Provides the functionality to store the recieved settings - * - * \param int indicates the index in the array of received settings to be stored - */ -void WpsWizardPrivate::storeSettings(int aIndex) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_STORESETTINGS_ENTRY, this); - mWpsAttr = mIapList[aIndex]; - - QString ssid = QString::fromUtf8((const char*) mWpsAttr.iSsid.Ptr(), - mWpsAttr.iSsid.Length()); - - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfSsid, ssid); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfNetworkMode, - mWpsAttr.iOperatingMode); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfSecurityMode, - mWpsAttr.iSecurityMode); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWepDefault, - mWpsAttr.iWepDefaultKey); - QString str = QString::fromUtf8((const char*) mWpsAttr.iWepKey1.Ptr(), - mWpsAttr.iWepKey1.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep1, str); - str = QString::fromUtf8((const char*) mWpsAttr.iWepKey2.Ptr(), mWpsAttr.iWepKey2.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep2, str); - str = QString::fromUtf8((const char*) mWpsAttr.iWepKey3.Ptr(), mWpsAttr.iWepKey3.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep3, str); - str = QString::fromUtf8((const char*) mWpsAttr.iWepKey4.Ptr(), mWpsAttr.iWepKey4.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep4, str); - - OstTraceFunctionExit1(WPSWIZARDPRIVATE_STORESETTINGS_EXIT, this); - } - -/*! - * Provides the functionality to retrieve the ssid of the network to connect - * \return returns the SSID as a QString - */ -QString WpsWizardPrivate::getSsid() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_GETSSID_ENTRY, this); - QString ssid; - ssid = mWizardHelpper->configurations(WlanWizardHelpper::ConfSsid).toString(); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_GETSSID_EXIT, this); - return ssid; - } - -/*! - * Provides functionality for the caller to store the array of recieved settings from AP - * \param QList& received settings - * - */ -void WpsWizardPrivate::storeSettingsArray(QList< - TWlanProtectedSetupCredentialAttribute>& aIapList) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_STORESETTINGSARRAY_ENTRY, this); - mIapList = aIapList; - OstTraceFunctionExit1(WPSWIZARDPRIVATE_STORESETTINGSARRAY_EXIT, this); - } - -/*! - * Returns the array of settings received from the AP - * - * \return Array containing the settings - */ -QList WpsWizardPrivate::getSettingsArray() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_GETSETTINGSARRAY_ENTRY, this); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_GETSETTINGSARRAY_EXIT, this); - return mIapList; - } - - - -/*! - * Creates the required pages for WPS setup - */ -void WpsWizardPrivate::createPages() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_CREATEPAGES_ENTRY, this); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep2, - new WpsPageStepTwo(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep3_Button, - new WpsPageStepThreeButton(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep3_Number, - new WpsPageStepThreeNumber(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep4, - new WpsPageStepFour(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep5, - new WpsPageStepFive(this)); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_CREATEPAGES_EXIT, this); - } - -/*! - * Provides with the functionality to store the PIN generated - * - * \param int The generated PIN code to be used in succesive steps - * - */ -void WpsWizardPrivate::setPin(int random) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_SETPIN_ENTRY, this); - mRandomNumber = random; - OstTraceFunctionExit1(WPSWIZARDPRIVATE_SETPIN_EXIT, this); - } - -/*! - * Returns the PIN code stored in one of the WPS Pages - * - * \return PIN code to be used in the WPS operation. - */ -int WpsWizardPrivate::getPin() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_GETPIN_ENTRY, this); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_GETPIN_EXIT, this); - return mRandomNumber; - - } diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizardstepfive.cpp --- a/wlanutilities/wpswizard/src/wpswizardstepfive.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard Page: Step 5 - * - */ - -// System includes -#include -#include -#include -#include -#include - -// User includes -#include "wpswizardstepfive.h" -#include "wpswizard_p.h" - -// Trace Includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpspagestepfiveTraces.h" -#endif - -/*! - * Constructor for WPS page five - * - * \param WpsWizardPrivate* Pointer to the WPS wizard private implementation - */ -WpsPageStepFive::WpsPageStepFive(WpsWizardPrivate* parent) : - WpsWizardPage(parent), mWidget(NULL), mRadio(NULL), mValid(false) -{ -OstTraceFunctionEntry1(WPSPAGESTEPFIVE_WPSPAGESTEPFIVE_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPFIVE_WPSPAGESTEPFIVE_EXIT, this) - -} - -/*! - * Destructor - */ -WpsPageStepFive::~WpsPageStepFive() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFIVE_WPSPAGESTEPFIVE_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPFIVE_WPSPAGESTEPFIVE_EXIT, this) - - delete mWidget; -} - -/*! - * Loads the page with all the widgets - * - * \return HbWidget* Returns the view widget - */ -HbWidget* WpsPageStepFive::initializePage() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFIVE_INITIALIZEPAGE_ENTRY, this) - - if (!mWidget) { - bool ok; - HbDocumentLoader loader; - loader.load(":/docml/occ_wps_P5.docml", &ok); - Q_ASSERT_X(ok, "WPS Wizard", "Invalid docml file"); - - mWidget = qobject_cast (loader.findWidget("occ_wps_P5")); - Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found"); - - //mTitle = qobject_cast (loader.findWidget("label_title")); - //Q_ASSERT_X(mTitle != 0, "WPS wizard", "title not found"); - - mHeading = qobject_cast (loader.findWidget("label_heading")); - Q_ASSERT_X(mTitle != 0, "WPS wizard", "Header not found"); - - mRadio = qobject_cast (loader.findWidget("radioButtonList")); - Q_ASSERT_X(mRadio != 0, "WPS Wizard", "List not found"); - - QList arr = mWizard->getSettingsArray(); - - QStringList ssidList; - for (int count = 0; count < arr.count(); count++) { - TWlanProtectedSetupCredentialAttribute attr = arr[count]; - //file.Write(attr.iSsid); - //Append (attr.iSsid) to a list and send to UI Engine. - QString ssid = QString::fromUtf8((const char*) attr.iSsid.Ptr(), attr.iSsid.Length()); - ssidList.append(ssid); - } - - mRadio->setItems(ssidList); - - connect(mRadio, SIGNAL(itemSelected(int)), this, SLOT(itemSelected(int))); - } - OstTraceFunctionExit1(WPSPAGESTEPFIVE_INITIALIZEPAGE_EXIT, this) - return mWidget; -} - -/*! - * Callback when the previous button is clicked - */ -void WpsPageStepFive::previousTriggered() -{ -OstTraceFunctionEntry1(WPSPAGESTEPFIVE_PREVIOUSTRIGGERED_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPFIVE_PREVIOUSTRIGGERED_EXIT, this) - -} -/*! - * CallBack when the cancel button is clicked - */ -void WpsPageStepFive::cancelTriggered() -{ -OstTraceFunctionEntry1(WPSPAGESTEPFIVE_CANCELTRIGGERED_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPFIVE_CANCELTRIGGERED_EXIT, this) - -} -/*! - * Funtion to determine the next page to be displayed in the wizard process - * - * \param bool& RemoveFromStack indicating whether the current page should be - * removed from the stack - * - * \return int Page Id of the next page to be displayed. - */ -int WpsPageStepFive::nextId(bool &removeFromStack) const -{ - OstTraceFunctionEntry1(WPSPAGESTEPFIVE_NEXTID_ENTRY, this) - - int id = WlanWizardPage::PageProcessSettings; - removeFromStack = false; - OstTraceFunctionExit1(WPSPAGESTEPFIVE_NEXTID_EXIT, this) - return id; -} - -/*! - * Determines the Number of steps to move backwards when 'Prev' Button - * is clicked - * - * \return int Number of pages to move backwards - */ -int WpsPageStepFive::stepsBackwards() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFIVE_STEPSBACKWARDS_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPFIVE_STEPBACKWARDS_EXIT, this) - - return (PageWpsWizardStep5 - PageWpsWizardStep2) - 1; -} - -/*! - * Validates the content of the pages - * - * \return bool Indicating the result of the operation - */ -bool WpsPageStepFive::validate() const -{ - OstTraceFunctionEntry1(WPSPAGESTEPFIVE_VALIDATE_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPFIVE_VALIDATE_EXIT, this) - - return mValid; -} - -/*! - * Call back when an item is selected from the list on the UI - * - * \param int index Indcating the relative position in the list - */ -void WpsPageStepFive::itemSelected(int index) -{ - OstTraceFunctionEntry1(WPSPAGESTEPFIVE_ITEMSELECTED_ENTRY, this) - - mValid = true; - mWizard->storeSettings(index); - mWizard->enableNextButton(mValid); - - OstTraceFunctionExit1(WPSPAGESTEPFIVE_ITEMSELECTED_EXIT, this) -} - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizardstepfour.cpp --- a/wlanutilities/wpswizard/src/wpswizardstepfour.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard Page: Step 4 progress bar display - * - */ - -/* - * %version: 1 % - */ - -// System includes -#include -#include -#include -#include -#include -#include -#include - -// User includes -#include "wpswizardstepfour.h" -#include "wpswizard_p.h" - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpspagestepfourTraces.h" -#endif - -/*! - * Constructor for WPS page four - * - * \param WpsWizardPrivate* Pointer to the WPS wizard private implementation - */ -WpsPageStepFour::WpsPageStepFour(WpsWizardPrivate* parent) : - WpsWizardPage(parent), mWidget(NULL), mRadio(NULL), mValid(false) -{ -OstTraceFunctionEntry1(WPSPAGESTEPFOUR_WPSPAGESTEPFOUR_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPFOUR_WPSPAGESTEPFOUR_EXIT, this) - -} - -/*! - * Destructor - */ -WpsPageStepFour::~WpsPageStepFour() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_WPSPAGESTEPFOUR_ENTRY, this) - - delete mWidget; - delete mWpsActiveRunner; - -OstTraceFunctionExit1(WPSPAGESTEPFOUR_WPSPAGESTEPFOUR_EXIT, this) -} - -/*! - * Loads the page with all the widgets - * - * \return HbWidget* Returns the view widget - */ -HbWidget* WpsPageStepFour::initializePage() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_INITIALIZEPAGE_ENTRY, this) - - if (!mWidget) { - bool ok; - HbDocumentLoader loader; - loader.load(":/docml/occ_wps_P4.docml", &ok); - Q_ASSERT_X(ok, "WPS Wizard", "Invalid docml file"); - - mWidget = qobject_cast (loader.findWidget("occ_wps_P4")); - Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found"); - - //mTitle = qobject_cast (loader.findWidget("label_title")); - //Q_ASSERT_X(mTitle != 0, "WPS wizard", "title not found"); - - mHeading = qobject_cast (loader.findWidget("label_heading")); - Q_ASSERT_X(mTitle != 0, "WPS wizard", "Header not found"); - - mProgressBar = qobject_cast (loader.findWidget("horizontalProgressBar")); - Q_ASSERT_X(mRadio != 0, "WPS Wizard", "List not found"); - - // start the framework. - mWpsActiveRunner = CWpsActiveRunner::NewL(*this); - Q_ASSERT(error == NULL); - } - - mProgressBar->setRange(0, 0); - - StartWpsRunner(); - OstTraceFunctionExit1(WPSPAGESTEPFOUR_INITIALIZEPAGE_EXIT, this) - - return mWidget; -} - -/*! - * Funtion to determine the next page to be displayed in the wizard process - * - * \param bool& RemoveFromStack indicating whether the current page should be - * removed from the stack - * - * \return int Page Id of the next page to be displayed. - */ -int WpsPageStepFour::nextId(bool &removeFromStack) const -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_NEXTID_ENTRY, this) - - int id = WpsWizardPage::PageNone; - removeFromStack = false; - if (countCredentials >= 2) { - id = WpsWizardPage::PageWpsWizardStep5; - } - else { - // only one response received. So go to the summary page - mWizard->storeSettings(0); - id = WlanWizardPage::PageProcessSettings; - } - OstTraceFunctionExit1(WPSPAGESTEPFOUR_NEXTID_EXIT, this) - - return id; -} - - -/*! - * Determines the Number of steps to move backwards when 'Prev' Button - * is clicked - * - * \return int Number of pages to move backwards - */ -int WpsPageStepFour::stepsBackwards() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_STEPSBACKWARDS_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPFOUR_STEPBACKWARDS_EXIT, this) - - return (PageWpsWizardStep4 - PageWpsWizardStep2) - 1; -} - -/*! - * Callback when the previous button is clicked - */ -void WpsPageStepFour::previousTriggered() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_PREVIOUSTRIGGERED_ENTRY, this) - - mWpsActiveRunner->DoCancel(); -OstTraceFunctionExit1(WPSPAGESTEPFOUR_PREVIOUSTRIGGERED_EXIT, this) - -} - -/*! - * CallBack when the cancel button is clicked -*/ -void WpsPageStepFour::cancelTriggered() -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_CANCELTRIGGERED_ENTRY, this) - - mWpsActiveRunner->DoCancel(); -OstTraceFunctionExit1(WPSPAGESTEPFOUR_CANCELTRIGGERED_EXIT, this) - -} - -/*! - * Validates the content of the pages - * - * \return bool Indicating the result of the operation - */ -bool WpsPageStepFour::validate() const -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_VALIDATE_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPFOUR_VALIDATE_EXIT, this) - - return mValid; -} - - -/*! - * CallBack function when the middleware WPS call returns back - * - * \param QList An array of received settngs - * \param int Error indicating the result of the operation - * - */ -void WpsPageStepFour::WpsActiveRunnerStopped( - QList& aCredentials, TInt aError) -{ - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_WPSACTIVERUNNERSTOPPED_ENTRY, this) - - mWpsErrorCode = aError; - if (aError == KErrNone) { - countCredentials = aCredentials.count(); - mWizard->storeSettingsArray(aCredentials); - mWizard->nextPage(); - } - else if (aError == KErrCancel) { - // operation was cancelled - - } - else { - QString str; - str = QString("Error: %1").arg(aError); - mProgressBar->setVisible(false); - //mHeading->setPlainText("General Error"); - mHeading->setPlainText(str); - mWizard->enableNextButton(false); - - } -OstTraceFunctionExit1(WPSPAGESTEPFOUR_WPSACTIVERUNNERSTOPPED_EXIT, this) -} - - -/*! - * Provides the functionality to initiate the WPS functionality - */ -void WpsPageStepFour::StartWpsRunner() -{ - - OstTraceFunctionEntry1(WPSPAGESTEPFOUR_STARTWPSRUNNER_ENTRY, this) - - // convert QString to symbian RBuf8 - - QString ssid = mWizard->getSsid(); - - TPtrC ptrName(reinterpret_cast (ssid.constData())); - - RBuf8 ssidName; - ssidName.Create(ptrName.Length()); - ssidName.Copy(ptrName); - - mWpsActiveRunner->StartSetup(ssidName, mWizard->getPin()); - ssidName.Close(); -OstTraceFunctionExit1(WPSPAGESTEPFOUR_STARTWPSRUNNER_EXIT, this) -} diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizardstepthreebutton.cpp --- a/wlanutilities/wpswizard/src/wpswizardstepthreebutton.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard Page: Step 3 Push button number - * - */ - -// System includes -#include -#include -#include -#include -#include - -// User includes -#include "wpswizardstepthreebutton.h" -#include "wpswizard_p.h" - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpspagestepthreebuttonTraces.h" -#endif - - -/*! - * Constructor for WPS page three button - * - * \param WpsWizardPrivate* Pointer to the WPS wizard private implementation - */ -WpsPageStepThreeButton::WpsPageStepThreeButton(WpsWizardPrivate* parent) : - WpsWizardPage(parent), mWidget(NULL), mRadio(NULL), mValid(true) -{ -OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_EXIT, this) - -} - -/*! - * Destructor - */ -WpsPageStepThreeButton::~WpsPageStepThreeButton() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_ENTRY, this) - - delete mWidget; - -OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_WPSPAGESTEPTHREEBUTTON_EXIT, this) -} - -/*! - * Loads the page with all the widgets - * - * \return HbWidget* Returns the view widget - */ -HbWidget* WpsPageStepThreeButton::initializePage() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_ENTRY, this) - - if (!mWidget) { - bool ok; - HbDocumentLoader loader; - loader.load(":/docml/occ_wps_P2.docml", &ok); - Q_ASSERT_X(ok, "WPS Wizard", "Invalid docml file"); - - mWidget = qobject_cast (loader.findWidget("occ_wps_P2")); - Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found"); - - //mTitle = qobject_cast (loader.findWidget("label_title")); - //Q_ASSERT_X(mTitle != 0, "WPS wizard", "title not found"); - - mHeading = qobject_cast (loader.findWidget("label_heading")); - Q_ASSERT_X(mHeading != 0, "WPS wizard", "Header not found"); - - mWizard->enableNextButton(true); - } - OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_INITIALIZEPAGE_EXIT, this) - - return mWidget; -} - -/*! - * Funtion to determine the next page to be displayed in the wizard process - * - * \param bool& RemoveFromStack indicating whether the current page should be - * removed from the stack - * - * \return int Page Id of the next page to be displayed. - */ -int WpsPageStepThreeButton::nextId(bool &removeFromStack) const -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_NEXTID_ENTRY, this) - int id = WlanWizardPage::PageNone; - removeFromStack = false; - id = WpsWizardPage::PageWpsWizardStep4; - OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_NEXTID_EXIT, this) - - return id; -} - -/*! - * Determines the Number of steps to move backwards when 'Prev' Button - * is clicked - * - * \return int Number of pages to move backwards -*/ -int WpsPageStepThreeButton::stepsBackwards() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_STEPSBACKWARDS_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_STEPBACKWARDS_EXIT, this) - - return (PageWpsWizardStep3_Button - PageWpsWizardStep2); -} - -/*! - * Callback when the previous button is clicked - */ -void WpsPageStepThreeButton::previousTriggered() -{ -OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_PREVIOUSTRIGGERED_EXIT, this) - -} - -/*! - * CallBack when the cancel button is clicked - */ -void WpsPageStepThreeButton::cancelTriggered() -{ -OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_CANCELTRIGGERED_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_CANCELTRIGGERED_EXIT, this) - -} - -/*! - * Validates the content of the pages - * - * \return bool Indicating the result of the operation -*/ -bool WpsPageStepThreeButton::validate() const -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREEBUTTON_VALIDATE_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTHREEBUTTON_VALIDATE_EXIT, this) - - return mValid; -} - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp --- a/wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard Page: Step 3 Number enter mode. - * - */ - -// System includes -#include -#include -#include -#include -#include -#include -#include - -// User includes -#include "wpswizardstepthreenumber.h" -#include "wpswizard_p.h" - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpspagestepthreenumberTraces.h" -#endif - -// Local constants -#define KMaxPINLength 8 - - -/*! - * Constructor for WPS page three number entry mode - * - * \param WpsWizardPrivate* Pointer to the WPS wizard private implementation - */ -WpsPageStepThreeNumber::WpsPageStepThreeNumber(WpsWizardPrivate* parent) : - WpsWizardPage(parent), mWidget(NULL), mRadio(NULL), mValid(true) -{ -OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_WPSPAGESTEPTHREENUMBER_ENTRY, this) -OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_WPSPAGESTEPTHREENUMBER_EXIT, this) - -} - - -/*! - * Destructor - */ -WpsPageStepThreeNumber::~WpsPageStepThreeNumber() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_WPSPAGESTEPTHREENUMBER_ENTRY, this) - - delete mWidget; - -OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_WPSPAGESTEPTHREENUMBER_EXIT, this) - -} - - -/*! - * Loads the page with all the widgets - * - * \return HbWidget* Returns the view widget - */ -HbWidget* WpsPageStepThreeNumber::initializePage() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_INITIALIZEPAGE_ENTRY, this) - - if (!mWidget) { - bool ok; - HbDocumentLoader loader; - loader.load(":/docml/occ_wps_P3.docml", &ok); - Q_ASSERT_X(ok, "WPS Wizard", "Invalid docml file"); - - mWidget = qobject_cast (loader.findWidget("occ_wps_P3")); - Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found"); - - mHeading = qobject_cast (loader.findWidget("label_heading")); - Q_ASSERT_X(mHeading != 0, "WPS wizard", "Header not found"); - - int randomNumber = computeRandNumber(); - mHeading->setPlainText(hbTrId("txt_occ_dialog_enter_1_on_the_wireless_station_t").arg( - randomNumber)); - mWizard->setPin(randomNumber); - mWizard->enableNextButton(true); - } - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_INITIALIZEPAGE_EXIT, this) - - return mWidget; -} - - -/*! - * Funtion to determine the next page to be displayed in the wizard process - * - * \param bool& RemoveFromStack indicating whether the current page should be - * removed from the stack - * - * \return int Page Id of the next page to be displayed. - */ -int WpsPageStepThreeNumber::nextId(bool &removeFromStack) const -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_NEXTID_ENTRY, this) - - int id = WlanWizardPage::PageNone; - removeFromStack = false; - id = WpsWizardPage::PageWpsWizardStep4; - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_NEXTID_EXIT, this) - - return id; -} - -/*! - * Determines the Number of steps to move backwards when 'Prev' Button - * is clicked - * - * \return int Number of pages to move backwards -*/ -int WpsPageStepThreeNumber::stepsBackwards() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_STEPSBACKWARDS_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_STEPBACKWARDS_EXIT, this) - - return (PageWpsWizardStep3_Number - PageWpsWizardStep2) - 1; -} - -/*! - * Callback when the previous button is clicked - */ -void WpsPageStepThreeNumber::previousTriggered() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_PREVIOUSTRIGGERED_ENTRY, this) - - mWizard->setPin(0); -OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_PREVIOUSTRIGGERED_EXIT, this) - -} - -/*! - * CallBack when the cancel button is clicked -*/ -void WpsPageStepThreeNumber::cancelTriggered() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_CANCELTRIGGERED_ENTRY, this) - - mWizard->setPin(0); -OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_CANCELTRIGGERED_EXIT, this) - -} - -/*! - * Validates the content of the pages - * - * \return bool Indicating the result of the operation -*/ -bool WpsPageStepThreeNumber::validate() const -{ - - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_VALIDATE_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_VALIDATE_EXIT, this) - - return mValid; -} - -/*! - * Computes the Random number based on current system time - * - * \return int Returns the generated random number - */ -int WpsPageStepThreeNumber::computeRandNumber() -{ - - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_COMPUTERANDNUMBER_ENTRY, this) - - int pin = 0; - QTime time(0, 0); - int seed = time.secsTo(QTime::currentTime()); - do { - qsrand(seed); - pin = qrand(); - } while (pin < (10 ^ (KMaxPINLength - 2)) || (((pin / 1000000) % 10)) == 0); - //last digit is checksum, so we need 7 digits - //and the first shouldn't be 0 - pin = pin % 10000000; - TInt checkSum = computeCheckSum(pin); - pin *= 10; - pin += checkSum; - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_COMPUTERANDNUMBER_EXIT, this) - return pin; -} - -/*! - * Computes the checksum for a given pin - * - * \return Returns the generated checksum - */ -int WpsPageStepThreeNumber::computeCheckSum(int aPin) -{ - - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_COMPUTECHECKSUM_ENTRY, this) - - int accum = 0; - aPin *= 10; - accum += 3 * ((aPin / 10000000) % 10); - accum += 1 * ((aPin / 1000000) % 10); - accum += 3 * ((aPin / 100000) % 10); - accum += 1 * ((aPin / 10000) % 10); - accum += 3 * ((aPin / 1000) % 10); - accum += 1 * ((aPin / 100) % 10); - accum += 3 * ((aPin / 10) % 10); - int digit = (accum % 10); - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_COMPUTECHECKSUM_EXIT, this) - return (10 - digit) % 10; -} - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/src/wpswizardsteptwo.cpp --- a/wlanutilities/wpswizard/src/wpswizardsteptwo.cpp Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of the License "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: - * WPS Wizard Page: Step 2 - * - */ - -// System includes -#include -#include -#include -#include -#include - -// User includes -#include "wpswizardsteptwo.h" -#include "wpswizard_p.h" - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpspagesteptwoTraces.h" -#endif - - -/*! - * Constructor for WPS page two - * - * \param WpsWizardPrivate* Pointer to the WPS wizard private implementation - */ -WpsPageStepTwo::WpsPageStepTwo(WpsWizardPrivate* parent) : - WpsWizardPage(parent), mWidget(NULL), mRadio(NULL), mValid(false) - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_WPSPAGESTEPTWO_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTWO_WPSPAGESTEPTWO_EXIT, this) - - } - -/*! - * Destructor - */ -WpsPageStepTwo::~WpsPageStepTwo() - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_WPSPAGESTEPTWO_ENTRY, this) - - delete mWidget; - OstTraceFunctionExit1(WPSPAGESTEPTWO_WPSPAGESTEPTWO_EXIT, this) - - } - -/*! - * Loads the page with all the widgets - * - * \return HbWidget* Returns the view widget - */ -HbWidget* WpsPageStepTwo::initializePage() - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_INITIALIZEPAGE_ENTRY, this) - - if (!mWidget) - { - bool ok; - HbDocumentLoader loader; - loader.load(":/docml/occ_wps_P1.docml", &ok); - Q_ASSERT_X(ok, "WPS Wizard", "Invalid docml file"); - - mWidget = qobject_cast (loader.findWidget("occ_wps_P1")); - Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found"); - - mHeading - = qobject_cast (loader.findWidget("label_heading")); - Q_ASSERT_X(mTitle != 0, "WPS wizard", "Header not found"); - - mRadio = qobject_cast (loader.findWidget( - "radioButtonList")); - Q_ASSERT_X(mRadio != 0, "WPS Wizard", "List not found"); - - connect(mRadio, SIGNAL(itemSelected(int)), this, - SLOT(itemSelected(int))); - - } - OstTraceFunctionExit1(WPSPAGESTEPTWO_INITIALIZEPAGE_EXIT, this) - - return mWidget; - } - - -/*! - * Funtion to determine the next page to be displayed in the wizard process - * - * \param bool& RemoveFromStack indicating whether the current page should be - * removed from the stack - * - * \return int Page Id of the next page to be displayed. - */ -int WpsPageStepTwo::nextId(bool &removeFromStack) const - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_NEXTID_ENTRY, this) - int id = WpsWizardPage::PageWpsWizardStep3_Button; - removeFromStack = false; - if (mItemSelected == 0) - id = WpsWizardPage::PageWpsWizardStep3_Button; - else - id = WpsWizardPage::PageWpsWizardStep3_Number; - OstTraceFunctionExit1(WPSPAGESTEPTWO_NEXTID_EXIT, this) - - - return id; - } - -/*! - * Determines the Number of steps to move backwards when 'Prev' Button - * is clicked - * - * \return int Number of pages to move backwards - */ -int WpsPageStepTwo::stepsBackwards() - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_STEPSBACKWARDS_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTWO_STEPBACKWARDS_EXIT, this) - - return 1; - } - -/*! - * Callback when the previous button is clicked -*/ -void WpsPageStepTwo::previousTriggered() - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_PREVIOUSTRIGGERED_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTWO_PREVIOUSTRIGGERED_EXIT, this) - - } - -/*! - * CallBack when the cancel button is clicked - */ -void WpsPageStepTwo::cancelTriggered() - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_CANCELTRIGGERED_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTWO_CANCELTRIGGERED_EXIT, this) - - } - -/*! - * Validates the content of the pages - * - * \return bool Indicating the result of the operation - */ -bool WpsPageStepTwo::validate() const - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_VALIDATE_ENTRY, this) - OstTraceFunctionExit1(WPSPAGESTEPTWO_VALIDATE_EXIT, this) - - return mValid; - } - -/*! - * Call back when an item is selected from the list on the UI - * - * \param int index Indcating the relative position in the list - */ -void WpsPageStepTwo::itemSelected(int index) - { - OstTraceFunctionEntry1(WPSPAGESTEPTWO_ITEMSELECTED_ENTRY, this) - - mValid = true; - mWizard->enableNextButton(mValid); - mItemSelected = index; - OstTraceFunctionExit1(WPSPAGESTEPTWO_ITEMSELECTED_EXIT, this) - - } - diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/traces/OstTraceDefinitions.h --- a/wlanutilities/wpswizard/traces/OstTraceDefinitions.h Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2010 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: - */ - -#ifndef __OSTTRACEDEFINITIONS_H__ -#define __OSTTRACEDEFINITIONS_H__ -#include -#endif diff -r f54b8905a6ee -r 195ec9e7dd85 wlanutilities/wpswizard/wpswizard.pro --- a/wlanutilities/wpswizard/wpswizard.pro Thu May 27 13:55:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -# -# Copyright (c) 2010 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: -# - -TEMPLATE = lib -TARGET = wpswizard -DEFINES += BUILD_WPS_WIZARD_DLL -VERSION = 0.0.1 -CONFIG += hb -MOC_DIR = _moc -RCC_DIR = _resources -RESOURCES += resources/resource.qrc -TRANSLATIONS += resources/wpswizardplugin.ts -HEADERS += ../inc/wpswizard.h \ - inc/wpswizard_p.h \ - inc/wpswizardpage.h \ - inc/wpswizardsteptwo.h \ - inc/wpswizardstepthreebutton.h \ - inc/wpswizardstepthreenumber.h \ - inc/wpswizardstepfour.h \ - inc/wpswizardstepfive.h \ - inc/cwpsactiverunner.h \ - inc/mwpsactiverunnercallback.h \ - traces/OstTraceDefinitions.h -SOURCES += src/wpswizardprivate.cpp \ - src/wpswizard.cpp \ - src/wpswizardpage.cpp \ - src/wpswizardsteptwo.cpp \ - src/wpswizardstepthreebutton.cpp \ - src/wpswizardstepthreenumber.cpp \ - src/wpswizardstepfour.cpp \ - src/wpswizardstepfive.cpp \ - src/cwpsactiverunner.cpp -LIBS += -lecom -symbian { - HEADERS += - SOURCES += - INCLUDEPATH += inc \ - ../../inc \ - ../wlanwizard/inc \ - $$MW_LAYER_SYSTEMINCLUDE \ - $$OS_LAYER_SYSTEMINCLUDE - TARGET.UID3 = 0x2003D2FE - TARGET.CAPABILITY = CAP_GENERAL_DLL - BLD_INF_RULES.prj_exports += "rom/wpswizard.iby CORE_MW_LAYER_IBY_EXPORT_PATH(wpswizard.iby)" - TARGET.EPOCALLOWDLLDATA = 1 - MMP_RULES += EXPORTUNFROZEN -}