|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Declaration for CInputRequestListener |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef INPUT_REQUEST_LISTENER_H |
|
24 #define INPUT_REQUEST_LISTENER_H |
|
25 |
|
26 #include <e32def.h> |
|
27 #include <networking/umtsnifcontrolif.h> |
|
28 |
|
29 #include "CompareContextParameters.h" |
|
30 #include "reteldriverinput.h" |
|
31 #include "meteldriverstrategy.h" |
|
32 #include "PdpFsmInterfaceTest.h" |
|
33 //#include "SpudManInterfaceTest.h" |
|
34 #include "cpdpfsmfactory.h" |
|
35 |
|
36 /** |
|
37 Storage for parameters that are passed to REtelDriverInput::Input |
|
38 */ |
|
39 class TEtelDriverInputRequestData |
|
40 { |
|
41 public: |
|
42 TContextId iPdpId; |
|
43 EtelDriver::TEtelInput iOperation; |
|
44 }; |
|
45 |
|
46 /** |
|
47 Storage for parameters that are passed to RPdpFsmInterfaceTest::Input by SpudTel |
|
48 */ |
|
49 class TEtelDriverInputResponseData |
|
50 { |
|
51 public: |
|
52 TContextId iPdpId; |
|
53 TInt iSignal; |
|
54 }; |
|
55 |
|
56 /** |
|
57 Storage for parameters that are passed during Etel driver notifications |
|
58 */ |
|
59 class TNotifyContextConfigData |
|
60 { |
|
61 public: |
|
62 TContextId iPdpId; |
|
63 RPacketContext::TContextConfigGPRS iContextConfigGPRS; |
|
64 RPacketContext::TContextConfigR99_R4 iContextConfigR99_R4; |
|
65 RPacketContext::TContextConfig_R5 iContextConfig_R5; |
|
66 }; |
|
67 |
|
68 class TNotifyPacketQosData |
|
69 { |
|
70 public: |
|
71 TContextId iPdpId; |
|
72 TNegotiatedProfileBuffer iNegotiated; |
|
73 }; |
|
74 |
|
75 class TNotifyContextStatusData |
|
76 { |
|
77 public: |
|
78 TContextId iPdpId; |
|
79 RPacketContext::TContextStatus iContextStatus; |
|
80 }; |
|
81 |
|
82 class TNotifyContextDataChannelData |
|
83 { |
|
84 public: |
|
85 TContextId iPdpId; |
|
86 RPacketContext::TDataChannelV2 iDataChannelV2; |
|
87 }; |
|
88 |
|
89 /** |
|
90 Storage for parameters that are passed to RPdpFsmInterface::Input by Spud man |
|
91 */ |
|
92 class TFsmInputRequestData |
|
93 { |
|
94 public: |
|
95 TContextId iPdpId; |
|
96 TInt iOperation; |
|
97 TInt iParam; |
|
98 }; |
|
99 |
|
100 /** |
|
101 Storage for parameters that are passed to RPdpFsmInterface::Input by Etel driver |
|
102 */ |
|
103 class TFsmInputResponseData |
|
104 { |
|
105 public: |
|
106 TContextId iPdpId; |
|
107 TInt iEvent; |
|
108 TInt iParam; |
|
109 }; |
|
110 |
|
111 /** |
|
112 Storage for parameters used for a context change notification by the FSM |
|
113 */ |
|
114 class TNotifyContextParametersChangeData |
|
115 { |
|
116 public: |
|
117 TContextId iPdpId; |
|
118 TNegotiatedProfileBuffer iNegotiated; |
|
119 RPacketContext::TContextConfigGPRS iContextConfig; |
|
120 RPacketContext::TContextConfigR99_R4 iContextConfigR99_R4; |
|
121 RPacketContext::TContextConfig_R5 iContextConfig_R5; |
|
122 }; |
|
123 |
|
124 class CInputRequestListener; |
|
125 |
|
126 class CSpudUnitTestEventHandler: public MPdpFsmEventHandler |
|
127 /** |
|
128 Callback interface for PDPFsm to raise events. |
|
129 Ignore Spud in the name. It's legacy artifact kept for |
|
130 the old code to work. |
|
131 */ |
|
132 { |
|
133 public: |
|
134 virtual void Event(TInt aEvent, TInt aParam); |
|
135 static CSpudUnitTestEventHandler *NewL(CInputRequestListener& aListener, TInt aUmtsRelease); |
|
136 |
|
137 void SetContextId(TContextId aPdpId) { iPdpId = aPdpId; } |
|
138 |
|
139 private: |
|
140 CSpudUnitTestEventHandler(CInputRequestListener& aListener, TInt aUmtsRelease); |
|
141 |
|
142 private: |
|
143 CInputRequestListener& iListener; |
|
144 TContextId iPdpId; |
|
145 TInt iUmtsRelease; |
|
146 }; |
|
147 |
|
148 class CInputRequestListener : public CActive |
|
149 { |
|
150 public: |
|
151 /** |
|
152 Enum of the types of requests supported by CInputRequestListener. When the iStatus is completed with |
|
153 these results, the associated method is called with the corresponding parameters. |
|
154 */ |
|
155 enum TRequestType |
|
156 { |
|
157 EEtelDriverInputRequest, |
|
158 EEtelDriverCancelPdpRequest, |
|
159 EFsmInputRequest, |
|
160 ECleanup, |
|
161 EFsmObjectCreate |
|
162 }; |
|
163 |
|
164 public: |
|
165 static CInputRequestListener* NewL(TBool aUseTestPdpFsmInterface, TInt aUmtsRelease); |
|
166 virtual ~CInputRequestListener(); |
|
167 void Activate(); |
|
168 void RunL(); |
|
169 void DoCancel(); |
|
170 |
|
171 void CreateUnitUnderTestL(); |
|
172 void DeleteUnitUnderTest(); |
|
173 |
|
174 private: |
|
175 CInputRequestListener(TBool aUseTestPdpFsmInterface, TInt aUmtsRelease); |
|
176 void ConstructL(); |
|
177 void CreateEtelDriverL(); |
|
178 void CreatePdpFsmL(); |
|
179 |
|
180 public: |
|
181 /** Set to true when testing Etel driver, and as such the test FSM interface it used to interact with Etel driver |
|
182 and set to false when the real FSM is used */ |
|
183 TBool iUseTestPdpFsmInterface; |
|
184 /** Contains the Etel driver under test */ |
|
185 REtelDriverInput* iEtelDriver; |
|
186 /** Contains the RPdpFsmInterface used for Etel driver tests */ |
|
187 CPdpFsmInterfaceTest *iPdpFsmInterfaceTest; |
|
188 |
|
189 /** Contains the RPdpFsmInterface under test */ |
|
190 CPdpFsmInterface *iPdpFsmInterface; |
|
191 |
|
192 /** The thread that test execute is running in */ |
|
193 RThread iParentThread; |
|
194 /** This active scheduler will run the SPUD TEL, SPUD FSM and this CActive object */ |
|
195 CActiveScheduler* iScheduler; |
|
196 |
|
197 // contains the data that is passed to REtelDriverInput interface |
|
198 TEtelDriverInputRequestData iEtelDriverInputRequestData; |
|
199 TEtelDriverInputResponseData iEtelDriverInputResponseData; |
|
200 TContextId iEtelDriverCancelRequestPdpId; |
|
201 |
|
202 // contains the data that is passed to RPdpFsmInterface::Set |
|
203 TNotifyContextConfigData iNotifyContextConfigData; |
|
204 TNotifyContextStatusData iNotifyContextStatusData; |
|
205 TNotifyPacketQosData iNotifyQosNegotiatedData; |
|
206 TNotifyContextDataChannelData iNotifyContextDataChannelData; |
|
207 RPacketService::TStatus iPacketServiceStatus; |
|
208 |
|
209 // Data stored for FSM input requests |
|
210 TFsmInputRequestData iFsmInputRequestData; |
|
211 TFsmInputResponseData iFsmInputResponseData; |
|
212 TNotifyContextParametersChangeData iContextParametersEventData; |
|
213 TContextId iContextBlockedEventPdpId; |
|
214 TContextId iContextUnblockedEventPdpId; |
|
215 |
|
216 /** Completed when the Active Scheduler thread is initialized and ready to handle requests */ |
|
217 TRequestStatus iThreadInitialized; |
|
218 /** Completed when the Active Scheduler thread has cleaned up any resources and can be destroyed */ |
|
219 TRequestStatus iThreadDestructed; |
|
220 |
|
221 /** Must be pending before any Input requests are completed */ |
|
222 TRequestStatus iReadyForInputRequest; |
|
223 |
|
224 /** Completed when RPdpFsmInterfaceTest::Input is called (with a non-notification aOperation parameter) */ |
|
225 TRequestStatus iEtelDriverInputResponseStatus; |
|
226 /** Completed when RPdpFsmInterfaceTest::Input is called with a QoS notification as the aOperation parameter */ |
|
227 TRequestStatus iEtelDriverQosNotificationStatus; |
|
228 /** Completed when RPdpFsmInterfaceTest::Input is called with a GPRS config notification as the aOperation parameter */ |
|
229 TRequestStatus iEtelDriverConfigGPRSNotificationStatus; |
|
230 /** Completed when RPdpFsmInterfaceTest::Input is called with a context status change notification as the aOperation parameter */ |
|
231 TRequestStatus iEtelDriverContextStatusNotificationStatus; |
|
232 /** Completed when RPdpFsmInterfaceTest::Input is called with a service status change as the aOperation parameter */ |
|
233 TRequestStatus iEtelDriverServiceNotificationStatus; |
|
234 |
|
235 /** Completed when RSpudManInterfaceTest::Input is called (with a non-notification aOperation parameter) */ |
|
236 TRequestStatus iFsmInputResponseStatus; |
|
237 /** Completed when RSpudManInterfaceTest::Input is called with a service status change as the aOperation parameter */ |
|
238 TRequestStatus iFsmNetworkStatusStatus; |
|
239 /** Completed when RSpudManInterfaceTest::Input is called with a context status change as the aOperation parameter */ |
|
240 TRequestStatus iFsmContextParameterChangeStatus; |
|
241 /** Completed when RSpudManInterfaceTest::Input is called with a context blocked event as the aOperation parameter */ |
|
242 TRequestStatus iFsmContextSuspendedStatus; |
|
243 /** Completed when RSpudManInterfaceTest::Input is called with a context unblocked event as the aOperation parameter */ |
|
244 TRequestStatus iFsmContextResumedStatus; |
|
245 |
|
246 /** Completed by RunL() */ |
|
247 TRequestStatus iFsmObjectCreateResponse; |
|
248 |
|
249 RPointerArray<CSpudUnitTestEventHandler> iEventHandlers; |
|
250 |
|
251 TInt iUmtsRelease; |
|
252 }; |
|
253 |
|
254 /** Contains the data passed from the test execute thread to the active object thread */ |
|
255 class TActiveSchedulerThreadParams |
|
256 { |
|
257 public: |
|
258 CInputRequestListener* iListener; |
|
259 TThreadId iThreadId; |
|
260 }; |
|
261 |
|
262 /** The start-up method for the thread running the active objects */ |
|
263 TInt ActiveSchedulerThread(TAny* aActiveSchedulerParams); |
|
264 |
|
265 #endif |
|
266 // INPUT_REQUEST_LISTENER_H |
|
267 |