|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Definition of the WLAN signal level handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef VCCWLANSIGNALLEVELHANDLER_H |
|
21 #define VCCWLANSIGNALLEVELHANDLER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <wlanmgmtcommon.h> |
|
25 |
|
26 #include "vccsignallevelhandler.h" |
|
27 #include "vccsignallevelobserver.h" |
|
28 |
|
29 class CWlanMgmtClient; |
|
30 class CVccEngPsProperty; |
|
31 |
|
32 /** |
|
33 * WLAN signal level observer |
|
34 * |
|
35 * |
|
36 * @code |
|
37 * |
|
38 * TSignalLevelParams params = { 8e6, 8e6, 80, 40 }; |
|
39 * |
|
40 * CMyClass::ConstructL() |
|
41 * { |
|
42 * iSignalLevelHandler = CVccWlanSignalLevelHandler::NewL( *this, params ); |
|
43 * iSignalLevelHandler->StartL(); |
|
44 * } |
|
45 * |
|
46 * CMyClass::StopMonitoring() |
|
47 * { |
|
48 * iSignalLevelHandler->Stop(); |
|
49 * } |
|
50 * |
|
51 * CMyClass::SetNewParametersAndStartL() |
|
52 * { |
|
53 * TSignalLevelParams params = { 8e6, 10e6, 80, 20 }; |
|
54 * |
|
55 * iSignalLevelHandler->SetParams( params ); |
|
56 * |
|
57 * // Start using new parameters |
|
58 * iSignalLevelHandler->StartL(); |
|
59 * } |
|
60 * |
|
61 * CMyClass::~CMyClass() |
|
62 * { |
|
63 * delete iSignalLevelHandler; |
|
64 * } |
|
65 * |
|
66 * |
|
67 * CMyClass::WlanSignalChanged( |
|
68 * TInt32 aRss, |
|
69 * TSignalRssClass aRssClass ) |
|
70 * { |
|
71 * // Signal level changed. Must do something |
|
72 * if ( aRssClass == ESignalClassWeak ) |
|
73 * { |
|
74 * // Do handover if the signal is very weak |
|
75 * if ( aRss > EReallyBadSignalLevel ) |
|
76 * { |
|
77 * } |
|
78 * } |
|
79 * } |
|
80 * |
|
81 * |
|
82 * |
|
83 * @endcode |
|
84 * |
|
85 * @lib vcchotrigger.dll |
|
86 * @since S60 v3.2 |
|
87 */ |
|
88 class CVccWlanSignalLevelHandler : public CVccSignalLevelHandler, |
|
89 public MWlanMgmtNotifications |
|
90 { |
|
91 public: |
|
92 |
|
93 |
|
94 /** |
|
95 * Two-phased constructor. |
|
96 * @param aObserver Observer which will be notified upon signal changes. |
|
97 * @param aParams Parameters for the timer and signal levels. |
|
98 */ |
|
99 static CVccWlanSignalLevelHandler * NewL( |
|
100 MVccSignalLevelObserver& aObserver, |
|
101 const TSignalLevelParams& aParams, CVccEngPsProperty& aPsProperty ); |
|
102 /** |
|
103 * Two-phased constructor. |
|
104 * @param aObserver Observer which will be notified upon signal changes. |
|
105 * @param aParams Parameters for the timer and signal levels. |
|
106 */ |
|
107 static CVccWlanSignalLevelHandler* NewLC( |
|
108 MVccSignalLevelObserver& aObserver, |
|
109 const TSignalLevelParams& aParams, CVccEngPsProperty& aPsProperty ); |
|
110 |
|
111 /** |
|
112 * Destructor. |
|
113 */ |
|
114 virtual ~CVccWlanSignalLevelHandler(); |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * Symbian second-phase constructor |
|
120 * |
|
121 * @since S60 3.2 |
|
122 */ |
|
123 void ConstructL(); |
|
124 |
|
125 /** |
|
126 * C++ constructor |
|
127 * |
|
128 * @since S60 3.2 |
|
129 * @param aObserver Observer which will be notified upon signal changes. |
|
130 * @param aParams Parameters for the timer and signal levels. |
|
131 */ |
|
132 CVccWlanSignalLevelHandler( MVccSignalLevelObserver& aObserver, |
|
133 const TSignalLevelParams& aParams, CVccEngPsProperty& aPsProperty); |
|
134 |
|
135 // from base class CVccSignalLevelHandler |
|
136 |
|
137 /** |
|
138 * @see CVccSignalLevelHandler::GetStrength() |
|
139 */ |
|
140 void GetStrength(); |
|
141 |
|
142 /** |
|
143 * @see CVccSignalLevelHandler::EnableNotificationsL() |
|
144 */ |
|
145 void EnableNotificationsL(); |
|
146 |
|
147 /** |
|
148 * @see CVccSignalLevelHandler::DisableNotifications() |
|
149 */ |
|
150 void DisableNotifications(); |
|
151 |
|
152 /** |
|
153 * @see CVccSignalLevelHandler::CancelGetStrength() |
|
154 */ |
|
155 void CancelGetStrength(); |
|
156 |
|
157 /** |
|
158 * @see CVccSignalLevelHandler::NotifyChanges() |
|
159 */ |
|
160 void NotifyChanges( TInt32 aSignalStrength, |
|
161 MVccSignalLevelObserver::TSignalStrengthClass aClass ); |
|
162 |
|
163 |
|
164 // from base class MWlanMgmtNotifications |
|
165 |
|
166 /** |
|
167 * @see MWlanMgmtNotifications::RssChanged() |
|
168 */ |
|
169 void RssChanged( TWlanRssClass aRssClass, TUint aRss ); |
|
170 |
|
171 /** |
|
172 * @see MWlanMgmtNotifications::BssidChanged() |
|
173 */ |
|
174 void BssidChanged( TWlanBssid& aNewBSSID ); |
|
175 |
|
176 /** |
|
177 * @see MWlanMgmtNotifications::OldNetworksLost() |
|
178 */ |
|
179 void OldNetworksLost(); |
|
180 |
|
181 private: // data |
|
182 |
|
183 /** |
|
184 * WLAN management client. |
|
185 * Own. |
|
186 */ |
|
187 CWlanMgmtClient* iWlanMgmt; |
|
188 |
|
189 /** |
|
190 * for informing the states |
|
191 */ |
|
192 CVccEngPsProperty& iVccPsp; |
|
193 }; |
|
194 |
|
195 #endif // VCCWLANSIGNALLEVELHANDLER_H |
|
196 |