36
|
1 |
// Copyright (c) 2007-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 |
// @file CTLbsHybridMTLRServer.cpp
|
|
15 |
// This is the class implementation for the LBS Hybrid MTLR Test Server
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
// System includes
|
|
20 |
#include <e32std.h>
|
|
21 |
#include <rsshared.h>
|
|
22 |
|
|
23 |
// User includes
|
|
24 |
#include "ctlbshybridmtlrserver.h"
|
|
25 |
#include "ctlbsuebasedmtlr.h"
|
|
26 |
#include "ctlbshybridueassistedmtlrnw.h"
|
|
27 |
#include "ctlbshybridueassistedmtlrgpsok.h"
|
|
28 |
#include "ctlbsstepsetupprotocolstub.h"
|
|
29 |
#include "ctlbsstepconfighybridmodule.h"
|
|
30 |
#include "ctlbshybridueassistedmtlrtimeout.h"
|
|
31 |
#include "ctlbshybridueassistedmtlrnogps.h"
|
|
32 |
#include "ctlbshybridmtlrfutile.h"
|
|
33 |
#include "ctlbsmtlrAccRefPos.h"
|
|
34 |
#include "ctlbsmtlrgpsoptions.h"
|
|
35 |
#include "ctlbsmtlrresetassistance.h"
|
|
36 |
#include "ctlbsnetworkinducedmtlr.h"
|
|
37 |
#include "ctlbsoom.h"
|
|
38 |
#include "ctlbshybridueassistedmtlrposstatus.h"
|
|
39 |
|
|
40 |
/**
|
|
41 |
MainL()
|
|
42 |
Description : This is the main function which installs the
|
|
43 |
active scheduler and creates a server
|
|
44 |
@internalTechnology
|
|
45 |
@param none
|
|
46 |
@return none
|
|
47 |
@pre None
|
|
48 |
@post None
|
|
49 |
*/
|
|
50 |
LOCAL_C void MainL()
|
|
51 |
{
|
|
52 |
CActiveScheduler* sched = new (ELeave) CActiveScheduler;
|
|
53 |
CleanupStack::PushL(sched);
|
|
54 |
CActiveScheduler::Install(sched);
|
|
55 |
|
|
56 |
__UHEAP_MARK;
|
|
57 |
// this registers the server with the active scheduler and calls SetActive
|
|
58 |
CT_LbsHybridMTLRServer* server = CT_LbsHybridMTLRServer::NewL();
|
|
59 |
|
|
60 |
// signal to the client that we are ready by
|
|
61 |
// rendevousing process
|
|
62 |
RProcess::Rendezvous(KErrNone);
|
|
63 |
|
|
64 |
// run the active scheduler
|
|
65 |
sched->Start();
|
|
66 |
|
|
67 |
// clean up
|
|
68 |
delete server;
|
|
69 |
__UHEAP_MARKEND;
|
|
70 |
CleanupStack::PopAndDestroy(sched);
|
|
71 |
}
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
/**
|
|
77 |
E32Main()
|
|
78 |
Description : It is the entry point
|
|
79 |
@internalTechnology
|
|
80 |
@param none
|
|
81 |
@return Returns the error code
|
|
82 |
@pre None
|
|
83 |
@post None
|
|
84 |
*/
|
|
85 |
GLDEF_C TInt E32Main()
|
|
86 |
{
|
|
87 |
__UHEAP_MARK;
|
|
88 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
|
89 |
if(cleanup == NULL)
|
|
90 |
{
|
|
91 |
return KErrNoMemory;
|
|
92 |
}
|
|
93 |
|
|
94 |
TRAPD(err, MainL());
|
|
95 |
|
|
96 |
delete cleanup;
|
|
97 |
__UHEAP_MARKEND;
|
|
98 |
|
|
99 |
return err;
|
|
100 |
}
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
/**
|
|
105 |
NewL()
|
|
106 |
Constructs a CT_LbsHybridMTLRServer object.
|
|
107 |
Uses two phase construction and leaves nothing on the CleanupStack.
|
|
108 |
@internalTechnology
|
|
109 |
@param none
|
|
110 |
@return Created object of type CT_LbsClientServer
|
|
111 |
@pre None
|
|
112 |
@post None
|
|
113 |
*/
|
|
114 |
CT_LbsHybridMTLRServer* CT_LbsHybridMTLRServer::NewL()
|
|
115 |
{
|
|
116 |
CT_LbsHybridMTLRServer*server = new(ELeave) CT_LbsHybridMTLRServer();
|
|
117 |
CleanupStack::PushL(server);
|
|
118 |
server->ConstructL(KLbsHybridMTLRTestServer);
|
|
119 |
CleanupStack::Pop(server);
|
|
120 |
return server;
|
|
121 |
}
|
|
122 |
|
|
123 |
|
|
124 |
CT_LbsHybridMTLRServer::~CT_LbsHybridMTLRServer()
|
|
125 |
{
|
|
126 |
}
|
|
127 |
|
|
128 |
|
|
129 |
/**
|
|
130 |
Function : CT_LbsHybridMTLRServer
|
|
131 |
Description : Constructor
|
|
132 |
@internalTechnology
|
|
133 |
@param :
|
|
134 |
@return : N/A
|
|
135 |
@precondition : none
|
|
136 |
@postcondition : none
|
|
137 |
*/
|
|
138 |
CT_LbsHybridMTLRServer::CT_LbsHybridMTLRServer()
|
|
139 |
{
|
|
140 |
}
|
|
141 |
|
|
142 |
/**
|
|
143 |
Function : ConstructL
|
|
144 |
Description :
|
|
145 |
@internalTechnology
|
|
146 |
@param :
|
|
147 |
@return : N/A
|
|
148 |
@precondition : none
|
|
149 |
@postcondition : none
|
|
150 |
*/
|
|
151 |
void CT_LbsHybridMTLRServer::ConstructL(const TDesC& aName)
|
|
152 |
{
|
|
153 |
CT_LbsServer::ConstructL(aName);
|
|
154 |
|
|
155 |
iSharedData = CT_LbsHybridMTLRSharedData::NewL();
|
|
156 |
}
|
|
157 |
|
|
158 |
|
|
159 |
/**
|
|
160 |
Function : CreateTestStep
|
|
161 |
Description : Creates a test step based on the step name read from the script file
|
|
162 |
@internalTechnology
|
|
163 |
@param : aStepName The step name which needs to be created
|
|
164 |
@return : Created object of type CTestStep
|
|
165 |
@precondition : none
|
|
166 |
@postcondition : none
|
|
167 |
*/
|
|
168 |
CTestStep* CT_LbsHybridMTLRServer::CreateTestStep(const TDesC& aStepName)
|
|
169 |
{
|
|
170 |
// NULL if insufficient memory. This suits the API.
|
|
171 |
|
|
172 |
// Test case test steps, each test step supports one or more test cases.
|
|
173 |
if(aStepName == KLbsUEBasedMTLR)
|
|
174 |
{
|
|
175 |
return CT_LbsUEBasedMTLR::New(*this);
|
|
176 |
}
|
|
177 |
else if(aStepName == KLbsHybridUEAssitedMTLRNW)
|
|
178 |
{
|
|
179 |
return CT_LbsHybridUEAssistedMTLRNW::New(*this);
|
|
180 |
}
|
|
181 |
else if(aStepName == KLbsHybridUEAssistedMTLRGPSOK)
|
|
182 |
{
|
|
183 |
return CT_LbsHybridUEAssistedMTLRGPSOK::New(*this);
|
|
184 |
}
|
|
185 |
else if(aStepName == KLbsStep_SetupProtocolStub)
|
|
186 |
{
|
|
187 |
return CT_LbsStep_SetupProtocolStub::New(*this);
|
|
188 |
}
|
|
189 |
else if(aStepName == KLbsStep_ConfigHybridModule)
|
|
190 |
{
|
|
191 |
return CT_LbsStep_ConfigHybridModule::New(*this);
|
|
192 |
}
|
|
193 |
else if(aStepName == KLbsHybridUEAssitedMTLRTimeout)
|
|
194 |
{
|
|
195 |
return CT_LbsHybridUEAssistedMTLRTimeout::New(*this);
|
|
196 |
}
|
|
197 |
else if(aStepName == KLbsHybridUEAssitedMTLRNoGPS)
|
|
198 |
{
|
|
199 |
return CT_LbsHybridUEAssistedMTLRNoGPS::New(*this);
|
|
200 |
}
|
|
201 |
else if(aStepName == KLbsHybridMTLRFutile)
|
|
202 |
{
|
|
203 |
return CT_LbsHybridMTLRFutile::New(*this);
|
|
204 |
}
|
|
205 |
else if(aStepName == KLbsMTLRAccurateReferencePosition)
|
|
206 |
{
|
|
207 |
return CT_LbsMtlrAccRefPos::New(*this);
|
|
208 |
}
|
|
209 |
else if(aStepName == KLbsMTLRGpsOptions)
|
|
210 |
{
|
|
211 |
return CT_LbsMTLRGpsOptions::New(*this);
|
|
212 |
}
|
|
213 |
else if(aStepName == KLbsMTLRResetAssistance)
|
|
214 |
{
|
|
215 |
return CT_LbsMTLRResetAssistance::New(*this);
|
|
216 |
}
|
|
217 |
else if (aStepName == KLbsNetworkInducedMTLR)
|
|
218 |
{
|
|
219 |
return CT_LbsNetworkInducedMTLR::New(*this);
|
|
220 |
}
|
|
221 |
else if (aStepName == KLbsOom)
|
|
222 |
{
|
|
223 |
return CT_LbsOom::New(*this);
|
|
224 |
}
|
|
225 |
else if (aStepName == KLbsHybridUEAssistedMTLRPosStatus)
|
|
226 |
{
|
|
227 |
return CT_LbsHybridUEAssistedMTLRPosStatus::New(*this);
|
|
228 |
}
|
|
229 |
|
|
230 |
// Let base class handle any common test steps - will return NULL if test step is not supported.
|
|
231 |
return CT_LbsServer::CreateTestStep(aStepName);
|
|
232 |
}
|