|
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 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: Class for storing roaming metrics. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CORE_ROAM_METRICS_H |
|
20 #define CORE_ROAM_METRICS_H |
|
21 |
|
22 #include "core_types.h" |
|
23 |
|
24 /** |
|
25 * Class for storing traffic stream parameters. |
|
26 * |
|
27 * @lib wlmserversrv.dll |
|
28 * @since S60 v3.2 |
|
29 */ |
|
30 NONSHARABLE_CLASS( core_roam_metrics_c ) |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Constructor. |
|
37 */ |
|
38 core_roam_metrics_c(); |
|
39 |
|
40 /** |
|
41 * Destructor. |
|
42 */ |
|
43 ~core_roam_metrics_c(); |
|
44 |
|
45 /** |
|
46 * Set all the metrics to initial values. |
|
47 * |
|
48 * @since S60 v3.2 |
|
49 */ |
|
50 void clear_metrics(); |
|
51 |
|
52 /** |
|
53 * Return the timestamp when user data was disabled. |
|
54 */ |
|
55 u64_t roam_ts_userdata_disabled() const; |
|
56 |
|
57 /** |
|
58 * Update the timestamp when user data was disabled. |
|
59 * |
|
60 * @since S60 v3.2 |
|
61 */ |
|
62 void set_roam_ts_userdata_disabled(); |
|
63 |
|
64 /** |
|
65 * Return the timestamp when user data was enabled. |
|
66 */ |
|
67 u64_t roam_ts_userdata_enabled() const; |
|
68 |
|
69 /** |
|
70 * Update the timestamp when user data was enabled. |
|
71 * |
|
72 * @since S60 v3.2 |
|
73 */ |
|
74 void set_roam_ts_userdata_enabled(); |
|
75 |
|
76 /** |
|
77 * Return the timestamp when connect request to drivers was issued. |
|
78 */ |
|
79 u64_t roam_ts_connect_started() const; |
|
80 |
|
81 /** |
|
82 * Update the timestamp when connect request to drivers was issued. |
|
83 * |
|
84 * @since S60 v3.2 |
|
85 */ |
|
86 void set_roam_ts_connect_started(); |
|
87 |
|
88 /** |
|
89 * Return the timestamp when connect request to drivers was completed. |
|
90 */ |
|
91 u64_t roam_ts_connect_completed() const; |
|
92 |
|
93 /** |
|
94 * Update the timestamp when connect request to drivers was completed. |
|
95 * |
|
96 * @since S60 v3.2 |
|
97 */ |
|
98 void set_roam_ts_connect_completed(); |
|
99 |
|
100 /** |
|
101 * Get the amount of microseconds user data was disabled during last roam. |
|
102 * |
|
103 * @since S60 v3.2 |
|
104 * @return The amount of microseconds user data was disabled during last roam. |
|
105 */ |
|
106 u32_t roam_total_delay() const; |
|
107 |
|
108 /** |
|
109 * Get the amount of microseconds taken to connect the network. |
|
110 * |
|
111 * @since S60 v3.2 |
|
112 * @return The amount of microseconds taken to connect the network. |
|
113 */ |
|
114 u32_t roam_connect_delay() const; |
|
115 |
|
116 /** |
|
117 * Get the total number of successful roams. |
|
118 * |
|
119 * @since S60 v3.2 |
|
120 * @return The total number of successful roams. |
|
121 */ |
|
122 u16_t roam_success_count() const; |
|
123 |
|
124 /** |
|
125 * Increase the total number of successful roams. |
|
126 * |
|
127 * @since S60 v3.2 |
|
128 * @param count Parameter to be set. |
|
129 */ |
|
130 void inc_roam_success_count(); |
|
131 |
|
132 /** |
|
133 * Get the amount of roam attempts. |
|
134 * |
|
135 * @since S60 v3.2 |
|
136 * @param reason Type of count to return. |
|
137 * @return The amount of roam attempts. |
|
138 */ |
|
139 u16_t roam_attempt_count( |
|
140 core_roam_reason_e reason ) const; |
|
141 |
|
142 /** |
|
143 * Increase the amount of roam attempts. |
|
144 * |
|
145 * @since S60 v3.2 |
|
146 * @param reason Type of count to increase. |
|
147 */ |
|
148 void inc_roam_attempt_count( |
|
149 core_roam_reason_e reason ); |
|
150 |
|
151 /** |
|
152 * Return the amount of failed roam attempts. |
|
153 * |
|
154 * @since S60 v3.2 |
|
155 * @param reason Type of count to return. |
|
156 * @return The amount of failed roam attempts. |
|
157 */ |
|
158 u16_t roam_attempt_failed_count( |
|
159 core_roam_failed_reason_e reason ) const; |
|
160 |
|
161 /** |
|
162 * Increase the amount of roam failed attempts. |
|
163 * |
|
164 * @since S60 v3.2 |
|
165 * @param reason Type of count to increase. |
|
166 */ |
|
167 void inc_roam_attempt_failed_count( |
|
168 core_roam_failed_reason_e reason ); |
|
169 |
|
170 /** |
|
171 * Get the reason for the last roam. |
|
172 * |
|
173 * @since S60 v3.2 |
|
174 * @return The reason for the last roam. |
|
175 */ |
|
176 core_roam_reason_e last_roam_reason() const; |
|
177 |
|
178 /** |
|
179 * Set the reason for the last roam. |
|
180 * |
|
181 * @since S60 v3.2 |
|
182 * @param reason The reason for the last roam. |
|
183 */ |
|
184 void set_last_roam_reason( |
|
185 core_roam_reason_e reason ); |
|
186 |
|
187 /** |
|
188 * Get the reason for the last roam failure. |
|
189 * |
|
190 * @since S60 v3.2 |
|
191 * @return The reason for the last roam failure. |
|
192 */ |
|
193 core_roam_failed_reason_e last_roam_failed_reason() const; |
|
194 |
|
195 /** |
|
196 * Set the reason for the last roam failure. |
|
197 * |
|
198 * @since S60 v3.2 |
|
199 * @param reason The reason for the last roam failure. |
|
200 */ |
|
201 void set_last_roam_failed_reason( |
|
202 core_roam_failed_reason_e reason ); |
|
203 |
|
204 /** |
|
205 * Trace the current roam metrics. |
|
206 * |
|
207 * @since S60 v3.2 |
|
208 */ |
|
209 void trace_current_roam_metrics() const; |
|
210 |
|
211 private: |
|
212 |
|
213 /** |
|
214 * Assignment operator. |
|
215 */ |
|
216 core_roam_metrics_c& operator=( |
|
217 const core_roam_metrics_c& src ); |
|
218 |
|
219 private: // data |
|
220 |
|
221 /** The timestamp when userdata was disabled. */ |
|
222 u64_t roam_ts_userdata_disabled_m; |
|
223 |
|
224 /** The timestamp when userdata was enabled. */ |
|
225 u64_t roam_ts_userdata_enabled_m; |
|
226 |
|
227 /** The timestamp when connect request to drivers was issued. */ |
|
228 u64_t roam_ts_connect_start_m; |
|
229 |
|
230 /** The timestamp when connect request to drivers was completed. */ |
|
231 u64_t roam_ts_connect_completed_m; |
|
232 |
|
233 /** The total number of successful roams. */ |
|
234 u16_t roam_success_count_m; |
|
235 |
|
236 /** The amount of roam attempts. */ |
|
237 u16_t roam_attempt_count_m[core_roam_reason_max]; |
|
238 |
|
239 /** The amount of failed roam attempts. */ |
|
240 u16_t roam_attempt_failed_count_m[core_roam_failed_reason_max]; |
|
241 |
|
242 }; |
|
243 |
|
244 #endif // CORE_ROAM_METRICS_H |