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