|
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 contains the header file for MT-LR GPS mode options Tests |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __CT_LBS_MTLR_RESET_ASSISTANCE_H__ |
|
19 #define __CT_LBS_MTLR_RESET_ASSISTANCE_H__ |
|
20 |
|
21 // LBS includes. |
|
22 #include <lbs.h> |
|
23 #include <lbscommon.h> |
|
24 #include <lbs/lbsprivacycontroller.h> |
|
25 #include <lbs/lbsadmin.h> |
|
26 |
|
27 // LBS test includes. |
|
28 #include "ctlbshybridmtlrstep.h" |
|
29 #include <lbs/test/lbsnetprotocolproxy.h> |
|
30 #include <lbs/test/transmitserverwatch.h> |
|
31 |
|
32 // Literals used |
|
33 _LIT(KLbsMTLRResetAssistance, "LbsMTLRResetAssistance"); |
|
34 |
|
35 class CT_LbsMTLRResetAssistance : public CT_LbsHybridMTLRStep, public MLbsPrivacyObserver |
|
36 { |
|
37 public: |
|
38 ~CT_LbsMTLRResetAssistance(); |
|
39 |
|
40 static CT_LbsMTLRResetAssistance* New(CT_LbsHybridMTLRServer& aParent); |
|
41 virtual TVerdict doTestStepPreambleL(); |
|
42 virtual TVerdict doTestStepPostambleL(); |
|
43 virtual TVerdict doTestStepL(); |
|
44 |
|
45 |
|
46 protected: |
|
47 CT_LbsMTLRResetAssistance(CT_LbsHybridMTLRServer& aParent); |
|
48 void ConstructL(); |
|
49 |
|
50 protected: |
|
51 // from MLbsPrivacyObserver |
|
52 void ProcessNetworkLocationRequest(TUint aRequestId, const TLbsExternalRequestInfo& aRequestInfo, const TNotificationType& aNotificationType); |
|
53 void ProcessNetworkPositionUpdate(TUint aRequestId, const TPositionInfo& aPosInfo); |
|
54 void ProcessRequestComplete(TUint aRequestId, TInt aReason); |
|
55 |
|
56 private: |
|
57 TLbsNetPosRequestMethod RequestNetworkMethod(TBool aWarmUp); |
|
58 void DecideWhatNetworkReceives(); |
|
59 TBool SendResetAssistanceDataL(); |
|
60 |
|
61 private: |
|
62 enum TChosenNetworkMethod |
|
63 { |
|
64 ENetworkMethodInvalid, |
|
65 ETerminalBasedNetworkMethod, |
|
66 ETerminalBasedTerminalAssistedNetworkMethod, |
|
67 ETerminalAssistedNetworkMethod, |
|
68 ETerminalAssistedTerminalBasedNetworkMethod, |
|
69 EAutonomousNetworkMethod, |
|
70 ENetworkMethodNotSet |
|
71 }; |
|
72 enum TPlannedPositionOriginator |
|
73 { |
|
74 EPositionOriginatorUnkown, |
|
75 EPositionOriginatorModule, |
|
76 EPositionOriginatorNetwork |
|
77 }; |
|
78 enum TNetworkStep |
|
79 { |
|
80 EInitial, |
|
81 EBeforeSession, |
|
82 EBeginningOfSession, |
|
83 EAfterAssistanceData, |
|
84 EAfterMeasurements, |
|
85 EAfterPosition, |
|
86 EAfterSessionClose |
|
87 }; |
|
88 |
|
89 TLbsNetSessionId iSessionId; |
|
90 CNetProtocolProxy* iProxy; |
|
91 |
|
92 /** Used so the network requests the method specified in the ini file */ |
|
93 TChosenNetworkMethod iNetworkMethod; |
|
94 /** Used so the network proxy knows if it should return the positions |
|
95 or should let the module calculate it in hybrid case */ |
|
96 TPlannedPositionOriginator iPlannedPositionOriginator; |
|
97 /** Used so the network proxy knows what to expect */ |
|
98 TBool iNetworkExpectsMeasurements; |
|
99 TBool iNetworkExpectsPositions; |
|
100 /* If network requests a mode that the module does not support it will be rejected */ |
|
101 TBool iNetRequestRejected; |
|
102 |
|
103 enum TState |
|
104 { |
|
105 EInitializing, |
|
106 EPrivacyCheckOk, |
|
107 ERefLocReceived, |
|
108 EGpsLocReceived, |
|
109 ERequestComplete |
|
110 }; |
|
111 |
|
112 TState iState; |
|
113 CLbsPrivacyController* iController; |
|
114 |
|
115 /** So we know what to expect when network doesn't specify mode */ |
|
116 CLbsAdmin::TGpsMode iAdminGpsMode; |
|
117 |
|
118 TNetworkStep iStepForSendingReset; |
|
119 TBool iWarmUpModule; |
|
120 TLbsAsistanceDataGroup iResetMask; |
|
121 }; |
|
122 |
|
123 #endif //__CT_LBS_MTLR_RESET_ASSISTANCE_H__ |