|
1 /* |
|
2 * Copyright (c) 2005-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: Statemachine for handling BSS lost notification from drivers. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 11 % |
|
20 */ |
|
21 |
|
22 #ifndef CORE_OPERATION_HANDLE_BSS_LOST_H |
|
23 #define CORE_OPERATION_HANDLE_BSS_LOST_H |
|
24 |
|
25 #include "core_operation_base.h" |
|
26 #include "core_scan_channels.h" |
|
27 |
|
28 class abs_core_timer_c; |
|
29 |
|
30 /** |
|
31 * Statemachine for handling BSS lost notification from drivers. |
|
32 * |
|
33 * @lib wlmserversrv.lib |
|
34 * @since S60 v3.1 |
|
35 */ |
|
36 NONSHARABLE_CLASS( core_operation_handle_bss_lost_c ) : public core_operation_base_c |
|
37 { |
|
38 |
|
39 public: |
|
40 |
|
41 enum core_state_e |
|
42 { |
|
43 core_state_init = core_base_state_next, |
|
44 core_state_set_tx_level, |
|
45 core_state_set_tx_level_success, |
|
46 core_state_scan_start, |
|
47 core_state_scan_complete, |
|
48 core_state_connect_failure, |
|
49 core_state_connect_total_failure, |
|
50 core_state_connect_disconnect, |
|
51 core_state_connect_success, |
|
52 core_state_connect_set_rcpi_trigger, |
|
53 core_state_MAX |
|
54 }; |
|
55 |
|
56 /** |
|
57 * Defines the possible reasons for running the BSS lost operation. |
|
58 */ |
|
59 enum core_bss_lost_reason_e |
|
60 { |
|
61 /** The operation has been triggered by a BSS lost indication. */ |
|
62 core_bss_lost_reason_bss_lost, |
|
63 /** The operation has been triggered by a media disconnect indication. */ |
|
64 core_bss_lost_reason_media_disconnect, |
|
65 /** The operation has been triggered by a failed RCPI roaming attempt. */ |
|
66 core_bss_lost_reason_failed_rcpi_roam, |
|
67 /** The operation has been triggered by a failed reauthentication. */ |
|
68 core_bss_lost_reason_failed_reauthentication, |
|
69 /** The operation has been triggered by a failed directed roam attempt. */ |
|
70 core_bss_lost_reason_failed_directed_roam |
|
71 }; |
|
72 |
|
73 core_operation_handle_bss_lost_c( |
|
74 u32_t request_id, |
|
75 core_server_c* server, |
|
76 abs_core_driverif_c* drivers, |
|
77 abs_core_server_callback_c* adaptation, |
|
78 core_bss_lost_reason_e reason, |
|
79 u32_t reason_data = 0 ); |
|
80 |
|
81 virtual ~core_operation_handle_bss_lost_c(); |
|
82 |
|
83 protected: |
|
84 |
|
85 /** |
|
86 * This method is called when a pending request has been completed |
|
87 * and so sub-operations are pending. |
|
88 * |
|
89 * @since S60 v3.1 |
|
90 * @return status of the operation: |
|
91 * core_error_request_pending if the operation is not finished, |
|
92 * otherwise the status code of the finished operation |
|
93 */ |
|
94 core_error_e next_state(); |
|
95 |
|
96 /** |
|
97 * This method is called when the operation needs to be canceled. |
|
98 * |
|
99 * @since S60 v3.1 |
|
100 * @return status of the operation: |
|
101 * core_error_request_pending if the operation is not finished, |
|
102 * otherwise the status code of the finished operation |
|
103 */ |
|
104 core_error_e cancel(); |
|
105 |
|
106 /** |
|
107 * This method is called when user want the operation to be canceled. |
|
108 * |
|
109 * @since S60 v3.2 |
|
110 * @param do_graceful_cancel Whether cancel should be graceful or forced. |
|
111 */ |
|
112 void user_cancel( |
|
113 bool_t do_graceful_cancel ); |
|
114 |
|
115 private: // data |
|
116 |
|
117 /** |
|
118 * The reason the operation was started. |
|
119 */ |
|
120 core_bss_lost_reason_e reason_m; |
|
121 |
|
122 /** |
|
123 * Optional data related to the reason_m. |
|
124 */ |
|
125 u32_t reason_data_m; |
|
126 |
|
127 /** |
|
128 * The number of times roaming has failed due to no suitable AP found. |
|
129 */ |
|
130 u32_t failure_count_m; |
|
131 |
|
132 /** |
|
133 * Whether we are still connected to an AP. |
|
134 */ |
|
135 bool_t is_connected_m; |
|
136 |
|
137 /** |
|
138 * The channels used for scanning when roaming. |
|
139 */ |
|
140 core_scan_channels_c scan_channels_m; |
|
141 |
|
142 /** |
|
143 * Whether the scan channels were already inverted. |
|
144 */ |
|
145 bool_t is_scan_channels_inverted_m; |
|
146 |
|
147 /** |
|
148 * Reason the connection is released. |
|
149 */ |
|
150 core_release_reason_e release_reason_m; |
|
151 |
|
152 /** |
|
153 * Number of times the current scan interval has been tried. |
|
154 */ |
|
155 u32_t scan_interval_count_m; |
|
156 |
|
157 /** |
|
158 * The current scan interval value. |
|
159 */ |
|
160 u32_t scan_interval_m; |
|
161 |
|
162 /** |
|
163 * Whether this scan is part of the scans done with |
|
164 * partial channel masks. |
|
165 */ |
|
166 bool_t is_first_scan_m; |
|
167 |
|
168 }; |
|
169 |
|
170 #endif // CORE_OPERATION_HANDLE_BSS_LOST_H |