|
1 /* |
|
2 * Copyright (c) 2005-2009 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 establishing an adhoc network |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CORE_SUB_OPERATION_ADHOC_H |
|
20 #define CORE_SUB_OPERATION_ADHOC_H |
|
21 |
|
22 #include "core_operation_base.h" |
|
23 #include "core_ap_data.h" |
|
24 #include "abs_core_frame_handler.h" |
|
25 #include "abs_core_event_handler.h" |
|
26 |
|
27 class core_server_c; |
|
28 class abs_core_driverif_c; |
|
29 |
|
30 /** |
|
31 * Statemachine for establishing an adhoc network |
|
32 * |
|
33 * @lib wlmserversrv.lib |
|
34 * @since S60 v3.1 |
|
35 */ |
|
36 NONSHARABLE_CLASS( core_sub_operation_adhoc_c ) : |
|
37 public core_operation_base_c, |
|
38 public abs_core_frame_handler_c, |
|
39 public abs_core_event_handler_c |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 enum core_state_e |
|
45 { |
|
46 core_state_init = core_base_state_next, |
|
47 core_state_scan_start, |
|
48 core_state_scan_complete, |
|
49 core_state_req_set_tx_rate_policies, |
|
50 core_state_req_start_adhoc, |
|
51 core_state_adhoc_started, |
|
52 core_state_adhoc_frame, |
|
53 core_state_adhoc_complete, |
|
54 core_state_MAX |
|
55 }; |
|
56 |
|
57 /** |
|
58 * Constructor. |
|
59 */ |
|
60 core_sub_operation_adhoc_c( |
|
61 u32_t request_id, |
|
62 core_server_c* server, |
|
63 abs_core_driverif_c* drivers, |
|
64 abs_core_server_callback_c* adaptation, |
|
65 core_ap_data_c** ap_data ); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 virtual ~core_sub_operation_adhoc_c(); |
|
71 |
|
72 protected: |
|
73 |
|
74 /** |
|
75 * This method is called when a pending request has been completed |
|
76 * and so sub-operations are pending. |
|
77 * |
|
78 * @since S60 v3.1 |
|
79 * @return status of the operation: |
|
80 * core_error_request_pending if the operation is not finished, |
|
81 * otherwise the status code of the finished operation |
|
82 */ |
|
83 core_error_e next_state(); |
|
84 |
|
85 /** |
|
86 * This method is called when the operation needs to be canceled. |
|
87 * |
|
88 * @since S60 v3.1 |
|
89 * @return status of the operation: |
|
90 * core_error_request_pending if the operation is not finished, |
|
91 * otherwise the status code of the finished operation |
|
92 */ |
|
93 core_error_e cancel(); |
|
94 |
|
95 /** |
|
96 * This method is called when the operation is cancelled from the outside. |
|
97 * |
|
98 * @since S60 v3.2 |
|
99 * @param do_graceful_cancel Whether cancel should be graceful or forced. |
|
100 */ |
|
101 void user_cancel( |
|
102 bool_t do_graceful_cancel ); |
|
103 |
|
104 /** |
|
105 * From abs_core_frame_handler_c Called by the core server when a dot11 frame has been received. |
|
106 * |
|
107 * @since S60 v3.1 |
|
108 * @param frame Pointer to a dot11 frame parser. |
|
109 * @param rcpi RCPI value of the frame. |
|
110 * @return true_t if the frame was handled, false_t otherwise. |
|
111 */ |
|
112 bool_t receive_frame( |
|
113 const core_frame_dot11_c* frame, |
|
114 u8_t rcpi ); |
|
115 |
|
116 /** |
|
117 * From abs_core_event_handler_c Called by the core server when an indication has been received. |
|
118 * |
|
119 * @since S60 v3.1 |
|
120 * @param indication Adaptation layer event. |
|
121 * @return true_t if the indication was handled, false_t if not handled. |
|
122 */ |
|
123 bool_t notify( |
|
124 core_am_indication_e indication ); |
|
125 |
|
126 private: // data |
|
127 |
|
128 core_ap_data_c** ptr_ap_data_m; |
|
129 |
|
130 /** The channel to create the network to. */ |
|
131 u32_t channel_m; |
|
132 |
|
133 /** Structure for the channel noise information. */ |
|
134 u32_t noise_per_channel_m[SCAN_BAND_2DOT4GHZ_MAX_CHANNEL_EURO]; |
|
135 |
|
136 }; |
|
137 |
|
138 #endif // CORE_SUB_OPERATION_ADHOC_H |