--- 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
/**
--- 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<KIapNameLength> uidClient; // UID of the client.
+
+ uidClient.Copy( aUId.Name() );
+ ModifyClientUid( uidClient );
RArray<TUint32> destArray = RArray<TUint32>( 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
Binary file wlanutilities/wlanqtutilities/ut/context/commsdat_files/50_default.cre has changed
Binary file wlanutilities/wlanqtutilities/ut/context/commsdat_files/default.cre has changed
--- 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 <QObject>
-#include <QTest>
-#include <rconnmon.h>
-#include <nifvar.h>
-#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<WlanQtUtilsActiveConn*> 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<WlanQtUtilsWlanAp*> 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();
-}
--- 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 <QObject>
-
-#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<int> 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<WlanQtUtilsActiveConn *> 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<WlanQtUtilsCtxActiveConn *> 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<WlanQtUtilsWlanAp *> wlanApList); // TODO: Maybe boolean return value
-
- /**
- * List of WLAN access points that RConnectionMonitor stub will return in response to
- * RConnectionMonitor::GetPckgAttribute().
- */
- QList<WlanQtUtilsWlanAp *> 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 */
-
--- 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 <QString>
-#include <QObject>
-#include <rconnmon.h>
-#include <nifvar.h>
-#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<CConnMonWlanNetwork>& aRef,
- TUint aBufLen )
- {
- RPointerArray<HBufC> 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); i<items.Count(); ++i )
- {
- iBuf->Des().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<CConnMonWlanNetwork::KMaxNameLength> name(ap->ssid().utf16());
-
- TBufC<CConnMonWlanNetwork::KWlanBssId> bssid16(QString("addMAC").utf16());
- TBuf8<CConnMonWlanNetwork::KWlanBssId> 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<KConnMonMaxStringAttributeLength> iapName(iapNameLit);
- aValue = iapName.Des();
- } else if (aConnectionId == 20) {
- _LIT(iapNameLit, "WLAN IAP 3");
- TBufC<KConnMonMaxStringAttributeLength> 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<KConnMonMaxStringAttributeLength> ssid(ssidLit);
- aValue = ssid.Des();
- } else {
- Q_ASSERT(false);
- }
- } else if (aAttribute == KAccessPointName) {
- if (aConnectionId == 10) {
- _LIT(iapNameLit, "PACKET DATA 1");
- TBufC<KConnMonMaxStringAttributeLength> 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<CConnMonWlanNetwork::KWlanBssId> bssid16(QString("addMAC").utf16());
- TBuf8<CConnMonWlanNetwork::KWlanBssId> bssid;
- bssid.Copy(bssid16);
-
- _LIT(wlanAp1Name, "Test AP 1");
- TBufC<CConnMonWlanNetwork::KMaxNameLength> name1(wlanAp1Name);
- CConnMonWlanNetwork* wlanAp1 = CConnMonWlanNetwork::NewL(
- name1,
- EConnMonInfraStructure,
- 20,
- EConnMonSecurityOpen,
- bssid,
- vendorData );
- wlanPtrArray.Append(wlanAp1);
-
- _LIT(wlanAp2Name, "Test AP 2");
- TBufC<CConnMonWlanNetwork::KMaxNameLength> 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<CConnMonWlanNetwork::KMaxNameLength> name3(wlanAp3Name);
- CConnMonWlanNetwork* wlanAp3 = CConnMonWlanNetwork::NewL(
- name3,
- EConnMonInfraStructure,
- 20,
- EConnMonSecurityWep,
- bssid,
- vendorData );
- wlanPtrArray.Append(wlanAp3);
-
- _LIT(wlanAp4Name, "Test AP 4");
- TBufC<CConnMonWlanNetwork::KMaxNameLength> name4(wlanAp4Name);
- CConnMonWlanNetwork* wlanAp4 = CConnMonWlanNetwork::NewL(
- name4,
- EConnMonInfraStructure,
- 20,
- EConnMonSecurityOpen,
- bssid,
- vendorData );
- wlanPtrArray.Append(wlanAp4);
-
- _LIT(wlanAp5Name, "Test AP 5");
- TBufC<CConnMonWlanNetwork::KMaxNameLength> name5(wlanAp5Name);
- CConnMonWlanNetwork* wlanAp5 = CConnMonWlanNetwork::NewL(
- name5,
- EConnMonInfraStructure,
- 20,
- EConnMonSecurityWpa,
- bssid,
- vendorData );
- wlanPtrArray.Append(wlanAp5);
-
- _LIT(wlanAp6Name, "Test AP 6");
- TBufC<CConnMonWlanNetwork::KMaxNameLength> 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__
--- 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 <ictsclientinterface.h>
-
-#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__
--- 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 <es_sock.h>
-
-#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__
--- 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
--- 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 <QtCore>
-#include <QTest>
-#include <QSignalSpy>
-#include <rconnmon.h>
-#include <nifvar.h>
-#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<WlanQtUtilsWlanIap *> iaps;
- QList<WlanQtUtilsWlanAp *> 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<WlanQtUtilsWlanIap *> iaps;
- QList<WlanQtUtilsWlanAp *> 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<WlanQtUtilsWlanIap *> iaps;
- QList<WlanQtUtilsWlanAp *> 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<WlanQtUtilsWlanIap *> iaps;
- QList<WlanQtUtilsWlanAp *> 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<QVariant> 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<QVariant> 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<QVariant> 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<QVariant> 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<QVariant> 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<QVariant> 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<QVariant> 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<QVariant> 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<QVariant>* arguments)
-{
- QTest::qWait(1);
- QCOMPARE(spy->count(), 1);
- QList<QVariant> 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)
--- 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 <QObject>
-
-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<QVariant> *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_ */
-
--- 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
--- 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:
--- 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 <platform_paths.hrh>
-
-PRJ_EXPORTS
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
--- 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 <HbApplication>
-
-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
--- 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 <HbView>
-#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
--- 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 <QObject>
-
-#include <HbMainWindow>
-
-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
--- 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 <xqserviceprovider.h>
-
-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
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="13.003px" version="1.1" viewBox="0 0 13 13.003" width="13px" x="0px" y="0px">
-<g>
-<path d="M12.482,4.687c-0.107-0.278-0.295-1.325-1.732-2.848c0.092-0.449,0.078-1.618-1.25-1.818 C7.719-0.123,7.047,0.846,6.701,0.958C6.494,1.024,3.891,1.705,2.582,3.59C2.203,4.135,1.438,5.471,1.764,7.733 C1.596,7.782,0.938,7.954,0.625,8.096c-0.16,0.072-0.109,0.171-0.109,0.171s0.25,1.282,1.779,2.875 c-0.043,0.215-0.232,1.47,1.229,1.855L3.535,13c0,0,1.527,0.111,2.734-1.023c4.184-1.256,5.391-3.733,4.965-6.761 c0.211-0.064,0.781-0.261,1.188-0.386C12.422,4.83,12.5,4.752,12.482,4.687z M10.68,4.868c1.133,5.54-4.666,6.664-4.666,6.664 s-1.17,1.095-2.362,0.971c-1.229-0.204-0.817-1.52-0.817-1.52s-1.396-1.45-1.738-2.531c0.248-0.083,1.136-0.329,1.136-0.329 S1.813,5.549,2.992,3.876c1.867-2.265,3.57-2.171,4.326-2.721C7.723,0.861,8.188,0.439,9.46,0.52 c0.292,0.046,1.04,0.248,0.749,1.474c0.9,0.883,1.516,2.047,1.685,2.496C11.71,4.548,10.703,4.877,10.68,4.868z" fill="#231F20"/>
-<path d="M3.301,8.513c-0.02-0.011-0.926,0.239-0.94,0.254c0.64,1.751,2.265,2.595,2.895,2.406 c0.792-0.499,1.167-2.671,0.832-3.564C5.699,7.733,4.891,7.924,4.894,7.952C4.359,5.455,6.204,3.487,6.195,3.485 C6.195,3.485,2.406,4.518,3.301,8.513z" fill="#231F20"/>
-<rect fill="none" height="13" width="13"/>
-<path d="M9.738,4.39c0.02,0.011,0.926-0.239,0.94-0.254c-0.64-1.751-2.265-2.595-2.895-2.406 C6.992,2.229,6.617,4.4,6.952,5.294C7.34,5.169,8.148,4.979,8.146,4.95C8.68,7.447,6.835,9.415,6.844,9.417 C6.844,9.417,10.633,8.385,9.738,4.39z" fill="#231F20"/>
-</g>
-</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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="13px" version="1.1" viewBox="0 0 13 13" width="13px" x="0px" y="0px">
-<g>
-<rect fill="none" height="13" width="13"/>
-<path d="M1.095,3.063c0,1.419,0.777,2.466,0.802,2.501C2.024,5.478,2.24,5.328,2.368,5.242C2.346,5.207,1.665,4.244,1.665,3.063 c0-1.277,0.681-2.144,0.703-2.179C2.24,0.796,2.024,0.647,1.897,0.561C1.875,0.596,1.095,1.687,1.095,3.063z"/>
-<path d="M2.609,3.063c0,0.943,0.515,1.61,0.539,1.646c0.128-0.087,0.344-0.235,0.473-0.322c-0.026-0.037-0.44-0.658-0.44-1.323 c0-0.742,0.414-1.289,0.439-1.323C3.492,1.653,3.276,1.505,3.148,1.416C3.124,1.453,2.609,2.104,2.609,3.063z"/>
-<path d="M9.697,3.061c0-1.418-0.777-2.465-0.803-2.5C8.768,0.647,8.551,0.796,8.424,0.883C8.447,0.917,9.127,1.88,9.127,3.061 c0,1.278-0.68,2.145-0.703,2.179c0.127,0.089,0.344,0.238,0.471,0.325C8.918,5.529,9.697,4.438,9.697,3.061z"/>
-<path d="M8.182,3.061c0-0.942-0.514-1.61-0.539-1.645C7.518,1.502,7.299,1.651,7.17,1.737c0.027,0.037,0.441,0.658,0.441,1.323 c0,0.743-0.414,1.289-0.439,1.324C7.299,4.471,7.518,4.62,7.643,4.709C7.668,4.672,8.182,4.021,8.182,3.061z"/>
-<path d="M6,8.426c0,0,0.278,0,0.551,0V8.42c0-0.248,0.051-0.483,0.134-0.702l-0.868-3.47C6.31,4.073,6.664,3.616,6.664,3.063 c0-0.701-0.566-1.269-1.268-1.269c-0.703,0-1.27,0.567-1.27,1.269c0,0.552,0.354,1.008,0.846,1.184L3.852,8.731h-1.63V10H6V8.426z"/>
-<path d="M11.545,9.426V8.42c0-0.553-0.447-1-1-1H8.551c-0.553,0-1,0.447-1,1v1.006H7V13h5V9.426H11.545z M10,12H9v-1.574h1V12z M10.525,9.42H8.572c0-0.85-0.045-0.977,0.57-0.996h0.811C10.57,8.443,10.525,8.57,10.525,9.42z"/>
-</g>
-</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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="13" version="1.1" viewBox="0 0 13 13" width="13">
-<rect fill="none" height="13" width="13"/>
-<g>
-<rect height="11" width="3" x="10" y="2"/>
-<rect height="6.977" width="3" x="6.01" y="6.023"/>
-<rect height="2.976" width="3" x="2.021" y="10.024"/>
-</g>
-</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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="13" version="1.1" viewBox="0 0 13 13" width="13">
-<rect fill="none" height="13" width="13"/>
-<g>
-<rect height="2.976" width="3" x="2.021" y="10.024"/>
-<polygon points="10,12.05 13,9.05 13,7.051 10,10.05 "/>
-<polygon points="10,6.049 10,8.032 13,5.032 13,3.049 "/>
-<polygon points="10,2 10,4.029 12.027,2 "/>
-<polygon points="13,13 13,11.067 11.066,13 "/>
-<polygon points="6.01,10.036 6.01,12.021 9.01,9.021 9.01,7.036 "/>
-<polygon points="6.01,6.023 6.01,8.017 8.004,6.023 "/>
-<polygon points="9.01,13 9.01,11.039 7.049,13 "/>
-</g>
-</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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="13" version="1.1" viewBox="0 0 13 13" width="13">
-<rect fill="none" height="13" width="13"/>
-<g>
-<rect height="6.977" width="3" x="6.01" y="6.023"/>
-<rect height="2.975" width="3" x="2.021" y="10.025"/>
-<polygon points="10,12.051 13,9.051 13,7.051 10,10.051 "/>
-<polygon points="10,6.047 10,8.033 13,5.033 13,3.047 "/>
-<polygon points="13,13 13,11.068 11.066,13 "/>
-<polygon points="10,2 10,4.029 12.027,2 "/>
-</g>
-</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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="16" version="1.1" viewBox="0 0 16.003 16" width="16.003">
-<path d="M15.711,9.293l-3.958-3.958C11.912,4.792,12,4.228,12,3.65c0-2.023-1.086-3.442-1.119-3.492 c-0.049,0.035-0.469,0.322-0.658,0.452c0.033,0.048,0.979,1.267,0.979,3.04c0,0.465-0.07,0.919-0.189,1.359 c-0.133-0.001-0.265,0.014-0.391,0.066C10.246,5.231,10.004,5.596,10.004,6c0,0,0,0.5,0,1H7.618L7.282,5.204 c0.451-0.372,0.745-0.927,0.745-1.556c0-1.116-0.909-2.024-2.025-2.024c-1.118,0-2.027,0.908-2.027,2.024 c0,0.623,0.29,1.175,0.734,1.547L4.005,9H2.003v1c-0.404,0-0.769,0.244-0.923,0.617c-0.155,0.374-0.07,0.804,0.217,1.09l4,4 c0.285,0.286,0.716,0.372,1.09,0.217c0.373-0.155,0.617-0.52,0.617-0.924c0,0,0-0.5,0-1c1.389,0,5,0,5,0 c0.154,0,0.309-0.036,0.447-0.105c0.576-0.288,1.553-1.223,1.553-2.895h1c0.404,0,0.768-0.243,0.924-0.617 C16.082,10.009,15.996,9.579,15.711,9.293z"/>
-<path d="M8.477,5.494c0.178,0.124,0.482,0.331,0.658,0.452c0.033-0.049,0.75-1.038,0.75-2.296c0-1.32-0.717-2.249-0.75-2.297 c-0.049,0.035-0.468,0.32-0.658,0.451C8.51,1.854,9.089,2.674,9.089,3.65C9.089,4.768,8.51,5.446,8.477,5.494z"/>
-<path d="M3.523,1.806C3.346,1.682,3.042,1.475,2.865,1.354c-0.033,0.049-0.75,1.038-0.75,2.296c0,1.32,0.717,2.249,0.75,2.297 c0.049-0.035,0.469-0.32,0.658-0.451C3.49,5.445,2.911,4.626,2.911,3.649C2.911,2.532,3.49,1.854,3.523,1.806z"/>
-<path d="M1.119,7.141C1.297,7.018,1.6,6.812,1.777,6.69c-0.033-0.05-0.98-1.282-0.98-3.04c0-1.727,0.947-2.992,0.981-3.04 C1.6,0.487,1.298,0.282,1.121,0.158C1.088,0.208,0,1.58,0,3.65S1.086,7.09,1.119,7.141z"/>
-<path d="M11.283,5.187l0.185,0.077c0.153-0.519,0.233-1.061,0.233-1.613c0-1.098-0.312-2.155-0.9-3.071l-0.163,0.109 c0.565,0.887,0.864,1.907,0.864,2.962C11.502,4.175,11.428,4.691,11.283,5.187z" fill="#BFBAA9"/>
-<path d="M9.054,5.526c-0.055-0.036-0.11-0.075-0.165-0.11C9.216,4.881,9.387,4.274,9.387,3.65 c0-0.626-0.171-1.233-0.498-1.766l0.165-0.111C9.401,2.336,9.586,2.982,9.586,3.65S9.401,4.961,9.054,5.526L9.054,5.526z" fill="#BFBAA9"/>
-<path d="M2.947,5.526c-0.35-0.567-0.533-1.21-0.533-1.876s0.184-1.312,0.533-1.877L3.11,1.885 C2.782,2.42,2.611,3.025,2.611,3.65c0,0.624,0.172,1.23,0.499,1.766L2.947,5.526L2.947,5.526z" fill="#BFBAA9"/>
-<path d="M1.2,6.721C0.611,5.81,0.299,4.749,0.299,3.65c0-1.097,0.311-2.155,0.903-3.071l0.157,0.106l0.005,0.003 C0.794,1.576,0.497,2.597,0.497,3.65c0,1.053,0.297,2.071,0.865,2.961L1.2,6.721L1.2,6.721z" fill="#BFBAA9"/>
-<polygon fill="#FFFDFC" points="5.659,5.549 5.293,7.529 6.699,7.529 6.328,5.549 "/>
-<path d="M11.497,5.136c-0.06-0.034-0.122-0.056-0.187-0.076c-0.145,0.545-0.365,1.069-0.673,1.552 c0.054,0.036,0.106,0.074,0.16,0.109C11.116,6.229,11.346,5.694,11.497,5.136z" fill="#635E54"/>
-<path d="M6.001,5.674c0.118,0,0.231-0.016,0.344-0.035L5.991,3.75L5.643,5.638C5.759,5.658,5.878,5.674,6.001,5.674z " fill="#BFBAA9"/>
-<path d="M7.162,10L6.6,7C6.239,7,6.003,7,6.003,7C5.567,7,5.421,7.181,5.349,7.229L4.837,10H3.003v1h6v-1H7.162z" fill="#635E54"/>
-<rect fill="none" height="16" width="16" x="0.003"/>
-<path d="M2.003,11l3.097,3.097l0.575-1.658c0,0,6.776,0.338,7.073-0.261c0.146-0.296,0.256-0.682,0.256-1.178H2.003z " fill="#CFFFFF"/>
-<path d="M12.822,12H5.003v2l1,1v-2h6C12.004,13,12.533,12.728,12.822,12z" fill="#00CDFF"/>
-<path d="M14.214,9.21L11.004,6v2h-5c0,0-0.626,0.326-0.885,1.21H14.214z" fill="#CFFFFF"/>
-<path d="M5.185,9c-0.107,0.269-0.182,0.595-0.182,1h10l-1-1H5.185z" fill="#00CDFF"/>
-<path d="M6.001,4.674c-0.563,0-1.026-0.461-1.026-1.025s0.462-1.023,1.026-1.023c0.565,0,1.024,0.459,1.024,1.023 S6.566,4.674,6.001,4.674L6.001,4.674z" fill="#FFFDFC"/>
-</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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="16px" version="1.1" viewBox="-0.877 -0.503 16 16" width="16px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
-<g>
-<rect fill="none" height="16" width="16" x="-0.877" y="-0.503"/>
-<path d="M4.015,2.944L5.66,2.071C5.65,2.075,7.654,1.263,9.368,1.708c1.656,0.432,2.648,1.334,3.603,2.805 c0.953,1.471,1.178,4.049,0.547,5.422s-1.052,1.695-1.515,2.131l-2.15,1.555L4.015,2.944z" fill="url(#SVGID_1_)"/>
-<g>
-<path d="M12.374,8.62c0.164,3.301-2.211,5.867-5.306,5.732c-3.096-0.133-5.736-2.92-5.9-6.223 C1.004,4.829,3.379,2.261,6.475,2.394C9.569,2.53,12.21,5.319,12.374,8.62z" fill="#CEE1EF"/>
-</g>
-<path d="M8.194,6.822c0.768,1.117-0.044,2.279-0.05,2.313L8.697,9.7c0.416-0.553,0.951-1.979-0.033-3.399 L8.194,6.822z M5.411,6.518L4.938,5.831C3.96,6.909,4.504,8.523,4.921,9.221l0.551-0.372C5.466,8.819,4.647,7.369,5.411,6.518z M6.716,6.864c-0.307-0.04-0.201,0.437-0.195,0.462L5.338,12.08l2.813,0.489L6.95,7.4C6.956,7.377,7.058,6.924,6.716,6.864z" fill="#496DA2"/>
-<defs>
-<linearGradient gradientTransform="matrix(1 0 0 -1 0.1577 14.8145)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="7.0313" x2="11.3636" y1="10.8467" y2="5.6805">
-<stop offset="0" style="stop-color:#CEE1EF"/>
-<stop offset="0.5" style="stop-color:#A2C2DD"/>
-<stop offset="1" style="stop-color:#496DA2"/>
-</linearGradient>
-</defs>
-</g>
-</svg>
--- 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 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<service name="com.nokia.services.wlansniffer" filepath="\sf\mw\wirelessacc\wlanutilities\wlansniffer" >
- <description>WLAN Sniffer</description>
- <interface name="list" version="1.0" capabilities="">
- <description>List View</description>
- </interface>
-</service>
--- 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 @@
-<RCC>
- <qresource prefix="/docml" >
- <file>wlansnifferlistview.docml</file>
- </qresource>
- <qresource prefix="/icon" >
- <!-- Obsolete, but still in use somewhere. TO BE REMOVED!!! -->
- <file>qgn_indi_wifi_protected_add.svg</file>
- <file>qgn_indi_wlan_secure_network_add.svg</file>
- <file>qgn_indi_wlan_signal_good_add.svg</file>
- <file>qgn_indi_wlan_signal_low_add.svg</file>
- <file>qgn_indi_wlan_signal_med_add.svg</file>
- <file>qgn_prop_cmon_wlan_conn.svg</file>
- <file>qgn_prop_wlan_bearer.svg</file>
- </qresource>
-</RCC>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.8">
- <object name="addWlanAction" type="HbAction">
- <string locid="txt_occ_opt_add_new_wlan" name="text" value="Add new WLAN"/>
- </object>
- <object name="switchWlanAction" type="HbAction">
- <string locid="txt_occ_opt_switch_wlan_off" name="text" value="Switch WLAN off"/>
- </object>
- <object name="settingsAction" type="HbAction">
- <string locid="txt_common_opt_settings" name="text" value="Settings"/>
- </object>
- <object name="hideAction" type="HbAction">
- <string locid="txt_occ_opt_hide_unknown_networks" name="text" value="Hide unknown networks"/>
- </object>
- <widget name="occ_list" type="HbView">
- <widget name="content" role="HbView:widget" type="HbWidget">
- <widget name="container" type="HbWidget">
- <widget name="subTitle" type="HbGroupBox">
- <string locid="txt_occ_subhead_wireless_lan" name="titleText" value="Wireless LAN"/>
- <bool name="collapsable" value="FALSE"/>
- </widget>
- <widget name="statusContainer" type="HbWidget">
- <widget name="statusLabel" type="HbLabel">
- <enums name="textWrapping" value="TextWordWrap"/>
- <real name="z" value="5"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
- <sizehint height="6un" type="PREFERRED" width="13.8806un"/>
- <sizehint height="6un" type="MINIMUM" width="3.83582un"/>
- <string locid="txt_occ_grid_not_connected" name="plainText" value="Not connected"/>
- <enums name="logicalFont" value="FontPrimary"/>
- <fontspec name="fontSpec" role="Primary" textpaneheight="-1"/>
- </widget>
- <widget name="wlanLabel" type="HbLabel">
- <real name="z" value="2"/>
- <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
- <sizehint height="6un" type="PREFERRED" width="10un"/>
- <sizehint height="6un" type="MINIMUM" width="3.83582un"/>
- <sizehint height="2504062.01158un" type="MAXIMUM" width="2504062.01158un"/>
- <string locid="txt_occ_grid_wireless_lan" name="plainText" value="WLAN"/>
- <fontspec name="fontSpec" role="Primary" textpaneheight="26.8"/>
- </widget>
- <widget name="wlanButton" type="HbPushButton">
- <real name="z" value="3"/>
- <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
- <sizehint height="6un" type="PREFERRED" width="10un"/>
- <sizehint height="6un" type="MINIMUM" width="4.73134un"/>
- <string locid="txt_occ_button_on" name="text" value="On"/>
- <fontspec name="fontSpec" role="Primary" textpaneheight="26.8"/>
- </widget>
- <real name="z" value="0"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
- <sizehint height="10un" type="PREFERRED" width="52.08955un"/>
- <layout orientation="Horizontal" type="linear">
- <linearitem itemname="statusLabel"/>
- <linearitem itemname="wlanLabel"/>
- <linearitem itemname="wlanButton"/>
- </layout>
- </widget>
- <widget name="listWidget" type="HbListWidget">
- <real name="z" value="4"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="23.28358un" type="PREFERRED" width="49.55224un"/>
- <sizehint height="1.6un" type="MINIMUM" width="0un"/>
- <sizehint height="2504062.01158un" type="MAXIMUM" width="2504062.01158un"/>
- <fontspec name="fontSpec" role="Primary" textpaneheight="26.8"/>
- </widget>
- <real name="z" value="0"/>
- <sizehint height="586" type="PREFERRED" width="355"/>
- <layout orientation="Vertical" spacing="0.89552un" type="linear">
- <linearitem itemname="subTitle"/>
- <linearitem itemname="statusContainer"/>
- <linearitem itemname="listWidget"/>
- </layout>
- </widget>
- <real name="z" value="0"/>
- <string name="windowTitle" value="Test"/>
- <layout type="anchor">
- <anchoritem dst="container" dstEdge="LEFT" spacing="-0.14925un" src="" srcEdge="LEFT"/>
- <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
- </layout>
- </widget>
- <widget name="viewMenu" role="HbView:menu" type="HbMenu">
- <string name="title" value=""/>
- <ref object="addWlanAction" role="HbMenu:addAction"/>
- <ref object="switchWlanAction" role="HbMenu:addAction"/>
- <ref object="settingsAction" role="HbMenu:addAction"/>
- <ref object="hideAction" role="HbMenu:addAction"/>
- </widget>
- <string name="title" value="View"/>
- </widget>
- <section name="portrait">
- <widget name="container" type="HbWidget">
- <sizehint height="586" type="PREFERRED" width="355"/>
- </widget>
- </section>
- <section name="landscape">
- <widget name="container" type="HbWidget">
- <sizehint height="308" type="PREFERRED" width="638"/>
- </widget>
- </section>
- <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- <uistate name="portrait" sections="#common portrait"/>
- <uistate name="landscape" sections="#common landscape"/>
- </metadata>
-</hbdocument>
--- 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 <bldvariant.hrh>
-
-#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
--- 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 <bldvariant.hrh>
-#include <data_caging_paths_for_iby.hrh>
-
-#ifdef __PROTOCOL_WLAN
-
-data=DATAZ_/QT_TRANSLATIONS_DIR/wlansniffer.qm QT_TRANSLATIONS_DIR/wlansniffer.qm
-
-#endif // __PROTOCOL_WLAN
-
-#endif // WLANSNIFFER_RESOURCES_IBY
--- 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
--- 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 <QTranslator>
-#include <QLocale>
-
-#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 );
-}
--- 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 <QGraphicsWidget>
-
-#include <HbLabel>
-#include <HbMenu>
-#include <HbAction>
-#include <HbListWidget>
-#include <HbListWidgetItem>
-#include <HbDocumentLoader>
-#include <HbInstance>
-
-#include <xqserviceutil.h>
-
-#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<HbMenu *>(loader.findWidget("viewMenu"));
- Q_ASSERT_X(viewMenu != 0, "Wlan Sniffer", "Menu not found");
- setMenu(viewMenu);
-
- mWlanList = qobject_cast<HbListWidget *>(loader.findWidget("listWidget"));
- Q_ASSERT_X(mWlanList != 0, "Wlan Sniffer", "List not found");
-
- mStatusLabel = qobject_cast<HbLabel *>(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<WlanQtUtilsWlanAp*> aps;
- QList<WlanQtUtilsWlanIap*> 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<int>()) {
- // 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>());
- WlanQtUtilsWlanAp ap = data.value<WlanQtUtilsWlanAp>();
- 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<int>() && 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<int>());
- 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
--- 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 <xqserviceutil.h>
-
-#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 );
-}
--- 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 );
-}
--- 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 <opensystemtrace.h>
-#endif
--- 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 <QObject>
-#include <QStringList>
-#include <e32base.h>
-#include <wlanmgmtclient.h>
-
-// 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<TWlanProtectedSetupCredentialAttribute>* iIapParametersArray;
-#else
- //Temporary for testing in WINSCW.
- RTimer iTimer;
- void RunProtectedSetup_Stub();
-#endif
- };
-
-#endif /* CWPSACTIVERUNNER_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<e32base.h>
-#include<wlanmgmtcommon.h>
-
-// 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_ */
--- 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 <qobject.h>
-#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_ */
--- 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 <qobject.h>
-#include <qhash.h>
-#include <qmap.h>
-#include <wlanmgmtcommon.h>
-#include <qtranslator.h>
-
-// 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<TWlanProtectedSetupCredentialAttribute>& aCredentials);
- QList<TWlanProtectedSetupCredentialAttribute> 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<TWlanProtectedSetupCredentialAttribute> mIapList;
- int mBearerType;
- int mReferenceId;
- int mRandomNumber;
- };
-
-#endif /* WPSWIZARD_P_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_ */
--- 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 <QObject>
-
-// 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_ */
--- 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 <QObject>
-#include<e32base.h>
-
-// 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<TWlanProtectedSetupCredentialAttribute>& 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_ */
--- 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 <QObject>
-
-// 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_ */
--- 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 <QObject>
-
-// 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_ */
--- 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 <QObject>
-
-// 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_ */
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
- <widget name="occ_wps_P1" type="HbWidget">
- <widget name="radioButtonList" type="HbRadioButtonList">
- <container name="items" type="stringlist">
- <string locid="txt_occ_list_use_pushbutton" value="Use Push-Button"/>
- <string locid="txt_occ_list_use_pin_code" value="Use Pin Code"/>
- <string locid="txt_occ_list_configure_manually" value="Configure manually"/>
- </container>
- <sizehint height="50un" type="PREFERRED"/>
- </widget>
- <widget name="label_heading" type="HbLabel">
- <enums name="textWrapping" value="TextWordWrap"/>
- <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
- <string locid="txt_occ_dialog_selected_network_supports_wifi_pro" name="plainText" value="Selected network supports Wifi Protected Setup for receving settings automatically"/>
- </widget>
- <real name="z" value="1"/>
- <rect height="401.99999" name="geometry" width="308.99997" x="26" y="85"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="60un" type="PREFERRED" width="46.1194un"/>
- <layout orientation="Vertical" type="linear">
- <linearitem itemname="label_heading"/>
- <linearitem itemname="radioButtonList"/>
- <stretchitem stretchfactor="1"/>
- </layout>
- </widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- </metadata>
-</hbdocument>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
- <widget name="occ_wps_P2" type="HbWidget">
- <widget name="label_heading" type="HbLabel">
- <enums name="textWrapping" value="TextWordWrap"/>
- <string locid="txt_occ_dialog_first_press_button_on_the_wireless" name="plainText" value="First, press button on the wireless station to initiate the setup process, then select 'Next'"/>
- </widget>
- <real name="z" value="1"/>
- <rect height="350.00002" name="geometry" width="302.99999" x="28.50001" y="144.99999"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="52.23881un" type="PREFERRED" width="45.22388un"/>
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="1.34328un" left="2un" right="1.34328un" top="1.34328un"/>
- <linearitem itemname="label_heading"/>
- </layout>
- </widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- </metadata>
-</hbdocument>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
- <widget name="occ_wps_P3" type="HbWidget">
- <widget name="label_heading" type="HbLabel">
- <enums name="textWrapping" value="TextWordWrap"/>
- <string locid="txt_occ_dialog_enter_1_on_the_wireless_station_t" name="plainText" value="Enter '%L1' on wireless station then select 'Continue'."/>
- </widget>
- <real name="z" value="1"/>
- <rect height="361.00001" name="geometry" width="318.00001" x="20.99999" y="139.5"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="53.8806un" type="PREFERRED" width="47.46269un"/>
- <layout orientation="Vertical" type="linear">
- <linearitem itemname="label_heading"/>
- </layout>
- </widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- </metadata>
-</hbdocument>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
- <widget name="occ_wps_P4" type="HbWidget">
- <widget name="label_heading" type="HbLabel">
- <string locid="txt_occ_dialog_negotiating" name="plainText" value="Negotiating"/>
- </widget>
- <widget name="horizontalProgressBar" type="HbProgressBar">
- <integer name="progressValue" value="30"/>
- <integer name="minimum" value="0"/>
- <enums name="orientation" value="Horizontal"/>
- <integer name="maximum" value="100"/>
- </widget>
- <real name="z" value="1"/>
- <rect height="260.99997" name="geometry" width="302.00001" x="28.99999" y="189.50002"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="38.95522un" type="PREFERRED" width="45.07463un"/>
- <sizehint height="90.8806un" type="MAXIMUM"/>
- <layout orientation="Vertical" type="linear">
- <linearitem itemname="label_heading"/>
- <linearitem itemname="horizontalProgressBar"/>
- </layout>
- </widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- </metadata>
-</hbdocument>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
- <widget name="occ_wps_P5" type="HbWidget">
- <widget name="label_heading" type="HbLabel">
- <enums name="textWrapping" value="TextWordWrap"/>
- <string locid="txt_occ_dialog_settings_received_for_multiple_wlan" name="plainText" value="Settings received for '%1' network"/>
- </widget>
- <widget name="radioButtonList" type="HbRadioButtonList">
- <container name="items" type="stringlist">
- <string value="WLAN1"/>
- <string value="WLAN2"/>
- <string value="WLAN3"/>
- </container>
- </widget>
- <real name="z" value="1"/>
- <rect height="337.99998" name="geometry" width="291.00002" x="31" y="155"/>
- <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
- <sizehint height="50.44776un" type="PREFERRED" width="43.43284un"/>
- <layout orientation="Vertical" type="linear">
- <linearitem itemname="label_heading"/>
- <linearitem itemname="radioButtonList"/>
- </layout>
- </widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- </metadata>
-</hbdocument>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
- <widget name="container_1" type="HbWidget">
- <widget name="label_1" type="HbLabel">
- <string locid="txt_occ_title_wlan_setup_wizard_summary" name="plainText" value="WLAN setup wizard, summary"/>
- </widget>
- <widget name="label" type="HbLabel">
- <string locid="txt_occ_dblist_network_name" name="plainText" value="Network name"/>
- </widget>
- <widget name="label_2" type="HbLabel">
- <string name="plainText" value="Bh1MRT"/>
- </widget>
- <widget name="label_3" type="HbLabel">
- <string locid="txt_occ_dblist_network_mode" name="plainText" value="Network mode"/>
- </widget>
- <widget name="label_4" type="HbLabel">
- <string locid="txt_occ_dblist_network_mode_val_infrastructure_hi" name="plainText" value="Infrastructure (hidden)"/>
- </widget>
- <widget name="label_5" type="HbLabel">
- <string locid="txt_occ_dblist_security_mode" name="plainText" value="Security mode"/>
- </widget>
- <widget name="label_6" type="HbLabel">
- <string locid="txt_occ_dblist_security_mode_val_wpawpa2psk" name="plainText" value="WPA with password"/>
- </widget>
- <widget name="label_7" type="HbLabel">
- <string locid="txt_occ_dblist_destination" name="plainText"/>
- </widget>
- <widget name="label_8" type="HbLabel">
- <string locid="txt_occ_dblist_destination_val_internet" name="plainText" value="Internet"/>
- </widget>
- <real name="z" value="1"/>
- <rect height="535.99998" name="geometry" width="279" x="40.5" y="52.00001"/>
- <sizehint height="80un" type="PREFERRED" width="41.64179un"/>
- <layout orientation="Vertical" type="linear">
- <linearitem itemname="label_1"/>
- <linearitem itemname="label"/>
- <linearitem itemname="label_2"/>
- <linearitem itemname="label_3"/>
- <linearitem itemname="label_4"/>
- <linearitem itemname="label_5"/>
- <linearitem itemname="label_6"/>
- <linearitem itemname="label_7"/>
- <linearitem itemname="label_8"/>
- </layout>
- </widget>
- <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
- <uistate name="Common ui state" sections="#common"/>
- </metadata>
-</hbdocument>
--- 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 @@
-<RCC>
- <qresource prefix="/docml" >
- <file>occ_wps_P1.docml</file>
- <file>occ_wps_P2.docml</file>
- <file>occ_wps_P3.docml</file>
- <file>occ_wps_P4.docml</file>
- <file>occ_wps_P5.docml</file>
- <file>occ_wps_P6.docml</file>
- </qresource>
- <qresource prefix="/icon" />
- <qresource prefix="/loc" >
- <file>wpswizardplugin.qm</file>
- </qresource>
-</RCC>
Binary file wlanutilities/wpswizard/resources/wpswizardplugin.qm has changed
--- 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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="3.0" language="en_GB" sourcelanguage="en_GB">
-<context>
-<message numerus="no" id="txt_occ_list_configure_manually">
- <comment></comment>
- <source>Configure manually</source>
- <translation variants="no">Configure manually</translation>
- <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_01</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_occ_list_use_pin_code">
- <comment></comment>
- <source>Use PIN code</source>
- <translation variants="no">Use PIN code</translation>
- <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_01</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_occ_dialog_first_press_button_on_the_wireless">
- <comment></comment>
- <source>First, press button on the wireless station to initiate the setup process, then select ‘Next’.</source>
- <translation variants="no">First, press button on the wireless station to initiate the setup process, then select ‘Next’.</translation>
- <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_02</extra-loc-viewid>
- <extra-loc-positionid>dialog</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_occ_dialog_settings_received_for_multiple_wlan">
- <comment></comment>
- <source>Settings received for multiple WLAN networks. Select the network to use:</source>
- <translation variants="no">Settings received for multiple WLAN networks. Select the network to use:</translation>
- <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_05</extra-loc-viewid>
- <extra-loc-positionid>dialog</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_occ_dialog_enter_1_on_the_wireless_station_t">
- <comment></comment>
- <source>Enter ‘%1 on the wireless station then select ‘Next’.</source>
- <translation variants="no">Enter ‘%1 on the wireless station then select ‘Next’.</translation>
- <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_03</extra-loc-viewid>
- <extra-loc-positionid>dialog</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_occ_dialog_selected_network_supports_wifi_pro">
- <comment></comment>
- <source>Selected network supports Wi-Fi Protected Setupâ„¢ for receiving settings automatically.</source>
- <translation variants="no">Selected network supports Wi-Fi Protected Setupâ„¢ for receiving settings automatically.</translation>
- <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_01</extra-loc-viewid>
- <extra-loc-positionid>dialog</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_occ_dialog_negotiating">
- <comment></comment>
- <source>Negotiating</source>
- <translation variants="no">Negotiating</translation>
- <extra-loc-layout_id>qtl_dialog_pri3</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_04</extra-loc-viewid>
- <extra-loc-positionid>dialog</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_occ_list_use_pushbutton">
- <comment></comment>
- <source>Use push-button</source>
- <translation variants="no">Use push-button</translation>
- <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>
- <extra-loc-viewid>occ_wps_01</extra-loc-viewid>
- <extra-loc-positionid>list</extra-loc-positionid>
- <extra-loc-feature>oc</extra-loc-feature>
- <extra-loc-blank>False</extra-loc-blank>
-</message>
-</context>
-</TS>
--- 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 <bldvariant.hrh>
-
-//#ifdef __PROTOCOL_WLAN
-
-file=ABI_DIR\BUILD_DIR\wpswizard.dll SHARED_LIB_DIR\wpswizard.dll
-
-//#endif // __PROTOCOL_WLAN
-
-#endif // WPSWIZARD_IBY
--- 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<TWlanProtectedSetupCredentialAttribute> credentials;
-
- if (completionCode < KErrNone) {
- //Raise Error
- iObserver.WpsActiveRunnerStopped(credentials, completionCode);
- }
- else {
-#ifdef __arm
- TInt len = iIapParametersArray->Length();
- TInt count;
- for(count=0;count<iIapParametersArray->Count();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<TWlanProtectedSetupCredentialAttribute> credentials;
-#ifdef __arm
- if(iWLANMgmtClient)
- iWLANMgmtClient->CancelProtectedSetup();
-#else
- iTimer.Cancel();
-#endif
-
- iObserver.WpsActiveRunnerStopped(credentials, aError);
-}
-
-#ifndef __arm
-void CWpsActiveRunner::RunProtectedSetup_Stub()
-{
- QList<TWlanProtectedSetupCredentialAttribute> 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
--- 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 <hbdocumentloader.h>
-#include <qgraphicswidget>
-#include <hbmainwindow.h>
-#include <hbview.h>
-#include <hbstackedwidget.h>
-#include <hblabel.h>
-#include <hbaction.h>
-#include <qapplication.h>
-
-// 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;
- }
--- 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 <hbwidget.h>
-
-// 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;
-}
--- 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 <hbdocumentloader.h>
-#include <qgraphicswidget>
-#include <hbmainwindow.h>
-#include <hbview.h>
-#include <hbstackedwidget.h>
-#include <hblabel.h>
-#include <hbaction.h>
-#include <qapplication.h>
-
-// 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<TWlanProtectedSetupCredentialAttribute>& 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<TWlanProtectedSetupCredentialAttribute> 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;
-
- }
--- 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 <hbdocumentloader.h>
-#include <hbwidget.h>
-#include <hbradiobuttonlist.h>
-#include <hblineedit.h>
-#include <hblabel.h>
-
-// 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<HbWidget*> (loader.findWidget("occ_wps_P5"));
- Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found");
-
- //mTitle = qobject_cast<HbLabel*> (loader.findWidget("label_title"));
- //Q_ASSERT_X(mTitle != 0, "WPS wizard", "title not found");
-
- mHeading = qobject_cast<HbLabel*> (loader.findWidget("label_heading"));
- Q_ASSERT_X(mTitle != 0, "WPS wizard", "Header not found");
-
- mRadio = qobject_cast<HbRadioButtonList*> (loader.findWidget("radioButtonList"));
- Q_ASSERT_X(mRadio != 0, "WPS Wizard", "List not found");
-
- QList<TWlanProtectedSetupCredentialAttribute> 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)
-}
-
--- 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 <hbdocumentloader.h>
-#include <hbwidget.h>
-#include <hbradiobuttonlist.h>
-#include <hblineedit.h>
-#include <hblabel.h>
-#include <hbprogressbar.h>
-#include <hbmessagebox.h>
-
-// 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<HbWidget*> (loader.findWidget("occ_wps_P4"));
- Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found");
-
- //mTitle = qobject_cast<HbLabel*> (loader.findWidget("label_title"));
- //Q_ASSERT_X(mTitle != 0, "WPS wizard", "title not found");
-
- mHeading = qobject_cast<HbLabel*> (loader.findWidget("label_heading"));
- Q_ASSERT_X(mTitle != 0, "WPS wizard", "Header not found");
-
- mProgressBar = qobject_cast<HbProgressBar*> (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<TWlanProtectedSetupCredentialAttribute>& 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<const TText*> (ssid.constData()));
-
- RBuf8 ssidName;
- ssidName.Create(ptrName.Length());
- ssidName.Copy(ptrName);
-
- mWpsActiveRunner->StartSetup(ssidName, mWizard->getPin());
- ssidName.Close();
-OstTraceFunctionExit1(WPSPAGESTEPFOUR_STARTWPSRUNNER_EXIT, this)
-}
--- 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 <hbdocumentloader.h>
-#include <hbwidget.h>
-#include <hbradiobuttonlist.h>
-#include <hblineedit.h>
-#include <hblabel.h>
-
-// 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<HbWidget*> (loader.findWidget("occ_wps_P2"));
- Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found");
-
- //mTitle = qobject_cast<HbLabel*> (loader.findWidget("label_title"));
- //Q_ASSERT_X(mTitle != 0, "WPS wizard", "title not found");
-
- mHeading = qobject_cast<HbLabel*> (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;
-}
-
--- 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 <hbdocumentloader.h>
-#include <hbwidget.h>
-#include <hbradiobuttonlist.h>
-#include <hblineedit.h>
-#include <hblabel.h>
-#include <QTextStream>
-#include <QTime>
-
-// 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<HbWidget*> (loader.findWidget("occ_wps_P3"));
- Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found");
-
- mHeading = qobject_cast<HbLabel*> (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;
-}
-
--- 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 <hbdocumentloader.h>
-#include <hbwidget.h>
-#include <hbradiobuttonlist.h>
-#include <hblineedit.h>
-#include <hblabel.h>
-
-// 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<HbWidget*> (loader.findWidget("occ_wps_P1"));
- Q_ASSERT_X(mWidget != 0, "WPS Wizard", "View not found");
-
- mHeading
- = qobject_cast<HbLabel*> (loader.findWidget("label_heading"));
- Q_ASSERT_X(mTitle != 0, "WPS wizard", "Header not found");
-
- mRadio = qobject_cast<HbRadioButtonList*> (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)
-
- }
-
--- 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 <opensystemtrace.h>
-#endif
--- 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
-}