|
1 /* |
|
2 * Copyright (c) 2006-2006 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 encapsulating core engine settings and statuses. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CORE_SETTINGS_H |
|
20 #define CORE_SETTINGS_H |
|
21 |
|
22 #include "core_types.h" |
|
23 #include "core_type_list.h" |
|
24 #include "core_roam_metrics.h" |
|
25 |
|
26 /** |
|
27 * Class encapsulating core engine settings and statuses. |
|
28 * |
|
29 * @since S60 v3.1 |
|
30 */ |
|
31 NONSHARABLE_CLASS( core_settings_c ) |
|
32 { |
|
33 |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Constructor. |
|
38 * |
|
39 * @param features Bitmask of enabled features. |
|
40 */ |
|
41 core_settings_c( |
|
42 u32_t features ); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 virtual ~core_settings_c(); |
|
48 |
|
49 /** |
|
50 * Check whether the WLAN drivers have been loaded. |
|
51 * |
|
52 * @since S60 v3.1 |
|
53 * @return true_t if the WLAN drivers have been loaded, |
|
54 * false_t otherwise. |
|
55 */ |
|
56 bool_t is_driver_loaded() const; |
|
57 |
|
58 /** |
|
59 * Set the state of the WLAN drivers. |
|
60 * |
|
61 * @since S60 v3.1 |
|
62 * @param is_driver_loaded true_t the WLAN drivers have been loaded, |
|
63 * false_t otherwise. |
|
64 */ |
|
65 void set_driver_state( |
|
66 bool_t is_driver_loaded ); |
|
67 |
|
68 /** |
|
69 * Check whether WLAN is enabled or disabled. |
|
70 * |
|
71 * @since S60 v3.1 |
|
72 * @return true_t if enabled, |
|
73 * false_t otherwise. |
|
74 */ |
|
75 bool_t is_wlan_enabled() const; |
|
76 |
|
77 /** |
|
78 * Set WLAN state enabled or disabled. |
|
79 * |
|
80 * @since S60 v3.1 |
|
81 * @param is_wlan_enabled true_t if enabling WLAN, |
|
82 * false_t otherwise. |
|
83 */ |
|
84 void set_wlan_enabled( |
|
85 bool_t is_wlan_enabled ); |
|
86 |
|
87 /** |
|
88 * Get the currently used power mode. |
|
89 * |
|
90 * @since S60 v3.1 |
|
91 * @return Currently used power mode. |
|
92 */ |
|
93 const core_power_mode_s& power_mode() const; |
|
94 |
|
95 /** |
|
96 * Set the currently used power mode. |
|
97 * |
|
98 * @since S60 v3.1 |
|
99 * @param Currently used power mode. |
|
100 */ |
|
101 void set_power_mode( |
|
102 const core_power_mode_s& mode ); |
|
103 |
|
104 /** |
|
105 * Get the preferred power save mode. |
|
106 * |
|
107 * @since S60 v3.1 |
|
108 * @return Preferred power save mode. |
|
109 */ |
|
110 const core_power_save_mode_s& preferred_power_save_mode() const; |
|
111 |
|
112 /** |
|
113 * Set the preferred power save mode. |
|
114 * |
|
115 * @since S60 v3.1 |
|
116 * @param Preferred power save mode. |
|
117 */ |
|
118 void set_preferred_power_save_mode( |
|
119 const core_power_save_mode_s& mode ); |
|
120 |
|
121 /** |
|
122 * Get current connection state. |
|
123 * |
|
124 * @since S60 v3.1 |
|
125 * @return connection state. |
|
126 */ |
|
127 core_connection_state_e connection_state() const; |
|
128 |
|
129 /** |
|
130 * Set current connection state. |
|
131 * |
|
132 * @since S60 v3.1 |
|
133 * @param connection state. |
|
134 */ |
|
135 void set_connection_state( |
|
136 core_connection_state_e state ); |
|
137 |
|
138 /** |
|
139 * Returns true/false based on connection state information |
|
140 * |
|
141 * @since S60 v3.1 |
|
142 * @return true or false |
|
143 */ |
|
144 bool_t is_connected() const; |
|
145 |
|
146 /** |
|
147 * Check whether the permanent whitelist is empty. |
|
148 * |
|
149 * @since S60 v3.1 |
|
150 * @return Whether the permanent whitelist is empty. |
|
151 */ |
|
152 bool_t is_permanent_whitelist_empty() const; |
|
153 |
|
154 /** |
|
155 * Check whether the given MAC address is permanently whitelisted. |
|
156 * |
|
157 * @since S60 v3.1 |
|
158 * @param mac MAC address to be checked. |
|
159 * @return Whether the given MAC address is permanently whitelisted. |
|
160 */ |
|
161 bool_t is_mac_in_permanent_whitelist( |
|
162 const core_mac_address_s& mac ); |
|
163 |
|
164 /** |
|
165 * Check whether the given MAC address is permanently blacklisted. |
|
166 * |
|
167 * @since S60 v3.1 |
|
168 * @param mac MAC address to be checked. |
|
169 * @return Whether the given MAC address is permanently blacklisted. |
|
170 */ |
|
171 bool_t is_mac_in_permanent_blacklist( |
|
172 const core_mac_address_s& mac ); |
|
173 |
|
174 /** |
|
175 * Add a MAC address to the permanent whitelist. |
|
176 * |
|
177 * @since S60 v3.1 |
|
178 * @param mac MAC address to be added. |
|
179 */ |
|
180 void add_mac_to_permanent_whitelist( |
|
181 const core_mac_address_s& mac ); |
|
182 |
|
183 /** |
|
184 * Remove a MAC address from the permanent whitelist. |
|
185 * |
|
186 * @since S60 v3.1 |
|
187 * @param mac MAC address to be removed. |
|
188 */ |
|
189 void remove_mac_from_permanent_whitelist( |
|
190 const core_mac_address_s& mac ); |
|
191 |
|
192 /** |
|
193 * Add a MAC address to the permanent blacklist. |
|
194 * |
|
195 * @since S60 v3.1 |
|
196 * @param mac MAC address to be added. |
|
197 * @param reason Reason for the blacklist. |
|
198 */ |
|
199 void add_mac_to_permanent_blacklist( |
|
200 const core_mac_address_s& mac, |
|
201 core_ap_blacklist_reason_e reason ); |
|
202 |
|
203 /** |
|
204 * Remove a MAC address from the permanent blacklist. |
|
205 * |
|
206 * @since S60 v3.1 |
|
207 * @param mac MAC address to be removed. |
|
208 */ |
|
209 void remove_mac_from_permanent_blacklist( |
|
210 const core_mac_address_s& mac ); |
|
211 |
|
212 /** |
|
213 * Return the permanent blacklist. |
|
214 * |
|
215 * @since S60 v3.2 |
|
216 * @return The permanent blacklist. |
|
217 */ |
|
218 core_type_list_c<core_ap_blacklist_entry_s>& permanent_blacklist(); |
|
219 |
|
220 /** |
|
221 * Set RCPI notification boundaries |
|
222 * |
|
223 * @since S60 v3.1 |
|
224 * @param rcp_decline_boundary Threshold for 'signal getting worse'. |
|
225 * @param rcp_improve_boundary Threshold for 'signal getting better'. |
|
226 */ |
|
227 void set_rcpi_boundaries( |
|
228 u32_t rcp_decline_boundary, |
|
229 u32_t rcp_improve_boundary ); |
|
230 |
|
231 /** |
|
232 * Get the RCPI threshold for 'signal getting worse' indication. |
|
233 * |
|
234 * @since S60 v3.1 |
|
235 * @return The RCPI threshold for 'signal getting worse' indication. |
|
236 */ |
|
237 u32_t rcp_decline_boundary() const; |
|
238 |
|
239 /** |
|
240 * Get the RCPI threshold for 'signal getting better' indication. |
|
241 * |
|
242 * @since S60 v3.1 |
|
243 * @return The RCPI threshold for 'signal getting better' indication. |
|
244 */ |
|
245 u32_t rcp_improve_boundary() const; |
|
246 |
|
247 /** |
|
248 * Get the currently used regional domain. |
|
249 * |
|
250 * @since S60 v3.1 |
|
251 * @return The currently used regional domain. |
|
252 */ |
|
253 core_wlan_region_e regional_domain() const; |
|
254 |
|
255 /** |
|
256 * Set the currently used regional domain. |
|
257 * |
|
258 * @since S60 v3.1 |
|
259 * @param region The currently used regional domain. |
|
260 */ |
|
261 void set_regional_domain( |
|
262 core_wlan_region_e region ); |
|
263 |
|
264 /** |
|
265 * Get the information whether mobile country code is currently known. |
|
266 * |
|
267 * @since S60 v5.0 |
|
268 * @return Whether or not the mobile country code is currently known. |
|
269 */ |
|
270 bool_t mcc_known() const; |
|
271 |
|
272 /** |
|
273 * Set the information whether or not the mobile country code is currently known. |
|
274 * |
|
275 * @since S60 v5.0 |
|
276 * @param mcc_known The information whether or not the mobile country code is currently known. |
|
277 */ |
|
278 void set_mcc_known( |
|
279 bool_t mcc_known ); |
|
280 |
|
281 |
|
282 /** |
|
283 * Check whether the given channel is valid in the current regional domain. |
|
284 * |
|
285 * @since S60 v3.1 |
|
286 * @param band The band the channel is in. |
|
287 * @param channel The channel to check. |
|
288 * @return Whether the given channel is valid in the current regional domain. |
|
289 */ |
|
290 bool_t is_valid_channel( |
|
291 u8_t band, |
|
292 u8_t channel ) const; |
|
293 |
|
294 /** |
|
295 * Return a channel mask with all of the allowed channels in the current regional domain. |
|
296 * |
|
297 * @since S60 v3.1 |
|
298 * @return All of the allowed channels in the current regional domain. |
|
299 */ |
|
300 core_scan_channels_s all_valid_scan_channels() const; |
|
301 |
|
302 /** |
|
303 * Return a channel mask with invalid channels filtered out. |
|
304 * |
|
305 * @since S60 v3.1 |
|
306 * @param channels Channel mask to be filtered. |
|
307 * @return A channel mask with invalid channels filtered out. |
|
308 */ |
|
309 core_scan_channels_s valid_scan_channels( |
|
310 const core_scan_channels_s& channels ); |
|
311 |
|
312 /** |
|
313 * Return a channel mask with valid channels filtered out. |
|
314 * |
|
315 * @since S60 v5.0 |
|
316 * @param channels Channel mask to be filtered. |
|
317 * @return A channel mask with valid channels filtered out. |
|
318 */ |
|
319 core_scan_channels_s invalid_scan_channels( |
|
320 const core_scan_channels_s& channels ); |
|
321 |
|
322 /** |
|
323 * Return whether a BT connection has been established. |
|
324 * |
|
325 * @since S60 v3.1 |
|
326 * @return Whether a BT connection has been established. |
|
327 */ |
|
328 bool_t is_bt_connection_established() const; |
|
329 |
|
330 /** |
|
331 * Set whether a BT connection has been established. |
|
332 * |
|
333 * @since S60 v3.1 |
|
334 * @param true_t if connection established, false_t otherwise. |
|
335 */ |
|
336 void set_bt_connection_established( |
|
337 bool_t established ); |
|
338 |
|
339 /** |
|
340 * Get packet statistics for the connection that is/was active. |
|
341 * |
|
342 * @since S60 v3.2 |
|
343 * @return Packet statistics for the connection that is/was active. |
|
344 */ |
|
345 const core_packet_statistics_by_access_category_s& connection_statistics_by_access_category(); |
|
346 |
|
347 /** |
|
348 * Get packet statistics for the connection that is/was active. |
|
349 * |
|
350 * @since S60 v3.2 |
|
351 * @return Packet statistics for the connection that is/was active. |
|
352 */ |
|
353 core_packet_statistics_s connection_statistics(); |
|
354 |
|
355 /** |
|
356 * Update packet statistics for the currently active connection. |
|
357 * |
|
358 * @since S60 v3.2 |
|
359 * @param statistics Packet statistics for the currently active connection. |
|
360 */ |
|
361 void update_connection_statistics( |
|
362 const core_packet_statistics_by_access_category_s& statistics ); |
|
363 |
|
364 /** |
|
365 * Clear the packet statistics. |
|
366 * |
|
367 * @since S60 v3.2 |
|
368 */ |
|
369 void clear_connection_statistics(); |
|
370 |
|
371 /** |
|
372 * Return the roam metrics for the currently active connection. |
|
373 * |
|
374 * @since S60 v3.2 |
|
375 * @return The roam metrics for the currently active connection. |
|
376 */ |
|
377 core_roam_metrics_c& roam_metrics(); |
|
378 |
|
379 /** |
|
380 * Get a list of channels that have APs with long beacon intervals. |
|
381 * |
|
382 * @since S60 v3.2 |
|
383 * @return List of channels that have APs with long beacon intervals. |
|
384 */ |
|
385 core_long_beacon_interval_channels_s& long_beacon_interval_channels(); |
|
386 |
|
387 /** |
|
388 * Get the U-APSD settings for access classes. |
|
389 * |
|
390 * @since S60 v3.2 |
|
391 * @return The U-APSD settings. |
|
392 */ |
|
393 const core_uapsd_settings_s& uapsd_settings(); |
|
394 |
|
395 /** |
|
396 * Check whether U-APSD is enable for the given access class |
|
397 * |
|
398 * @since S60 v3.2 |
|
399 * @param access_class Access class to check. |
|
400 * @return Whether U-APSD is enable for the given access class. |
|
401 */ |
|
402 bool_t is_uapsd_enable_for_access_class( |
|
403 core_access_class_e access_class ); |
|
404 |
|
405 /** |
|
406 * Set the U-APSD settings for access classes. |
|
407 * |
|
408 * @since S60 v3.2 |
|
409 * @param settings The U-APSD settings to be stored. |
|
410 */ |
|
411 void set_uapsd_settings( |
|
412 const core_uapsd_settings_s& settings ); |
|
413 |
|
414 /** |
|
415 * Get the power save settings for access classes. |
|
416 * |
|
417 * @since S60 v3.2 |
|
418 * @return The power save settings. |
|
419 */ |
|
420 const core_power_save_settings_s& power_save_settings(); |
|
421 |
|
422 /** |
|
423 * Set the power save settings for access classes. |
|
424 * |
|
425 * @since S60 v3.2 |
|
426 * @param settings The power save settings to be stored. |
|
427 */ |
|
428 void set_power_save_settings( |
|
429 const core_power_save_settings_s& settings ); |
|
430 |
|
431 /** |
|
432 * Get the block ACK usage information. |
|
433 * |
|
434 * @since S60 v5.1 |
|
435 * @return The block ACK usage information. |
|
436 */ |
|
437 const core_block_ack_usage_s& block_ack_usage(); |
|
438 |
|
439 /** |
|
440 * Set the block ACK usage per traffic stream. |
|
441 * |
|
442 * @since S60 v5.1 |
|
443 * @param usage The block ACK usage information to be stored. |
|
444 */ |
|
445 void set_block_ack_usage( |
|
446 const core_block_ack_usage_s& usage ); |
|
447 |
|
448 /** |
|
449 * Add a IAP ID to the weaklist. |
|
450 * |
|
451 * @since S60 v5.2 |
|
452 * @param iap_id IAP ID to be added. |
|
453 */ |
|
454 void add_iap_id_to_weak_iap_list(u32_t iap_id); |
|
455 |
|
456 /** |
|
457 * Check whether the given IAP ID is weaklisted. |
|
458 * |
|
459 * @since S60 v5.2 |
|
460 * @param iap_id IAP ID to be checked. |
|
461 * @return Whether the given IAP ID is weaklisted. |
|
462 */ |
|
463 bool_t is_iap_id_in_weak_list( u32_t iap_id ); |
|
464 |
|
465 /** |
|
466 * Remove a IAP ID from the weaklist. |
|
467 * |
|
468 * @since S60 v5.2 |
|
469 * @param iap_id IAP ID to be removed. |
|
470 */ |
|
471 void remove_iap_id_from_weak_list( u32_t iap_id ); |
|
472 |
|
473 /** |
|
474 * Check whether the given feature is enabled. |
|
475 * |
|
476 * @since S60 v5.2 |
|
477 * @param feature Feature flag to check. |
|
478 * @return true_t if the feature is enabled, false_t otherwise. |
|
479 */ |
|
480 bool_t is_feature_enabled( |
|
481 core_feature_e feature ) const; |
|
482 |
|
483 private: // data |
|
484 |
|
485 /** Defines whether wlan functionality is enabled or disabled */ |
|
486 bool_t is_wlan_enabled_m; |
|
487 |
|
488 /** Defines whether the drivers have been loaded. */ |
|
489 bool_t is_driver_loaded_m; |
|
490 |
|
491 /** Specifies the current connection state */ |
|
492 core_connection_state_e connection_state_m; |
|
493 |
|
494 /** Currently used power mode. */ |
|
495 core_power_mode_s power_mode_m; |
|
496 |
|
497 /** Preferred power save mode. */ |
|
498 core_power_save_mode_s preferred_power_save_m; |
|
499 |
|
500 /** Permanent white list of APs. */ |
|
501 core_type_list_c<core_mac_address_s> perm_whitelist_m; |
|
502 |
|
503 /** Permanent black list of APs. */ |
|
504 core_type_list_c<core_ap_blacklist_entry_s> perm_blacklist_m; |
|
505 |
|
506 /** Threshold for RCPI is getting worse notification. */ |
|
507 u32_t rcp_decline_boundary_m; |
|
508 |
|
509 /** Threshold for RCPI is getting better notification. */ |
|
510 u32_t rcp_improve_boundary_m; |
|
511 |
|
512 /** Defines the currently used regional domain. */ |
|
513 core_wlan_region_e region_m; |
|
514 |
|
515 /** Defines whether the mobile country code is known or not. */ |
|
516 bool_t mcc_known_m; |
|
517 |
|
518 /** Defines whether a BT connection has been established. */ |
|
519 bool_t is_bt_connection_established_m; |
|
520 |
|
521 /** Packet statistics for the connection that is/was active. */ |
|
522 core_packet_statistics_by_access_category_s current_statistics_m; |
|
523 |
|
524 /** Roam metrics for the connection that is/was active. */ |
|
525 core_roam_metrics_c roam_metrics_m; |
|
526 |
|
527 /** List of channels that have APs with long beacon intervals. */ |
|
528 core_long_beacon_interval_channels_s long_beacon_interval_channels_m; |
|
529 |
|
530 /** U-APSD settings for access classes. */ |
|
531 core_uapsd_settings_s uapsd_settings_m; |
|
532 |
|
533 /** Power save settings for access classes. */ |
|
534 core_power_save_settings_s power_save_settings_m; |
|
535 |
|
536 /** Block ACK usage per traffic stream. */ |
|
537 core_block_ack_usage_s block_ack_usage_m; |
|
538 |
|
539 |
|
540 /** List of IAP Ids whose rcpi values are weak */ |
|
541 core_type_list_c<u32_t> weak_iap_list_m; |
|
542 |
|
543 |
|
544 /** Bitmask of enabled features. */ |
|
545 u32_t features_m; |
|
546 |
|
547 }; |
|
548 |
|
549 #endif // CORE_SETTINGS_H |