1 /* |
|
2 * Copyright (c) 2001-2009 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 the License "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: CWiFiProtSyncClient class. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: tr1cfwln#6 % |
|
20 */ |
|
21 |
|
22 #ifndef C_WIFIPROTSYNCCLIENT_H |
|
23 #define C_WIFIPROTSYNCCLIENT_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 |
|
28 #include "wifiprotsession.h" |
|
29 |
|
30 /** |
|
31 * CWiFiProtSyncClient |
|
32 * Active object to convert a sychronous client call asynchronous, and |
|
33 * return only when the request is completed |
|
34 */ |
|
35 class CWiFiProtSyncClient : public CActive |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Two phased constructor |
|
40 * @param aClient RWiFiProtSession class to handle communication with |
|
41 * Notifier Framework |
|
42 * @param aPriority Active object priority |
|
43 **/ |
|
44 static CWiFiProtSyncClient* NewL( RWiFiProtSession& aClient, |
|
45 TInt aPriority = CActive::EPriorityStandard ); |
|
46 /** |
|
47 * Destructor |
|
48 **/ |
|
49 ~CWiFiProtSyncClient(); |
|
50 |
|
51 /** |
|
52 * Starts WiFi Protected Setup sequence |
|
53 * @param aSSid contains SSid of the network we want to configure |
|
54 * @param aConnectionNeeded ETrue if we need a connection via the |
|
55 * configured network |
|
56 * @param aUidsReturned uids of the configured connection methods |
|
57 * @return possible return values are ok, cancel process and not use |
|
58 * protected setup (No Automatic Setup). |
|
59 */ |
|
60 WiFiProt::TWiFiReturn StartWiFiProtL( const TWlanSsid& aSSid, |
|
61 TBool aConnectionNeeded, |
|
62 RArray<TUint32>& aUidsReturned |
|
63 ); |
|
64 |
|
65 private: |
|
66 // Each Notifier Framework call has a corresponding enum, |
|
67 // and CWiFiProtSyncClient uses it to keep track of the |
|
68 // currently active call |
|
69 // The only one is ERunWiFiProt at the moment |
|
70 enum TWiFiState |
|
71 { |
|
72 ENoState = 0, |
|
73 // StartWiFiProtL was called |
|
74 ERunWiFiProt |
|
75 }; |
|
76 |
|
77 private: |
|
78 /** |
|
79 * Constructor |
|
80 * @param aClient RWiFiProtSession class to handle communication |
|
81 * with Notifier Framework |
|
82 * @param aPriority Active object priority |
|
83 **/ |
|
84 CWiFiProtSyncClient( RWiFiProtSession& aClient, TInt aPriority ); |
|
85 |
|
86 /** |
|
87 * Second phase constructor |
|
88 **/ |
|
89 void ConstructL(); |
|
90 |
|
91 /** |
|
92 * Calls CActive::SetActive() and sets TWiFiState also |
|
93 * @param aState identifier of the active call |
|
94 **/ |
|
95 void SetActive( TWiFiState aState ); |
|
96 |
|
97 /** From CActive */ |
|
98 |
|
99 /** |
|
100 * @see CActive::DoCancel |
|
101 **/ |
|
102 virtual void DoCancel(); |
|
103 |
|
104 /** |
|
105 * @see CActive::RunL |
|
106 **/ |
|
107 virtual void RunL(); |
|
108 |
|
109 private: |
|
110 // RWiFiProtSession class to handle communication with Notifier |
|
111 // Framework |
|
112 RWiFiProtSession& iClient; |
|
113 // identifier of the active call |
|
114 CWiFiProtSyncClient::TWiFiState iState; |
|
115 // Active Scheduler Waiter class to halt the process until the |
|
116 // call is completed |
|
117 CActiveSchedulerWait iWait; |
|
118 }; |
|
119 |
|
120 |
|
121 #endif //C_WIFIPROTSYNCCLIENT_H |
|
122 |
|
123 // End of File |
|