|
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 doing scans when roaming |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CORE_SUB_OPERATION_ROAM_SCAN_H |
|
20 #define CORE_SUB_OPERATION_ROAM_SCAN_H |
|
21 |
|
22 #include "core_operation_base.h" |
|
23 #include "abs_core_frame_handler.h" |
|
24 #include "abs_core_event_handler.h" |
|
25 |
|
26 NONSHARABLE_CLASS( core_sub_operation_roam_scan_c ) : |
|
27 public core_operation_base_c, |
|
28 public abs_core_frame_handler_c, |
|
29 public abs_core_event_handler_c |
|
30 { |
|
31 |
|
32 public: |
|
33 |
|
34 enum core_state_e |
|
35 { |
|
36 core_state_init = core_base_state_next, |
|
37 core_state_scan_start, |
|
38 core_state_scan_started, |
|
39 core_state_scan_stop, |
|
40 core_state_scan_stopped, |
|
41 core_state_scan_complete, |
|
42 core_state_MAX |
|
43 }; |
|
44 |
|
45 /** |
|
46 * Constructor |
|
47 * |
|
48 * @since S60 v3.1 |
|
49 * @param request_id to corresponding service request |
|
50 * @param server core server |
|
51 * @param drivers pointer to lower adaptation |
|
52 * @param adaptation pointer to upper adaptation |
|
53 * @param scan_ssid SSID to be scanned. |
|
54 * @param scan_channels List of channels to scan. |
|
55 * @param is_connected Whether the terminal is currently connected to a BSS. |
|
56 * @param is_first_match_selected Whether scan should be stopped at the first match. |
|
57 */ |
|
58 core_sub_operation_roam_scan_c( |
|
59 u32_t request_id, |
|
60 core_server_c* server, |
|
61 abs_core_driverif_c* drivers, |
|
62 abs_core_server_callback_c* adaptation, |
|
63 const core_ssid_s& scan_ssid, |
|
64 const core_scan_channels_s& scan_channels, |
|
65 bool_t is_connected, |
|
66 bool_t is_first_match_selected ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~core_sub_operation_roam_scan_c(); |
|
72 |
|
73 protected: |
|
74 |
|
75 /** |
|
76 * This method is called when a pending request has been completed |
|
77 * and so sub-operations are pending. |
|
78 * |
|
79 * @since S60 v3.1 |
|
80 * @return status of the operation: |
|
81 * core_error_request_pending if the operation is not finished, |
|
82 * otherwise the status code of the finished operation |
|
83 */ |
|
84 core_error_e next_state(); |
|
85 |
|
86 /** |
|
87 * This method is called when the operation is cancelled from the outside. |
|
88 * |
|
89 * @since S60 v3.2 |
|
90 * @param do_graceful_cancel Whether cancel should be graceful or forced. |
|
91 */ |
|
92 void user_cancel( |
|
93 bool_t do_graceful_cancel ); |
|
94 |
|
95 /** |
|
96 * From abs_core_frame_handler_c Called by the core server when a dot11 frame has been received. |
|
97 * |
|
98 * @since S60 v3.1 |
|
99 * @param frame Pointer to a dot11 frame parser. |
|
100 * @param rcpi RCPI value of the frame. |
|
101 * @return true_t if the frame was handled, false_t otherwise. |
|
102 */ |
|
103 bool_t receive_frame( |
|
104 const core_frame_dot11_c* frame, |
|
105 u8_t rcpi ); |
|
106 |
|
107 /** |
|
108 * From abs_core_event_handler_c Called by the core server when an indication has been received. |
|
109 * |
|
110 * @since S60 v3.1 |
|
111 * @param indication Adaptation layer event. |
|
112 * @return true_t if the indication was handled, false_t if not handled. |
|
113 */ |
|
114 bool_t notify( |
|
115 core_am_indication_e indication ); |
|
116 |
|
117 private: // data |
|
118 |
|
119 /** |
|
120 * The SSID to be scanned. |
|
121 */ |
|
122 const core_ssid_s scan_ssid_m; |
|
123 |
|
124 /** |
|
125 * The channels to be scanned. |
|
126 */ |
|
127 const core_scan_channels_s scan_channels_m; |
|
128 |
|
129 /** |
|
130 * Whether the terminal is currently connected to a BSS. |
|
131 */ |
|
132 bool_t is_connected_m; |
|
133 |
|
134 /** |
|
135 * Whether scan should be stopped at the first match. |
|
136 */ |
|
137 bool_t is_first_match_selected; |
|
138 |
|
139 }; |
|
140 |
|
141 #endif // CORE_SUB_OPERATION_ROAM_SCAN_H |