39
|
1 |
/*
|
53
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* WPS Wizard Page: Step 4 progress bar display
|
|
16 |
*/
|
39
|
17 |
|
|
18 |
//System Includes
|
|
19 |
|
|
20 |
//User Includes
|
|
21 |
#include "wpswizard.h"
|
|
22 |
#include "wpswizardstepfour_p.h"
|
|
23 |
#include "cwpsactiverunner.h"
|
|
24 |
|
|
25 |
// Trace includes
|
|
26 |
|
|
27 |
#include "OstTraceDefinitions.h"
|
|
28 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
29 |
#include "wpswizardstepfour_pTraces.h"
|
|
30 |
#endif
|
|
31 |
|
|
32 |
// External function prototypes
|
|
33 |
|
|
34 |
// Local constants
|
|
35 |
|
|
36 |
|
|
37 |
/*!
|
|
38 |
\class WpsPageStepFourPrivate
|
|
39 |
\brief Private implementation of wps wizard page for step four.
|
|
40 |
*/
|
|
41 |
// ======== LOCAL FUNCTIONS ========
|
|
42 |
|
|
43 |
// ======== MEMBER FUNCTIONS ========
|
|
44 |
|
|
45 |
/*!
|
|
46 |
Constructor for WPS page four
|
|
47 |
|
|
48 |
@param [in] WpsPageStepFour* Pointer to the public/Ui class
|
|
49 |
*/
|
|
50 |
|
|
51 |
WpsPageStepFourPrivate::WpsPageStepFourPrivate(WpsPageStepFour* pageStepFour) :
|
|
52 |
mWpsActiveRunner(NULL),
|
|
53 |
q_ptr(pageStepFour)
|
|
54 |
{
|
53
|
55 |
OstTraceFunctionEntry1(WPSPAGESTEPFOURPRIVATE_WPSPAGESTEPFOURPRIVATE_ENTRY, this);
|
|
56 |
|
39
|
57 |
// start the framework.
|
|
58 |
CWpsActiveRunner* runner = NULL;
|
|
59 |
QT_TRAP_THROWING(runner = CWpsActiveRunner::NewL(*this));
|
|
60 |
mWpsActiveRunner.reset(runner);
|
|
61 |
|
53
|
62 |
OstTraceFunctionExit1(WPSPAGESTEPFOURPRIVATE_WPSPAGESTEPFOURPRIVATE_EXIT, this);
|
39
|
63 |
}
|
|
64 |
|
|
65 |
/*!
|
|
66 |
Destructor
|
|
67 |
*/
|
|
68 |
WpsPageStepFourPrivate::~WpsPageStepFourPrivate()
|
|
69 |
{
|
53
|
70 |
OstTraceFunctionEntry1(DUP1_WPSPAGESTEPFOURPRIVATE_WPSPAGESTEPFOURPRIVATE_ENTRY, this);
|
|
71 |
OstTraceFunctionExit1(DUP1_WPSPAGESTEPFOURPRIVATE_WPSPAGESTEPFOURPRIVATE_EXIT, this);
|
39
|
72 |
}
|
|
73 |
|
|
74 |
/*!
|
|
75 |
This method will initiate the WPS setup functionality.
|
|
76 |
|
|
77 |
@param [in] ssid name of the network which supports wps
|
|
78 |
@param [in] pin pin number to be used for WPS negotiating.
|
|
79 |
*/
|
|
80 |
void WpsPageStepFourPrivate::StartSetup(QString ssid, int pin)
|
|
81 |
{
|
53
|
82 |
OstTraceFunctionEntry1(WPSPAGESTEPFOURPRIVATE_STARTSETUP_ENTRY, this);
|
|
83 |
|
39
|
84 |
TPtrC ptrName(reinterpret_cast<const TText*> (ssid.constData()));
|
|
85 |
|
|
86 |
RBuf8 ssidName;
|
53
|
87 |
QT_TRAP_THROWING(ssidName.CreateL(ptrName.Length()));
|
39
|
88 |
ssidName.Copy(ptrName);
|
|
89 |
|
|
90 |
mWpsActiveRunner->StartSetup(ssidName, pin);
|
|
91 |
ssidName.Close();
|
53
|
92 |
|
|
93 |
OstTraceFunctionExit1(WPSPAGESTEPFOURPRIVATE_STARTSETUP_EXIT, this);
|
39
|
94 |
}
|
|
95 |
|
|
96 |
/*!
|
|
97 |
CallBack informing the completion of the WPS setup.
|
|
98 |
|
|
99 |
@param [in] aCredentials An array of credentials from the remote AP
|
|
100 |
@param [in] aError integer variable indicating result of the operation
|
|
101 |
*/
|
|
102 |
void WpsPageStepFourPrivate::WpsActiveRunnerStopped(
|
|
103 |
QList<TWlanProtectedSetupCredentialAttribute>& aCredentials,
|
|
104 |
TInt aError)
|
|
105 |
{
|
53
|
106 |
OstTraceFunctionEntry1(WPSPAGESTEPFOURPRIVATE_WPSACTIVERUNNERSTOPPED_ENTRY, this);
|
39
|
107 |
|
|
108 |
// mWpsErrorCode = aError;
|
|
109 |
if (aError == KErrNone) {
|
|
110 |
q_ptr->setCredentials(aCredentials, aCredentials.count());
|
53
|
111 |
} else if (aError == KErrCancel) {
|
39
|
112 |
// operation was cancelled
|
53
|
113 |
} else {
|
39
|
114 |
OstTrace1(
|
|
115 |
TRACE_ERROR,
|
|
116 |
WPSPAGESTEPFOURPRIVATE_WPSACTIVERUNNERSTOPPED_ERROR,
|
|
117 |
"WpsPageStepFourPrivate::WpsActiveRunnerStopped;Error=%d",
|
53
|
118 |
aError);
|
39
|
119 |
|
|
120 |
q_ptr->handleError(aError);
|
53
|
121 |
}
|
|
122 |
|
|
123 |
OstTraceFunctionExit1(WPSPAGESTEPFOURPRIVATE_WPSACTIVERUNNERSTOPPED_EXIT, this);
|
39
|
124 |
}
|
|
125 |
|
|
126 |
/*!
|
|
127 |
To cancel the ongoing WPS setup implementation.
|
|
128 |
*/
|
|
129 |
void WpsPageStepFourPrivate::Cancel()
|
|
130 |
{
|
53
|
131 |
OstTraceFunctionEntry1(WPSPAGESTEPFOURPRIVATE_CANCEL_ENTRY, this);
|
|
132 |
|
39
|
133 |
mWpsActiveRunner->DoCancel();
|
53
|
134 |
|
|
135 |
OstTraceFunctionExit1(WPSPAGESTEPFOURPRIVATE_CANCEL_EXIT, this);
|
39
|
136 |
}
|
|
137 |
|