|
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: State machine for creating a virtual traffic stream. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 3 % |
|
20 */ |
|
21 |
|
22 #ifndef CORE_OPERATION_CREATE_TS_H |
|
23 #define CORE_OPERATION_CREATE_TS_H |
|
24 |
|
25 #include "core_operation_base.h" |
|
26 #include "abs_core_frame_handler.h" |
|
27 #include "core_virtual_traffic_stream.h" |
|
28 |
|
29 class core_traffic_stream_c; |
|
30 |
|
31 /** |
|
32 * State machine for creating a virtual traffic stream. |
|
33 * |
|
34 * @lib wlmserversrv.lib |
|
35 * @since S60 v3.1 |
|
36 */ |
|
37 NONSHARABLE_CLASS( core_operation_create_ts_c ) : public core_operation_base_c |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 enum core_state_e |
|
43 { |
|
44 core_state_init = core_base_state_next, |
|
45 core_state_delete_streams, |
|
46 core_state_create_stream, |
|
47 core_state_create_stream_success, |
|
48 core_state_create_stream_failed, |
|
49 core_state_parameters_set, |
|
50 core_state_MAX |
|
51 }; |
|
52 |
|
53 core_operation_create_ts_c( |
|
54 u32_t request_id, |
|
55 core_server_c* server, |
|
56 abs_core_driverif_c* drivers, |
|
57 abs_core_server_callback_c* adaptation, |
|
58 u8_t tid, |
|
59 u8_t user_priority, |
|
60 bool_t is_automatic_stream, |
|
61 const core_traffic_stream_params_s& params, |
|
62 u32_t& stream_id, |
|
63 core_traffic_stream_status_e& stream_status ); |
|
64 |
|
65 virtual ~core_operation_create_ts_c(); |
|
66 |
|
67 protected: |
|
68 |
|
69 /** |
|
70 * This method is called when a pending request has been completed |
|
71 * and so sub-operations are pending. |
|
72 * |
|
73 * @since S60 v3.1 |
|
74 * @return status of the operation: |
|
75 * core_error_request_pending if the operation is not finished, |
|
76 * otherwise the status code of the finished operation |
|
77 */ |
|
78 core_error_e next_state(); |
|
79 |
|
80 /** |
|
81 * This method is called when the operation needs to be canceled. |
|
82 * |
|
83 * @since S60 v3.1 |
|
84 * @return status of the operation: |
|
85 * core_error_request_pending if the operation is not finished, |
|
86 * otherwise the status code of the finished operation |
|
87 */ |
|
88 core_error_e cancel(); |
|
89 |
|
90 private: |
|
91 |
|
92 /** |
|
93 * Validate the given traffic stream parameters. |
|
94 * |
|
95 * @return true_t if the parameters are valid, false_t otherwise. |
|
96 */ |
|
97 bool_t is_valid_params(); |
|
98 |
|
99 private: // data |
|
100 |
|
101 /** |
|
102 * Requested TID of the virtual traffic stream. |
|
103 */ |
|
104 u8_t requested_tid_m; |
|
105 |
|
106 /** |
|
107 * Selected TID of the virtual traffic stream. |
|
108 */ |
|
109 u8_t tid_m; |
|
110 |
|
111 /** |
|
112 * User priority of the virtual traffic stream. |
|
113 */ |
|
114 u8_t user_priority_m; |
|
115 |
|
116 /** |
|
117 * Access class of the virtual traffic stream. |
|
118 */ |
|
119 core_access_class_e access_class_m; |
|
120 |
|
121 /** |
|
122 * Whether the virtual traffic stream has been created automatically. |
|
123 */ |
|
124 bool_t is_automatic_stream_m; |
|
125 |
|
126 /** |
|
127 * Requested parameters of the virtual traffic stream. |
|
128 */ |
|
129 core_traffic_stream_params_s requested_params_m; |
|
130 |
|
131 /** |
|
132 * Parameters of the virtual traffic stream. |
|
133 */ |
|
134 core_traffic_stream_params_s params_m; |
|
135 |
|
136 /** |
|
137 * ID of the virtual traffic stream. |
|
138 */ |
|
139 u32_t& stream_id_m; |
|
140 |
|
141 /** |
|
142 * The current status of the virtual traffic stream. |
|
143 */ |
|
144 core_traffic_stream_status_e& stream_status_m; |
|
145 |
|
146 /** |
|
147 * The traffic stream being created. |
|
148 */ |
|
149 core_traffic_stream_c* stream_m; |
|
150 |
|
151 }; |
|
152 |
|
153 #endif // CORE_OPERATION_CREATE_TS_H |