|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Implementation of HotSpot Server API |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HSSINTERFACE_H |
|
20 #define HSSINTERFACE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "hssmgmtcommon.h" |
|
24 #include "hssiapsettings.h" |
|
25 #include "hssiaphandler.h" |
|
26 #include "hssscanhandler.h" |
|
27 #include "hssscanlist.h" |
|
28 #include "hsssrvnotifications.h" |
|
29 |
|
30 class MHssSrvNotifications; |
|
31 class CHssSrvNotifications; |
|
32 |
|
33 NONSHARABLE_CLASS( RHssInterface ) : public RSessionBase |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Client makes the connection to the server. |
|
39 * @return General Symbian error code. |
|
40 */ |
|
41 IMPORT_C TInt Connect(); |
|
42 |
|
43 /** |
|
44 * Version information. |
|
45 * @return Version information. |
|
46 */ |
|
47 TVersion Version() const; |
|
48 |
|
49 /** |
|
50 * Close the connection; release the handle to the server. |
|
51 */ |
|
52 IMPORT_C void Close(); |
|
53 |
|
54 /** |
|
55 * Set a message to pend notification. |
|
56 * @param aReturnValue Status of the calling active object. |
|
57 * @param aReturnData (OUT) Data returned by the notification. |
|
58 */ |
|
59 void WaitForNotification( TRequestStatus& aReturnValue, |
|
60 TDes8& aReturnData ); |
|
61 |
|
62 /** |
|
63 * Cancel pending notification message from server. |
|
64 * CHssSrvNotifications class uses this method to cancel pending message at server |
|
65 * side. |
|
66 */ |
|
67 void CancelWaitForNotification(); |
|
68 |
|
69 /** |
|
70 * Activate the notification service. |
|
71 * |
|
72 * After the client has enabled the notification service, it can |
|
73 * receive asynchronous notifications from the server. |
|
74 * @param aCallback The class that implements the callback interface. |
|
75 */ |
|
76 IMPORT_C void ActivateNotificationsL( MHssSrvNotifications& aCallback ); |
|
77 |
|
78 /** |
|
79 * Cancel the notification service. |
|
80 */ |
|
81 IMPORT_C void CancelNotifications(); |
|
82 |
|
83 /** |
|
84 * Perform a scan and return the detected WLAN networks. |
|
85 * @param aResults Results of the scan. |
|
86 * @return KErrNone if successful, otherwise one of the system-wide |
|
87 * error codes. |
|
88 */ |
|
89 IMPORT_C TInt GetScanResults( HssScanList& aResults ); |
|
90 |
|
91 /** |
|
92 * Create and Protect IAP, register HotSpot Client. |
|
93 * @param aUid, UID of the client. |
|
94 * @param aIapName, Name of the iap to be created. |
|
95 * @param aWaitnote, TRUE or FALSE indication of external prowserplugin need. |
|
96 * @return On successful completion returns IAP ID, otherwise return value is 0. |
|
97 */ |
|
98 IMPORT_C TUint Register( const TUid aUid, |
|
99 const TDesC& aIapName, |
|
100 const TUint aWaitnote ); |
|
101 |
|
102 /** |
|
103 * Delete IAP and unregister HotSpot Client. |
|
104 * @param IapID, ID of the IAP to be unregistered. |
|
105 * @param Uid, UID of the client. |
|
106 * @return KErrNone if successful |
|
107 */ |
|
108 IMPORT_C TInt UnRegister( const TUint aIapId, |
|
109 const TUint aNetworkId, |
|
110 const TUid aUid ); |
|
111 |
|
112 /** |
|
113 * Change IAP settings. |
|
114 * @param aIapId, ID of the IAP. |
|
115 * @param aSettings, Complete IAP settings struct |
|
116 * @return KErrNone if successful |
|
117 */ |
|
118 IMPORT_C TInt ChangeSettings( const TUint aIapId, |
|
119 const THssIapSettings& aSettings); |
|
120 |
|
121 /** |
|
122 * Associate IAP with network. |
|
123 * @param aIapId, ID of the IAP. |
|
124 * @return KErrNone if successful |
|
125 */ |
|
126 IMPORT_C TInt Join( const TUint aIapId ); |
|
127 |
|
128 /** |
|
129 * Cancel start call. |
|
130 * @param aIapId, ID of the IAP. |
|
131 * @return KErrNone if successful |
|
132 */ |
|
133 IMPORT_C TInt CancelStart( const TUint aIapId ); |
|
134 |
|
135 /** |
|
136 * Stop associating IAP. |
|
137 * @param aIapId, ID of the IAP. |
|
138 * @return KErrNone if successful |
|
139 */ |
|
140 IMPORT_C TInt Stop( const TUint aIapId ); |
|
141 |
|
142 /** |
|
143 * End connection. |
|
144 * @param aIapId, ID of the IAP. |
|
145 * @param aStatus, Status of the calling active object. |
|
146 * @return KErrNone, if successful; otherwise one of the other system-wide error codes. |
|
147 */ |
|
148 IMPORT_C TInt LoginComplete( const TUint aIapId, TInt aStatus ); |
|
149 |
|
150 /** |
|
151 * End connection. |
|
152 * @param aIapID, ID of the IAP. |
|
153 * @return KErrNone if successful |
|
154 */ |
|
155 IMPORT_C TInt LogoutComplete( const TUint aIapId ); |
|
156 |
|
157 /** |
|
158 * StartLogin for NIFMAN Configuration Daemon. |
|
159 * @param aIapId, ID of the IAP. |
|
160 * @param aNetworkId, ID of the network. |
|
161 * @param aStatus, Status of the calling active object. |
|
162 */ |
|
163 IMPORT_C void StartLogin ( const TUint aIapId, |
|
164 const TUint aNetworkId, |
|
165 TRequestStatus& aStatus ); |
|
166 |
|
167 /** |
|
168 * CancelLogin for DHCP Configuration Daemon. |
|
169 * @return KErrNone if successful |
|
170 */ |
|
171 IMPORT_C TInt CancelLogin (); |
|
172 |
|
173 /** |
|
174 * Start for WLAN agent. |
|
175 * @param aIapId, ID of the IAP. |
|
176 * @param aStatus, Status of the calling active object. |
|
177 */ |
|
178 IMPORT_C void Start( const TUint aIapId, TRequestStatus& aStatus ); |
|
179 |
|
180 /** |
|
181 * Start again for WLAN agent. |
|
182 * @param aIapID, ID of the IAP. |
|
183 * @param aStatus, Status of the calling active object. |
|
184 */ |
|
185 IMPORT_C void StartAgain( const TUint aIapId, TRequestStatus& aStatus ); |
|
186 |
|
187 /** |
|
188 * Close connection for WLAN agent. |
|
189 * @param aIapID, ID of the IAP. |
|
190 * @param aStatus, Status of the calling active object. |
|
191 */ |
|
192 IMPORT_C void CloseConnection( const TUint aIapId, TRequestStatus& aStatus ); |
|
193 |
|
194 /** |
|
195 * Check status of BackgroundScan. |
|
196 * @return 0 if off, otherwice number as scan interval. |
|
197 */ |
|
198 IMPORT_C TUint32 CheckBackgroundScanL(); |
|
199 |
|
200 /** |
|
201 * Cancel for WLAN agent. |
|
202 * @param aIapId, ID of the IAP. |
|
203 */ |
|
204 IMPORT_C void Cancel( const TUint aIapId ); |
|
205 |
|
206 /** |
|
207 * Shutdown server when uninstalling .sis -file. |
|
208 */ |
|
209 IMPORT_C TInt ShutdownServerL(); |
|
210 |
|
211 /** |
|
212 * Set UI state of HotSpot browser logon application. |
|
213 * @param aIapId, ID of the IAP. |
|
214 * @param aState, value of THsBrowserUiStates. |
|
215 */ |
|
216 IMPORT_C void SetUiState( const TUint aIapId, const TUint aState ); |
|
217 |
|
218 /** |
|
219 * Get ID of the IAP . |
|
220 * @return IAP ID. |
|
221 */ |
|
222 inline TUint IapId(); |
|
223 IMPORT_C TUint32 GetIap(TIpcArgs aArgs); |
|
224 |
|
225 /** |
|
226 * Starts HotSpot browser for browser based authentication. |
|
227 * @param aStatus, Status of the calling active object. |
|
228 */ |
|
229 IMPORT_C void StartBrowser( const TDesC& aString, |
|
230 const TUint aIapId, |
|
231 const TUint aNetId, |
|
232 TRequestStatus& aStatus ); |
|
233 |
|
234 /** |
|
235 * Get the BSSID of the currently connected AP. |
|
236 * @param aBssId, MAC address of a connection |
|
237 * @return KErrNone if successful, |
|
238 * otherwise one of the other system-wide error codes. |
|
239 */ |
|
240 IMPORT_C TInt GetConnectionBssid( THssBssid& aBssId ); |
|
241 |
|
242 /** |
|
243 * Add an SSID list to the given IAP. |
|
244 * @param aIapId, IAP ID given. |
|
245 * @param aSsidList, SSID list to add to the IAP. |
|
246 * @return KErrNone if successful, |
|
247 * otherwise one of the other system-wide error codes. |
|
248 */ |
|
249 IMPORT_C TInt AddIapSsidList( |
|
250 TUint aIapId, |
|
251 const CArrayFixFlat<THssSsid>& aSsidList ); |
|
252 |
|
253 /** |
|
254 * Set login and logout timer values of this client. |
|
255 * If given values aren't suitable, the default values are set. |
|
256 * @param aClientUid, Client's UID: clients may have own timer values, |
|
257 * @param aLoginTimerValue, login timer value, |
|
258 * @param aLogoutTimerValue, logout timer value. |
|
259 * @return KErrNone if successful, |
|
260 * otherwise one of the other system-wide error codes. |
|
261 */ |
|
262 IMPORT_C TInt SetTimerValues ( |
|
263 TUid aClientUid, |
|
264 TUint aLoginTimerValue, |
|
265 TUint aLogoutTimerValue ); |
|
266 |
|
267 /** |
|
268 * Gets all Iaps of client |
|
269 * @param aUId, UID of client |
|
270 * @param aIapIdArray, Array for client's Iaps |
|
271 * @return None |
|
272 */ |
|
273 IMPORT_C void GetClientIapsL( const TUid aUid, RArray<TUint>& aIapIdArray ); |
|
274 |
|
275 protected: // Methods |
|
276 |
|
277 /** |
|
278 * Start the server during Connect() if the server is not loaded. |
|
279 * @return KErrNone if successful otherwise another of the system wide error codes. |
|
280 */ |
|
281 TInt StartServer(); |
|
282 |
|
283 /** |
|
284 * Server startup continues. |
|
285 * @return KErrNone if successful otherwise another of the system wide error codes. |
|
286 */ |
|
287 TInt CreateServerProcess(); |
|
288 |
|
289 private: // Methods |
|
290 |
|
291 /** |
|
292 * Stops active connection |
|
293 * @param aIapId, ID of the IAP. |
|
294 * @param aNetworkId, ID of the network. |
|
295 * @return KErrNone if successful otherwise another of the system wide error codes. |
|
296 */ |
|
297 TInt StopConnectionL( const TUint aIapId, const TUint aNetworkId ); |
|
298 |
|
299 private: // Data |
|
300 |
|
301 /** |
|
302 * Callback interface to HSS management. |
|
303 */ |
|
304 CHssSrvNotifications* iNotify; |
|
305 |
|
306 /** |
|
307 * ID of the IAP. |
|
308 */ |
|
309 TUint iIapId; |
|
310 |
|
311 /** |
|
312 * Handler for changing IAP settings |
|
313 */ |
|
314 CHssIapHandler* iIapHandler; |
|
315 |
|
316 /** |
|
317 * Handler for changing IAP settings |
|
318 */ |
|
319 CHssScanHandler* iScanHandler; |
|
320 |
|
321 /** |
|
322 * Parameter array type |
|
323 */ |
|
324 TIpcArgs iArgs; |
|
325 }; |
|
326 |
|
327 #endif // HSSINTERFACE_H |
|
328 |
|
329 // End of File |