|
1 // Copyright (c) 2005-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 // SpudNetworkSideServer.cpp |
|
15 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to |
|
16 // be started in the process of the client. The client initialises the server |
|
17 // by calling the one and only ordinal. |
|
18 // |
|
19 // |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalComponent |
|
24 */ |
|
25 |
|
26 #include "te_spudNetworkSideServer.h" |
|
27 #include "te_spudNetworkSideSteps.h" |
|
28 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
29 #include "te_spudNetworkSideR5Steps.h" |
|
30 #endif |
|
31 |
|
32 using namespace te_spudNetworkSide; |
|
33 _LIT(KServerName,"TE_SpudNetworkSide"); |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 // EKA2 much simpler |
|
39 // just an E32Main and a MainL() |
|
40 |
|
41 /** |
|
42 * Much simpler, uses the new Rendezvous() call to sync with the client. |
|
43 * |
|
44 * @internalComponent |
|
45 * |
|
46 * @leave When new(ELeave) leaves |
|
47 */ |
|
48 LOCAL_C void MainL() |
|
49 { |
|
50 // leave the hooks in for platform security |
|
51 #if (defined __DATA_CAGING__) |
|
52 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
53 RProcess().SecureApi(RProcess::ESecureApiOn); |
|
54 #endif |
|
55 CActiveScheduler* sched = NULL; |
|
56 sched = new(ELeave) CActiveScheduler; |
|
57 CActiveScheduler::Install(sched); |
|
58 |
|
59 CSpudNetworkSideTestServer* server = NULL; |
|
60 // create the CTestServer derived server |
|
61 TRAPD(err,server = CSpudNetworkSideTestServer::NewL()); |
|
62 if (!err) |
|
63 { |
|
64 // Sync with the client and enter the active scheduler |
|
65 RProcess::Rendezvous(KErrNone); |
|
66 sched->Start(); |
|
67 } |
|
68 delete server; |
|
69 delete sched; |
|
70 } |
|
71 |
|
72 // only a DLL on emulator for typhoon and earlier |
|
73 |
|
74 /** |
|
75 * Main entry point. |
|
76 * |
|
77 * @internalComponent |
|
78 * |
|
79 * @return Standard Epoc error codes. |
|
80 */ |
|
81 GLDEF_C TInt E32Main() |
|
82 { |
|
83 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
84 if (cleanup == NULL) |
|
85 { |
|
86 return KErrNoMemory; |
|
87 } |
|
88 TRAP_IGNORE(MainL()); |
|
89 delete cleanup; |
|
90 return KErrNone; |
|
91 } |
|
92 |
|
93 // Create a thread in the calling process |
|
94 // Emulator typhoon and earlier |
|
95 |
|
96 /** |
|
97 * Called inside the MainL() function to create and start the CTestServer derived server. |
|
98 * |
|
99 * @internalComponent |
|
100 * |
|
101 * @return Instance of the test server. |
|
102 */ |
|
103 CSpudNetworkSideTestServer* CSpudNetworkSideTestServer::NewL() |
|
104 { |
|
105 CSpudNetworkSideTestServer * server = new (ELeave) CSpudNetworkSideTestServer(); |
|
106 CleanupStack::PushL(server); |
|
107 |
|
108 // CServer base class call |
|
109 server->StartL(KServerName); |
|
110 CleanupStack::Pop(server); |
|
111 return server; |
|
112 } |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 CTestStep* CSpudNetworkSideTestServer::CreateTestStep(const TDesC& aStepName) |
|
119 /** |
|
120 * @return - A CTestStep derived instance |
|
121 * Implementation of CTestServer pure virtual |
|
122 */ |
|
123 { |
|
124 CTestStep* step = NULL; |
|
125 |
|
126 if(aStepName == KCESockCheck) |
|
127 { |
|
128 step = new CESockCheck; |
|
129 } |
|
130 else if(aStepName == KCSpudPrimary) |
|
131 { |
|
132 step = new CSpudPrimary; |
|
133 } |
|
134 else if(aStepName == KCSpudPrimaryEvent) |
|
135 { |
|
136 step = new CSpudPrimaryEvent; |
|
137 } |
|
138 else if(aStepName == KCSpudPrimaryContextEventProgress) |
|
139 { |
|
140 step = new CSpudPrimaryContextEventProgress; |
|
141 } |
|
142 else if(aStepName == KCSpudDeletePrimary) |
|
143 { |
|
144 step = new CSpudDeletePrimary; |
|
145 } |
|
146 else if(aStepName == KCSpudSecondary) |
|
147 { |
|
148 step = new CSpudSecondary; |
|
149 } |
|
150 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY |
|
151 else if(aStepName == KCSpudSecondaryEvent) |
|
152 { |
|
153 step = new CSpudSecondaryEvent; |
|
154 } |
|
155 else if(aStepName == KCSpudTwoSecondaryEvents) |
|
156 { |
|
157 step = new CSpudTwoSecondaryEvents; |
|
158 } |
|
159 else if(aStepName == KCSpudSecondaryEvent2) |
|
160 { |
|
161 step = new CSpudSecondaryEvent2; |
|
162 } |
|
163 else if(aStepName == KCSpudSecondaryChangeQoS) |
|
164 { |
|
165 step = new CSpudSecondaryChangeQoS; |
|
166 } |
|
167 #endif |
|
168 else if(aStepName == KCSpudSuspendContext) |
|
169 { |
|
170 step = new CSpudSuspendContext; |
|
171 } |
|
172 else if(aStepName == KCESockCheck) |
|
173 { |
|
174 step = new CESockCheck; |
|
175 } |
|
176 else if(aStepName == KCSpudPrimaryInterfaceStop) |
|
177 { |
|
178 step = new CSpudPrimaryInterfaceStop; |
|
179 } |
|
180 else if(aStepName == KCSpudPrimaryInterfaceEventStop) |
|
181 { |
|
182 step = new CSpudPrimaryInterfaceEventStop; |
|
183 } |
|
184 else if(aStepName == KCSpudSecondaryInterfaceStop) |
|
185 { |
|
186 step = new CSpudSecondaryInterfaceStop; |
|
187 } |
|
188 else if(aStepName == KCSpudSecondaryInterfaceEventStop) |
|
189 { |
|
190 step = new CSpudSecondaryInterfaceEventStop; |
|
191 } |
|
192 else if(aStepName == KCSpudPrimaryDeletionInterfaceStop) |
|
193 { |
|
194 step = new CSpudPrimaryDeletionInterfaceStop; |
|
195 } |
|
196 else if(aStepName == KCSpudPrimayStartingStop) |
|
197 { |
|
198 step = new CSpudPrimayStartingStop; |
|
199 } |
|
200 else if(aStepName == KCSpudSecondaryStartingStop) |
|
201 { |
|
202 step = new CSpudSecondaryStartingStop; |
|
203 } |
|
204 else if(aStepName == KCSpudSecondaryLowerNifDownStop) |
|
205 { |
|
206 step = new CSpudSecondaryLowerNifDownStop; |
|
207 } |
|
208 else if(aStepName == KCSpudPrimaryEventOnLowerNifStarting) |
|
209 { |
|
210 step = new CSpudPrimaryEventOnLowerNifStarting; |
|
211 } |
|
212 else if(aStepName == KCSpudPppPrimary) |
|
213 { |
|
214 step = new CSpudPppPrimary; |
|
215 } |
|
216 else if(aStepName == KCSpudPppSecondarySend) |
|
217 { |
|
218 step = new CSpudPppSecondarySend; |
|
219 } |
|
220 else if(aStepName == KCSpudMultiPrimary) |
|
221 { |
|
222 step = new CSpudMultiPrimary; |
|
223 } |
|
224 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
225 else if(aStepName == KCSpudQosR5Secondary) |
|
226 { |
|
227 step = new CSpudQosR5Secondary; |
|
228 } |
|
229 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY |
|
230 else if(aStepName == KCSpudSecondaryQosR5Event) |
|
231 { |
|
232 step = new CSpudSecondaryQosR5Event; |
|
233 } |
|
234 else if(aStepName == KCSpudSecondaryChangeR5QoS) |
|
235 { |
|
236 step = new CSpudSecondaryChangeR5QoS; |
|
237 } |
|
238 #endif |
|
239 else if(aStepName == KCSpudDeletePrimaryR5Qos) |
|
240 { |
|
241 step = new CSpudDeletePrimaryR5Qos; |
|
242 } |
|
243 #endif |
|
244 return step; |
|
245 } |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |