|
1 /* |
|
2 * Copyright (c) 2002-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: Notification service for clients |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 13 % |
|
20 */ |
|
21 |
|
22 #ifndef WLMNOTIFY_H |
|
23 #define WLMNOTIFY_H |
|
24 |
|
25 #include "wlmclientserver.h" |
|
26 #include "wlancontrolinterface.h" |
|
27 |
|
28 class RWLMServer; |
|
29 |
|
30 /** |
|
31 * MWLMNotify specifies a callback interface for notification services. |
|
32 * These virtual methods should be implemented by the client if it |
|
33 * needs any notifications. |
|
34 * @lib wlmserver.lib |
|
35 * @since 3.0 |
|
36 */ |
|
37 class MWLMNotify |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Connection status has changed. |
|
42 * |
|
43 * @aParam aNewState specifies the new state |
|
44 */ |
|
45 virtual void ConnectionStateChanged( |
|
46 TWlanConnectionState /*aNewState*/ ){}; |
|
47 |
|
48 /** |
|
49 * BSSID has changed (i.e. AP handover). |
|
50 * |
|
51 * @aParam aNewBSSID specifies the new BSSID (access point name). |
|
52 */ |
|
53 virtual void BSSIDChanged( |
|
54 TDesC8& /*aNewBSSID*/ ){}; |
|
55 |
|
56 /** |
|
57 * Connection has lost. |
|
58 */ |
|
59 virtual void BSSLost(){}; |
|
60 |
|
61 /** |
|
62 * Connection has regained. |
|
63 */ |
|
64 virtual void BSSRegained(){}; |
|
65 |
|
66 /** |
|
67 * New networks have been detected during scan. |
|
68 */ |
|
69 virtual void NewNetworksDetected(){}; |
|
70 |
|
71 /** |
|
72 * One or more networks have been lost since the last scan. |
|
73 */ |
|
74 virtual void OldNetworksLost(){}; |
|
75 |
|
76 /** |
|
77 * The used transmit power has been changed. |
|
78 * |
|
79 * @param aPower The transmit power in mW. |
|
80 */ |
|
81 virtual void TransmitPowerChanged( |
|
82 TUint /*aPower*/ ){}; |
|
83 |
|
84 /** |
|
85 * Received signal strength has changed to another strength class. |
|
86 * |
|
87 * @param aRcpLevel specifies the rss class (normal/weak) |
|
88 * @param aRcpValue specifies the actual rcp value |
|
89 */ |
|
90 virtual void RcpChanged( |
|
91 TWlanRCPLevel /*aRcpLevel*/, |
|
92 TUint /*aRcpValue*/ ){}; |
|
93 |
|
94 /** |
|
95 * Information about the current access point after a connect/roam. |
|
96 * |
|
97 * @param aInfo Information about the current access point. |
|
98 */ |
|
99 virtual void AccessPointInfoChanged( |
|
100 const TWlanAccessPointInfo& /* aInfo */ ){}; |
|
101 |
|
102 /** |
|
103 * The status of a virtual traffic stream has changed. |
|
104 * |
|
105 * @param aStreamId ID of the traffic stream. |
|
106 * @param aStreamStatus Status of the traffic stream. |
|
107 */ |
|
108 virtual void TrafficStreamStatusChanged( |
|
109 TUint /* aStreamId */, |
|
110 TWlanTrafficStreamStatus /* aStreamStatus */ ) {}; |
|
111 |
|
112 /** |
|
113 * The traffic mode of an access class has changed. |
|
114 * |
|
115 * @param aAccessClass Access class. |
|
116 * @param aMode Traffic mode of the access class. |
|
117 */ |
|
118 virtual void AccessClassTrafficModeChanged( |
|
119 TWlmAccessClass /* aAccessClass */, |
|
120 TWlmAcTrafficMode /* aMode */ ){}; |
|
121 |
|
122 /** |
|
123 * The traffic status of an access class has changed. |
|
124 * |
|
125 * @param aAccessClass Access class. |
|
126 * @param aStatus Traffic status of the access class. |
|
127 */ |
|
128 virtual void AccessClassTrafficStatusChanged( |
|
129 TWlmAccessClass /* aAccessClass */, |
|
130 TWlmAcTrafficStatus /* aStatus */ ){}; |
|
131 |
|
132 }; |
|
133 |
|
134 /** |
|
135 * CWLMNotify offers the notification service. |
|
136 * Active object that waits notifications from server. |
|
137 * @lib wlmserver.lib |
|
138 * @since 3.0 |
|
139 */ |
|
140 NONSHARABLE_CLASS( CWLMNotify ) : public CActive |
|
141 { |
|
142 public: // Methods |
|
143 |
|
144 // Constructors and destructor |
|
145 |
|
146 /** |
|
147 * Destructor. |
|
148 */ |
|
149 virtual ~CWLMNotify(); |
|
150 |
|
151 /** |
|
152 * Create and activate notification service. |
|
153 * @note This activates the notification service already. |
|
154 * @param aCallback Callback interface to forward notifications to |
|
155 * user process. |
|
156 * @param aServer Interface to send requests to server. |
|
157 * @param aNotificationMask Bitmask of notifications to activate. |
|
158 * @return Pointer to a new constructed CWLMNotify object. |
|
159 */ |
|
160 static CWLMNotify* NewL( |
|
161 MWLMNotify& aCallback, |
|
162 RWLMServer& aServer, |
|
163 TUint32 aNotificationMask ); |
|
164 |
|
165 /** |
|
166 * Change the callback interface |
|
167 * and activate notifications |
|
168 * @param aCallback New callback interface. |
|
169 * @param aNotificationMask Bitmask of notifications to activate. |
|
170 */ |
|
171 void Activate( |
|
172 MWLMNotify& aCallback, |
|
173 TUint32 aNotificationMask ); |
|
174 |
|
175 /** |
|
176 * Sets the requests cancelled flag so that no new notification requests |
|
177 * are done once current notification is complete. |
|
178 */ |
|
179 void SetCancelled(); |
|
180 |
|
181 protected: // from CActive |
|
182 /** |
|
183 * (From CActive) Receive notification. |
|
184 */ |
|
185 void RunL(); |
|
186 |
|
187 /** |
|
188 * (From CActive) This is called by Cancel() of CActive framework. |
|
189 */ |
|
190 void DoCancel(); |
|
191 |
|
192 private: |
|
193 /** |
|
194 * Constructor. |
|
195 * @param aCallback Callback interface to forward notifications to |
|
196 * application. |
|
197 * @param aServer Interface to send requests to server. |
|
198 * @param aNotificationMask Bitmask of notifications to activate. |
|
199 */ |
|
200 CWLMNotify( |
|
201 MWLMNotify& aCallback, |
|
202 RWLMServer& aServer, |
|
203 TUint32 aNotificationMask ); |
|
204 |
|
205 /** |
|
206 * Second phase construction. |
|
207 */ |
|
208 void ConstructL(); |
|
209 |
|
210 /** |
|
211 * Notification query loop. |
|
212 */ |
|
213 void WaitForNotifications(); |
|
214 |
|
215 private: // Members. |
|
216 /** |
|
217 * Callback interface to the client. Not owned by this class. |
|
218 */ |
|
219 MWLMNotify* iCallback; |
|
220 /** |
|
221 * Interface to send messages to the server |
|
222 */ |
|
223 RWLMServer& iServer; |
|
224 /** |
|
225 * Data package for return data |
|
226 */ |
|
227 TPckgBuf<TWlmNotifyData> iDataPckg; |
|
228 /** |
|
229 * Cancel has been requested |
|
230 */ |
|
231 TBool iCancelRequested; |
|
232 /** |
|
233 * Bitmask of active notifications. |
|
234 */ |
|
235 TUint32 iNotificationMask; |
|
236 }; |
|
237 |
|
238 #endif // WLMNOTIFY_H |