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 |
// This is the class implementation for the MO-LR - Accurate GPS Result scenario Tests
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
// LBS includes.
|
|
19 |
#include <lbs/test/lbsnetprotocolproxy.h>
|
|
20 |
#include <lbs/lbsnetprotocolbase.h>
|
|
21 |
#include <lbs/lbsassistancedatabuilderset.h>
|
|
22 |
|
|
23 |
// LBS test includes.
|
|
24 |
#include "ctlbshybridueassistedmolrgpsok.h"
|
|
25 |
#include <lbs/test/tlbsutils.h>
|
|
26 |
#include "argutils.h"
|
|
27 |
#include <lbs/test/activeyield.h>
|
|
28 |
|
|
29 |
|
|
30 |
const TInt KN(2); // Number of times to send the measurement from GPS to NW
|
|
31 |
|
|
32 |
/**
|
|
33 |
Static Constructor
|
|
34 |
*/
|
|
35 |
CT_LbsHybridUEAssistedMOLRGPSOk* CT_LbsHybridUEAssistedMOLRGPSOk::New(CT_LbsHybridMOLRServer& aParent)
|
|
36 |
{
|
|
37 |
// Note that we do not use ELeave.
|
|
38 |
// This means that having insufficient memory will return NULL;
|
|
39 |
CT_LbsHybridUEAssistedMOLRGPSOk* testStep = new CT_LbsHybridUEAssistedMOLRGPSOk(aParent);
|
|
40 |
if (testStep)
|
|
41 |
{
|
|
42 |
TInt err = KErrNone;
|
|
43 |
|
|
44 |
TRAP(err, testStep->ConstructL());
|
|
45 |
if (err)
|
|
46 |
{
|
|
47 |
delete testStep;
|
|
48 |
testStep = NULL;
|
|
49 |
}
|
|
50 |
}
|
|
51 |
return testStep;
|
|
52 |
}
|
|
53 |
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Constructor
|
|
57 |
*/
|
|
58 |
CT_LbsHybridUEAssistedMOLRGPSOk::CT_LbsHybridUEAssistedMOLRGPSOk(CT_LbsHybridMOLRServer& aParent) : CT_LbsHybridMOLRStep(aParent)
|
|
59 |
{
|
|
60 |
SetTestStepName(KLbsHybridUEAssistedMOLRGPSOk);
|
|
61 |
iSessionId.SetSessionOwner(KRequestUid);
|
|
62 |
iSessionId.SetSessionNum(0x0005);
|
|
63 |
}
|
|
64 |
|
|
65 |
|
|
66 |
void CT_LbsHybridUEAssistedMOLRGPSOk::ConstructL()
|
|
67 |
{
|
|
68 |
// Create the base class objects.
|
|
69 |
CT_LbsHybridMOLRStep::ConstructL();
|
|
70 |
}
|
|
71 |
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Destructor
|
|
75 |
*/
|
|
76 |
CT_LbsHybridUEAssistedMOLRGPSOk::~CT_LbsHybridUEAssistedMOLRGPSOk()
|
|
77 |
{
|
|
78 |
}
|
|
79 |
|
|
80 |
// Hybrid - UE Assisted MO-LR GPS ok
|
|
81 |
|
|
82 |
TVerdict CT_LbsHybridUEAssistedMOLRGPSOk::doTestStepL()
|
|
83 |
{
|
|
84 |
INFO_PRINTF1(_L("CT_LbsHybridUEAssistedMOLRGPSOk::doTestStepL()"));
|
|
85 |
// Stop the test if the preable failed
|
|
86 |
TESTL(TestStepResult() == EPass);
|
|
87 |
|
|
88 |
TInt testCaseId;
|
|
89 |
if (GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId))
|
|
90 |
{
|
|
91 |
INFO_PRINTF2(_L("test ID= %d"),testCaseId);
|
|
92 |
}
|
|
93 |
|
|
94 |
const TInt KTimeOut = 60*1000*1000;
|
|
95 |
|
|
96 |
// Create Network Protocol Proxy
|
|
97 |
CNetProtocolProxy* proxy = CNetProtocolProxy::NewL();
|
|
98 |
CleanupStack::PushL(proxy);
|
|
99 |
|
|
100 |
// >> AdviceSystemStatus(0) - GetCurrentCapabilitiesResponse
|
|
101 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgGetCurrentCapabilitiesResponse);
|
|
102 |
CLbsNetworkProtocolBase::TLbsSystemStatus status;
|
|
103 |
TInt cleanupCnt;
|
|
104 |
cleanupCnt = proxy->GetArgsLC(ENetMsgGetCurrentCapabilitiesResponse, &status);
|
|
105 |
TESTL(status == CLbsNetworkProtocolBase::ESystemStatusNone);
|
|
106 |
CleanupStack::PopAndDestroy(cleanupCnt);
|
|
107 |
|
|
108 |
// Start Test Step
|
|
109 |
RPositionServer server;
|
|
110 |
TESTL(KErrNone == server.Connect());
|
|
111 |
CleanupClosePushL(server);
|
|
112 |
|
|
113 |
RPositioner pos;
|
|
114 |
TESTL(KErrNone == pos.Open(server));
|
|
115 |
|
|
116 |
CPosServerWatcher *pWatch = NULL;
|
|
117 |
TInt reason = KErrNone;
|
|
118 |
|
|
119 |
if (testCaseId == 9)
|
|
120 |
{
|
|
121 |
// see INC121701
|
|
122 |
// this tests that a cancel on the P&S bus fron the locserver to the AGPS
|
|
123 |
// manager does not get overwritten by a status when the sub-session is closed
|
|
124 |
|
|
125 |
// Note that here we do not put pos on cleanup stack i.e CleanupClosePushL(pos);
|
|
126 |
// it emans that if the test fails by leaving between now and when we close the
|
|
127 |
// subsession then there will be a leak!
|
|
128 |
// This is accepable beacuse if we did push it and then
|
|
129 |
// CleanupStack::PopAndDestroy(); then the timings change
|
|
130 |
// and the test is unable to create the back to back cancel/status scenario
|
|
131 |
// Set the max fix time for the client request to ensure the location server does not complete the request too soon during the test.
|
|
132 |
TPositionUpdateOptions posOpts(TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(KMOLRFixTime));
|
|
133 |
pos.SetUpdateOptions(posOpts);
|
|
134 |
|
|
135 |
pWatch = CPosServerWatcher::NewLC(pos, *this);
|
|
136 |
// Request a self-locate MoLr.
|
|
137 |
pWatch->IssueNotifyPositionUpdate();
|
|
138 |
|
|
139 |
// >> RequestSelfLocation()
|
|
140 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestSelfLocation);
|
|
141 |
|
|
142 |
// Process the response.
|
|
143 |
TLbsNetSessionId* sessionId = NULL;
|
|
144 |
TLbsNetPosRequestOptionsAssistance* opts = NULL;
|
|
145 |
TInt cleanupCnt;
|
|
146 |
|
|
147 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRequestSelfLocation, &sessionId, &opts);
|
|
148 |
iSessionId.SetSessionNum(sessionId->SessionNum());
|
|
149 |
iSessionId.SetSessionOwner(sessionId->SessionOwner());
|
|
150 |
|
|
151 |
CleanupStack::PopAndDestroy(cleanupCnt);
|
|
152 |
sessionId = NULL;
|
|
153 |
opts = NULL;
|
|
154 |
|
|
155 |
// << ProcessStatusUpdate(EServiceSelfLocation)
|
|
156 |
MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask = MLbsNetworkProtocolObserver::EServiceSelfLocation;
|
|
157 |
proxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask);
|
|
158 |
|
|
159 |
// do NOT send to LBS a location reques
|
|
160 |
// thus ensuring that the cancel should arive fron LBS without
|
|
161 |
// and assistance data requests
|
|
162 |
|
|
163 |
pos.CancelRequest(EPositionerNotifyPositionUpdate);
|
|
164 |
CheckForObserverEventTestsL(KTimeOut, *this);
|
|
165 |
pos.Close();
|
|
166 |
|
|
167 |
// now check that one and ONLY one cancel arrives
|
|
168 |
// Wait for and process the response.
|
|
169 |
TInt err = proxy->WaitForResponse( 1 * 1000 * 1000) ;
|
|
170 |
// if a status overwrites the cancel on the P&S bus then no cancel will arrive and te test will fail!
|
|
171 |
if (err==ENetMsgCancelSelfLocation)
|
|
172 |
{
|
|
173 |
INFO_PRINTF1(_L("Received a Cancel, as expected"));
|
|
174 |
}
|
|
175 |
else
|
|
176 |
{
|
|
177 |
TESTL(err == ENetMsgCancelSelfLocation);
|
|
178 |
}
|
|
179 |
|
|
180 |
// << ProcessSessionComplete(SessionId, KErrCancel)
|
|
181 |
TInt reason = KErrCancel;
|
|
182 |
proxy->CallL(ENetMsgProcessSessionComplete, &iSessionId, &reason);
|
|
183 |
|
|
184 |
const TInt KTimeOutOneSecond = 1*1000*1000;
|
|
185 |
|
|
186 |
// now no more messages should arrive and definately NOT another cancel!
|
|
187 |
// in order to demonstrate that this test actually works ..
|
|
188 |
// in location server's CRequestQ::IssueStatus
|
|
189 |
// add dleay before sending the cancel:
|
|
190 |
// For example:
|
|
191 |
// User::After(2* 1000 *1000);
|
|
192 |
// TRAP_IGNORE(iLocReqBus->PublishRequestL(cancel));
|
|
193 |
// this ensures that TWO cancels are sent from the location server to the agps manager
|
|
194 |
// and exercises the code in the manager that prevents TWO cancels being sent to
|
|
195 |
// the protocol module
|
|
196 |
// in order to see the test failing when a second cancel arrives also need to
|
|
197 |
// comment out the line "if (!iSessionStartedStateAndCancelling)"
|
|
198 |
// in agps manager's lbsmanagermainlogic.cpp
|
|
199 |
|
|
200 |
err = proxy->WaitForResponse( KTimeOutOneSecond) ;
|
|
201 |
if (err==ENetMsgCancelSelfLocation)
|
|
202 |
{
|
|
203 |
INFO_PRINTF1(_L("Test failed: received a SECOND cancel"));
|
|
204 |
}
|
|
205 |
TESTL(err == ENetMsgTimeoutExpired);
|
|
206 |
|
|
207 |
|
|
208 |
// Done. Now cleanup...
|
|
209 |
CleanupStack::PopAndDestroy(pWatch);
|
|
210 |
CleanupStack::PopAndDestroy(); // server
|
|
211 |
CleanupStack::PopAndDestroy(proxy);
|
|
212 |
|
|
213 |
return TestStepResult();
|
|
214 |
}
|
|
215 |
else
|
|
216 |
{
|
|
217 |
CleanupClosePushL(pos);
|
|
218 |
// Set the max fix time for the client request to ensure the location server does not complete the request too soon during the test.
|
|
219 |
TPositionUpdateOptions posOpts(TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(KMOLRFixTime));
|
|
220 |
pos.SetUpdateOptions(posOpts);
|
|
221 |
|
|
222 |
pWatch = CPosServerWatcher::NewLC(pos, *this);
|
|
223 |
|
|
224 |
// Request a self-locate MoLr.
|
|
225 |
pWatch->IssueNotifyPositionUpdate();
|
|
226 |
|
|
227 |
// >> RequestSelfLocation()
|
|
228 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestSelfLocation);
|
|
229 |
|
|
230 |
// Process the response.
|
|
231 |
TLbsNetSessionId* sessionId = NULL;
|
|
232 |
TLbsNetPosRequestOptionsAssistance* opts = NULL;
|
|
233 |
TInt cleanupCnt;
|
|
234 |
|
|
235 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRequestSelfLocation, &sessionId, &opts);
|
|
236 |
|
|
237 |
TBool qualitycheck = ArgUtils::CompareQuality( opts,
|
|
238 |
ETrue,
|
|
239 |
KMinHorizontalAcc,
|
|
240 |
KMinVerticalAcc,
|
|
241 |
KMOLRFixTime,
|
|
242 |
0,
|
|
243 |
EAssistanceDataReferenceTime,
|
|
244 |
(TPositionModuleInfo::ETechnologyTerminal
|
|
245 |
| TPositionModuleInfo::ETechnologyAssisted)
|
|
246 |
);
|
|
247 |
|
|
248 |
TESTL(qualitycheck);
|
|
249 |
|
|
250 |
iSessionId.SetSessionNum(sessionId->SessionNum());
|
|
251 |
iSessionId.SetSessionOwner(sessionId->SessionOwner());
|
|
252 |
|
|
253 |
CleanupStack::PopAndDestroy(cleanupCnt);
|
|
254 |
sessionId = NULL;
|
|
255 |
opts = NULL;
|
|
256 |
|
|
257 |
// << ProcessStatusUpdate(EServiceSelfLocation)
|
|
258 |
MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask = MLbsNetworkProtocolObserver::EServiceSelfLocation;
|
|
259 |
proxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask);
|
|
260 |
|
|
261 |
// << ProcessLocationUpdate(SessionId, RefPosition)
|
|
262 |
TPositionInfo refPosInfo = ArgUtils::MolrReferencePositionInfo();
|
|
263 |
proxy->CallL(ENetMsgProcessLocationUpdate, &iSessionId, &refPosInfo);
|
|
264 |
|
|
265 |
// TEST: Get the ref pos app side.
|
|
266 |
CheckForObserverEventTestsL(KTimeOut, *this);
|
|
267 |
|
|
268 |
// << ProcessAssistanceData()
|
|
269 |
TLbsAsistanceDataGroup dataMask = EAssistanceDataReferenceTime;
|
|
270 |
RLbsAssistanceDataBuilderSet assistanceData;
|
|
271 |
ArgUtils::PopulateLC(assistanceData);
|
|
272 |
reason = KErrNone;
|
|
273 |
proxy->CallL(ENetMsgProcessAssistanceData, &dataMask, &assistanceData, &reason);
|
|
274 |
CleanupStack::PopAndDestroy(); // assistanceData
|
|
275 |
|
|
276 |
// << ProcessLocationRequest(SessionId, HybridMode, alpha2)
|
|
277 |
TBool emergency = EFalse;
|
|
278 |
MLbsNetworkProtocolObserver::TLbsNetProtocolService service = MLbsNetworkProtocolObserver::EServiceSelfLocation;
|
|
279 |
TLbsNetPosRequestQuality quality = ArgUtils::Quality();
|
|
280 |
quality.SetMaxFixTime(ArgUtils::Alpha2());
|
|
281 |
TLbsNetPosRequestMethod method = ArgUtils::RequestHybridMethod();
|
|
282 |
proxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method);
|
|
283 |
|
|
284 |
// Now that the hybrid/alpha2 has been requested, record current time to verify alpha2 timer expires correctly.
|
|
285 |
TTime startTime;
|
|
286 |
startTime.HomeTime();
|
|
287 |
|
|
288 |
// >> RequestAssistanceData(0)
|
|
289 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData);
|
|
290 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask);
|
|
291 |
TESTL(dataMask == EAssistanceDataNone);
|
|
292 |
CleanupStack::PopAndDestroy(cleanupCnt);
|
|
293 |
|
|
294 |
// << NotifyPositionUpdate()
|
|
295 |
pWatch->IssueNotifyPositionUpdate();
|
|
296 |
|
|
297 |
// >> RequestAssistanceData(0)
|
|
298 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData);
|
|
299 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask);
|
|
300 |
TESTL(dataMask == EAssistanceDataNone);
|
|
301 |
CleanupStack::PopAndDestroy(cleanupCnt);
|
|
302 |
// Determine the value to take off the alpha2 value. This is required because we had to wait for the assistance data response.
|
|
303 |
TTimeIntervalMicroSeconds microseconds;
|
|
304 |
TTime stopTime;
|
|
305 |
stopTime.HomeTime();
|
|
306 |
microseconds = stopTime.MicroSecondsFrom(startTime);
|
|
307 |
TInt64 timeElapsed = microseconds.Int64();
|
|
308 |
TInt delta = 2 * 1000 * 1000; // 2 secs.
|
|
309 |
|
|
310 |
// >> RespondLocationRequest()
|
|
311 |
TESTL(proxy->WaitForResponse(ArgUtils::Alpha2() - timeElapsed - delta) == ENetMsgTimeoutExpired);
|
|
312 |
|
|
313 |
// Wait for and process the response.
|
|
314 |
TESTL(proxy->WaitForResponse(2 * delta) == ENetMsgRespondLocationRequest); // DONT get because the measurement data bus has not been created...
|
|
315 |
|
|
316 |
sessionId = NULL;
|
|
317 |
TPositionGpsMeasurementInfo* measurementInfo = NULL;
|
|
318 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRespondLocationRequest, &sessionId, &reason, &measurementInfo);
|
|
319 |
TESTL(sessionId->SessionNum() == iSessionId.SessionNum());
|
|
320 |
TESTL(reason == KErrNone);
|
|
321 |
CleanupStack::PopAndDestroy(cleanupCnt);//sessionId, measurementInfo
|
|
322 |
|
|
323 |
// Recv -> RequestAssistanceData - we get an extra msg as the result of the A-GPS manager re-issueing a location request when it's
|
|
324 |
// max fix time timer expries.
|
|
325 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData);
|
|
326 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask);
|
|
327 |
TESTL(dataMask == EAssistanceDataNone);
|
|
328 |
CleanupStack::PopAndDestroy(cleanupCnt);
|
|
329 |
const TInt t = 8 * 1000 * 1000; // 8 secs.
|
|
330 |
quality.SetMaxFixTime(t);
|
|
331 |
|
|
332 |
TPositionExtendedSatelliteInfo* positionInfo = NULL;
|
|
333 |
//TPositionInfo* positionInfo = NULL;
|
|
334 |
|
|
335 |
for (TInt i = 0; i < KN; i++)
|
|
336 |
{
|
|
337 |
// << ProcessLocationRequest(SessionId, HybridMode, t)
|
|
338 |
proxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method);
|
|
339 |
|
|
340 |
// >> RequestAssistanceData(0)
|
|
341 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData);
|
|
342 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask);
|
|
343 |
TESTL(dataMask == EAssistanceDataNone);
|
|
344 |
CleanupStack::PopAndDestroy(cleanupCnt);
|
|
345 |
|
|
346 |
// >> RespondLocationRequest() - first measurement, second position.
|
|
347 |
TESTL(proxy->WaitForResponse(t + delta) == ENetMsgRespondLocationRequest);
|
|
348 |
|
|
349 |
sessionId = NULL;
|
|
350 |
|
|
351 |
// Expect measurement first time.
|
|
352 |
if (i < (KN-1))
|
|
353 |
{
|
|
354 |
measurementInfo = NULL;
|
|
355 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRespondLocationRequest, &sessionId, &reason, &measurementInfo);
|
|
356 |
|
|
357 |
// Check it is measurement
|
|
358 |
TESTL(measurementInfo->PositionClassType() == EPositionGpsMeasurementInfoClass);
|
|
359 |
|
|
360 |
// >> RequestAssistanceData - we get an extra msg as the result of the A-GPS manager re-issueing a location request when it's
|
|
361 |
// max fix time timer expries.
|
|
362 |
TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData);
|
|
363 |
|
|
364 |
cleanupCnt += proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask);
|
|
365 |
|
|
366 |
TESTL(dataMask == EAssistanceDataNone);
|
|
367 |
TESTL(sessionId->SessionNum() == iSessionId.SessionNum());
|
|
368 |
TESTL(reason == KErrNone);
|
|
369 |
}
|
|
370 |
|
|
371 |
// Expect position second time.
|
|
372 |
else
|
|
373 |
{
|
|
374 |
cleanupCnt = proxy->GetArgsLC(ENetMsgRespondLocationRequest, &sessionId, &reason, &positionInfo);
|
|
375 |
|
|
376 |
// check it is a position
|
|
377 |
TESTL(positionInfo->PositionClassType() == (EPositionInfoClass|EPositionCourseInfoClass|EPositionSatelliteInfoClass|EPositionExtendedSatelliteInfoClass));
|
|
378 |
TESTL(sessionId->SessionNum() == iSessionId.SessionNum());
|
|
379 |
TESTL(reason == KErrNone);
|
|
380 |
/* Check whether ExtendedSatelliteInfo data received by protocol module is the same as data fed to the GPS module or not.
|
|
381 |
Latitude(50.2454),Longitude(0.1668),Altitude(1.0),HorizontalAccuracy(10),VerticalAccuracy(10), speed(26.0),vertical speed(20.0),heading(25.0),course(30.0),
|
|
382 |
SPEED_ACCURACY(2.0),VERTICAL_SPEED_ACCURACY(3.0),HEADING_ACCURACY(10.0),COURSE_ACCURACY(4.0),
|
|
383 |
SD_OF_LONG_ERROR(5.0),SD_OF_LAT_ERROR(6.0),SD_OF_ALT_ERROR(7.0),SD_OF_SEMI_MAJOR_AXIS_ERROR(8.0),
|
|
384 |
SD_OF_SEMI_MINOR_AXIS_ERROR(9.0),ORIEN_OF_SEMI_MAJOR_AXIS_ERROR(10.0),RMS_VAL_OF_SD_OF_RANGE(11.0),
|
|
385 |
GEOIDAL_SEPARATION(12.0),MAGNETIC_VARIATION(13.0),COURSE_OVER_GROUND_MAGNETIC(14.0)
|
|
386 |
GPS_TIMING_OF_CELL_MsPart(16383),GPS_TIMING_OF_CELL_LsPart(4294967295),REFERENCE_IDENTITY(511)
|
|
387 |
SFN(4095)*/
|
|
388 |
|
|
389 |
TPosition gpsPos;
|
|
390 |
positionInfo->GetPosition(gpsPos);
|
|
391 |
TESTL(gpsPos.Latitude()==50.2454 && gpsPos.Longitude()== 0.1668 && gpsPos.Altitude()==1.0
|
|
392 |
&& gpsPos.HorizontalAccuracy()==10 && gpsPos.VerticalAccuracy()==10);
|
|
393 |
TCourse course;
|
|
394 |
positionInfo->GetCourse(course);
|
|
395 |
|
|
396 |
TESTL(course.Speed()==26.0 && course.VerticalSpeed()==20.0 && course.Heading()==25.0 && course.Course()==30.0 &&
|
|
397 |
course.SpeedAccuracy()==2.0 && course.VerticalSpeedAccuracy()==3.0 && course.HeadingAccuracy()==10.0 &&
|
|
398 |
course.CourseAccuracy()==4.0);
|
|
399 |
|
|
400 |
TDetailedErrorReport detErrRep;
|
|
401 |
positionInfo->GetDetailedErrorReport(detErrRep);
|
|
402 |
TESTL(detErrRep.StanDeviOfLongitudeError()==5.0 && detErrRep.StanDeviOfLatiitudeError()==6.0 &&
|
|
403 |
detErrRep.StanDeviOfAltitudeError()==7.0 && detErrRep.StanDeviOfSemiMajorAxisError()==8.0 &&
|
|
404 |
detErrRep.StanDeviOfSemiMinorAxisError()==9.0 && detErrRep.OrientationOfSemiMajorAxisError()==10.0 &&
|
|
405 |
detErrRep.RmsValOfStanDeviOfRange()==11.0);
|
|
406 |
|
|
407 |
TGpsTimingMeasurementData gpsTimingData;
|
|
408 |
positionInfo->GetGpsTimingData(gpsTimingData);
|
|
409 |
|
|
410 |
TESTL(gpsTimingData.DataType()== TGpsTimingMeasurementData::EGpsTimingDataTypeUtran &&
|
|
411 |
gpsTimingData.NetworkMode()== TGpsTimingMeasurementData::ENetworkModeFdd &&
|
|
412 |
gpsTimingData.GPSTimingOfCellMsPart()==16383 && gpsTimingData.GPSTimingOfCellLsPart()==4294967295UL &&
|
|
413 |
gpsTimingData.ReferenceIdentity()==511 && gpsTimingData.Sfn()==4095);
|
|
414 |
|
|
415 |
|
|
416 |
TESTL(positionInfo->GeoidalSeparation()==12.0 && positionInfo->MagneticVariation()==13.0 &&
|
|
417 |
positionInfo->CourseOverGroundMagnetic()==14.0);
|
|
418 |
|
|
419 |
|
|
420 |
// Client recv - the gps position determined by the gps module.
|
|
421 |
CheckForObserverEventTestsL(KTimeOut, *this);
|
|
422 |
TESTL(iState == EGpsLocReceived);
|
|
423 |
|
|
424 |
// << ProcessLocationUpdate(SessionId, FinalNetworkPosition)
|
|
425 |
// Return modules' position as FinalNetworkPosition
|
|
426 |
proxy->CallL(ENetMsgProcessLocationUpdate, &iSessionId, positionInfo);
|
|
427 |
}
|
|
428 |
CleanupStack::PopAndDestroy(cleanupCnt);// sessionId, measurementInfo/positionInfo
|
|
429 |
}
|
|
430 |
|
|
431 |
|
|
432 |
// << ProcessSessionComplete(SessionId, KErrNone)
|
|
433 |
reason = KErrNone;
|
|
434 |
proxy->CallL(ENetMsgProcessSessionComplete, &iSessionId, &reason);
|
|
435 |
|
|
436 |
// << ENetMsgProcessStatusUpdate()
|
|
437 |
MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask serviceMask = MLbsNetworkProtocolObserver::EServiceNone;
|
|
438 |
proxy->CallL(ENetMsgProcessStatusUpdate, &serviceMask);
|
|
439 |
|
|
440 |
// Wait for 10 seconds to ensure no additional responses turn up.
|
|
441 |
delta = 10 * 1000 * 1000;
|
|
442 |
TNetProtocolResponseType mType = proxy->WaitForResponse(delta);
|
|
443 |
TESTL(mType == ENetMsgTimeoutExpired);
|
|
444 |
|
|
445 |
// Done. Now cleanup...
|
|
446 |
CleanupStack::PopAndDestroy(pWatch);
|
|
447 |
CleanupStack::PopAndDestroy(); // pos
|
|
448 |
CleanupStack::PopAndDestroy(); // server
|
|
449 |
CleanupStack::PopAndDestroy(proxy);
|
|
450 |
|
|
451 |
return TestStepResult();
|
|
452 |
|
|
453 |
}
|
|
454 |
}
|
|
455 |
|
|
456 |
|
|
457 |
// MPosServerObserver
|
|
458 |
void CT_LbsHybridUEAssistedMOLRGPSOk::OnGetLastKnownPosition(TInt32 /*aErr*/, const TPositionInfoBase& /*aPosInfo*/)
|
|
459 |
{
|
|
460 |
TEST(EFalse); // Shouldn't see this...
|
|
461 |
ReturnToTestStep();
|
|
462 |
}
|
|
463 |
|
|
464 |
void CT_LbsHybridUEAssistedMOLRGPSOk::OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo)
|
|
465 |
{
|
|
466 |
// Verify error.
|
|
467 |
if (aErr == KErrCancel)
|
|
468 |
{
|
|
469 |
iState = ERefLocReceived;
|
|
470 |
}
|
|
471 |
else
|
|
472 |
{
|
|
473 |
TEST(aErr == KErrNone);
|
|
474 |
|
|
475 |
// Verify position.
|
|
476 |
TEST(aPosInfo.PositionClassType() == EPositionInfoClass);
|
|
477 |
|
|
478 |
// Expecting ref pos.
|
|
479 |
if (iState == EInitializing)
|
|
480 |
{
|
|
481 |
iState = ERefLocReceived;
|
|
482 |
|
|
483 |
TEST(aPosInfo.PositionMode() == TPositionModuleInfo::ETechnologyNetwork);
|
|
484 |
|
|
485 |
// check for refpos details
|
|
486 |
const TPositionInfo posInfo = static_cast<const TPositionInfo&>(aPosInfo);
|
|
487 |
TESTL(ArgUtils::ComparePositionInfoToMolrRefPos(posInfo));
|
|
488 |
}
|
|
489 |
|
|
490 |
// Expecting network pos.
|
|
491 |
else if (iState == ERefLocReceived)
|
|
492 |
{
|
|
493 |
iState = EGpsLocReceived;
|
|
494 |
|
|
495 |
TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted));
|
|
496 |
}
|
|
497 |
|
|
498 |
// Not expecting anything else.
|
|
499 |
else
|
|
500 |
{
|
|
501 |
TEST(EFalse);
|
|
502 |
}
|
|
503 |
}
|
|
504 |
ReturnToTestStep();
|
|
505 |
}
|