|
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: Declaration of the WlanDot11SoftReset class |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 14 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANDOT11SOFTRESET_H |
|
23 #define WLANDOT11SOFTRESET_H |
|
24 |
|
25 #include "UmacDot11State.h" |
|
26 |
|
27 /** |
|
28 * Resets the WHA layer back to the same initial state which it was in after |
|
29 * Initialize and Configure WHA commands. However, does not reset the MIB |
|
30 * elements. |
|
31 * |
|
32 * @lib wlanumac.lib |
|
33 * @since S60 v3.1 |
|
34 */ |
|
35 class WlanDot11SoftReset : public WlanDot11State |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * C++ default constructor. |
|
41 */ |
|
42 WlanDot11SoftReset() : iState( EINIT ) {}; |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 virtual ~WlanDot11SoftReset() {}; |
|
48 |
|
49 protected: |
|
50 |
|
51 // Types for the FSM |
|
52 // |
|
53 |
|
54 // events for the FSM |
|
55 enum TEvent |
|
56 { |
|
57 // state entry action to be executed |
|
58 ESTATEENTRY, |
|
59 // underlying sw layer tx delivery complete event |
|
60 ETXCOMPLETE, |
|
61 // abort execution event |
|
62 EABORT, |
|
63 // defined as an upper bound |
|
64 EEVENTMAX |
|
65 }; |
|
66 |
|
67 // states of the FSM |
|
68 enum TState |
|
69 { |
|
70 // start state of the state machine |
|
71 EINIT, |
|
72 EISSUEDISCONNECT, |
|
73 ECONFTXQUEUE, |
|
74 ECONTINUEDOT11TRAVERSE, |
|
75 // defined as an upper bound |
|
76 ESTATEMAX |
|
77 }; |
|
78 |
|
79 /** |
|
80 * ?member_description. |
|
81 * |
|
82 * @since Series 60 3.1 |
|
83 * @param aCtxImpl global statemachine context |
|
84 */ |
|
85 void Fsm( |
|
86 WlanContextImpl& aCtxImpl, |
|
87 TEvent aEvent ); |
|
88 |
|
89 /** |
|
90 * ?member_description. |
|
91 * |
|
92 * @since Series 60 3.1 |
|
93 * @param aCtxImpl global statemachine context |
|
94 */ |
|
95 void OnStateEntryEvent( |
|
96 WlanContextImpl& aCtxImpl ); |
|
97 |
|
98 /** |
|
99 * Performs state initialization actions. |
|
100 * |
|
101 * @since Series 60 3.1 |
|
102 * @param aCtxImpl global statemachine context |
|
103 */ |
|
104 virtual void InitActions( WlanContextImpl& aCtxImpl ); |
|
105 |
|
106 /** |
|
107 * ?member_description. |
|
108 * |
|
109 * @since Series 60 3.1 |
|
110 * @param aCtxImpl global statemachine context |
|
111 */ |
|
112 void OnTxCompleteEvent( |
|
113 WlanContextImpl& aCtxImpl ); |
|
114 |
|
115 /** |
|
116 * ?member_description. |
|
117 * |
|
118 * @since Series 60 3.1 |
|
119 * @param aCtxImpl global statemachine context |
|
120 */ |
|
121 void OnAbortEvent( WlanContextImpl& aCtxImpl ); |
|
122 |
|
123 /** |
|
124 * ?member_description. |
|
125 * |
|
126 * @since Series 60 3.1 |
|
127 * @param aCtxImpl global statemachine context |
|
128 */ |
|
129 void ContinueDot11StateTraversal( |
|
130 WlanContextImpl& aCtxImpl ); |
|
131 |
|
132 /** |
|
133 * ?member_description. |
|
134 * |
|
135 * @since Series 60 3.1 |
|
136 * @param aCtxImpl global statemachine context |
|
137 */ |
|
138 void ChangeInternalState( |
|
139 WlanContextImpl& aCtxImpl, |
|
140 TState aNewState ); |
|
141 |
|
142 /** |
|
143 * ?member_description. |
|
144 * |
|
145 * @since Series 60 3.1 |
|
146 * @param aCtxImpl global statemachine context |
|
147 */ |
|
148 void IssueDisconnect( WlanContextImpl& aCtxImpl ); |
|
149 |
|
150 /** |
|
151 * ?member_description. |
|
152 * |
|
153 * @since Series 60 3.1 |
|
154 * @param aCtxImpl global statemachine context |
|
155 */ |
|
156 void ConfigureQueue( WlanContextImpl& aCtxImpl ); |
|
157 |
|
158 /** |
|
159 * From ?base_class1. |
|
160 * Returns the states name |
|
161 * |
|
162 * @since Series 60 3.1 |
|
163 * @param aLength (OUT) length of the name of the state |
|
164 * @return name of the state |
|
165 */ |
|
166 #ifndef NDEBUG |
|
167 virtual const TInt8* GetStateName( TUint8& aLength ) const; |
|
168 #endif // !NDEBUG |
|
169 |
|
170 /** |
|
171 * From ?base_class1. |
|
172 * ?description |
|
173 * |
|
174 * @since Series 60 3.1 |
|
175 * @param aCtxImpl global statemachine context |
|
176 */ |
|
177 virtual void Entry( WlanContextImpl& aCtxImpl); |
|
178 |
|
179 /** |
|
180 * From ?base_class1. |
|
181 * ?description |
|
182 * |
|
183 * @since Series 60 3.1 |
|
184 * @param aCtxImpl global statemachine context |
|
185 */ |
|
186 virtual void Exit( WlanContextImpl& aCtxImpl); |
|
187 |
|
188 private: |
|
189 |
|
190 // Prohibit copy constructor |
|
191 WlanDot11SoftReset( const WlanDot11SoftReset& ); |
|
192 // Prohibit assigment operator |
|
193 WlanDot11SoftReset& operator= ( const WlanDot11SoftReset& ); |
|
194 |
|
195 protected: // Data |
|
196 |
|
197 TState iState; |
|
198 |
|
199 #ifndef NDEBUG |
|
200 // max length of state name for tracing |
|
201 enum { KMaxStateStringLength = 50 }; |
|
202 // max length of event name for tracing |
|
203 enum { KMaxEventStringLength = KMaxStateStringLength }; |
|
204 |
|
205 // state names for tracing |
|
206 static const TUint8 iStateName[ESTATEMAX][KMaxStateStringLength]; |
|
207 // event names for tracing |
|
208 static const TUint8 iEventName[EEVENTMAX][KMaxEventStringLength]; |
|
209 /** name of the state */ |
|
210 static const TInt8 iName[]; |
|
211 #endif |
|
212 }; |
|
213 |
|
214 #endif // WLANDOT11SOFTRESET_H |