|
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 tlbschannelutils.h |
|
15 // This is the header file which contains the msg data types and other utilities |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalTechnology |
|
22 @test |
|
23 */ |
|
24 |
|
25 #ifndef TLBSCHANNELUTILS_H |
|
26 #define TLBSCHANNELUTILS_H |
|
27 |
|
28 #include <lbs/test/tlbsutils.h> |
|
29 |
|
30 |
|
31 /* Key value used to publish messages from Test Harness to Test AGPS Module |
|
32 and the corresponding acknowledgement */ |
|
33 const TUint KTH2TAGPSMessageKey = 0x0F001010; |
|
34 const TUint KTH2TAGPSMessageReadAckKey = 0x0F001020; |
|
35 /* Key value used to publish messages from Test AGPS Module to Test Harness |
|
36 and the corresponding acknowledgement */ |
|
37 const TUint KTAGPS2THMessageKey = 0x0F001030; |
|
38 const TUint KTAGPS2THMessageReadAckKey = 0x0F001040; |
|
39 |
|
40 |
|
41 |
|
42 /** Base class for messages sent between the Test Harness and Test A-Gps Module. |
|
43 |
|
44 This class defines the types of messages and reserves a buffer to store |
|
45 information, but it can't be used itself. Instead derived classes will |
|
46 implement each of the types of messages and supply accessor functions. |
|
47 |
|
48 */ |
|
49 class TT_LbsMsgBase |
|
50 { |
|
51 public: |
|
52 /** List of all possible message types. |
|
53 |
|
54 Each type of message listed here must be implemented as a |
|
55 separate class that inherits from TLbsNetInternalMsgBase. |
|
56 */ |
|
57 enum TLbsMsgType |
|
58 { |
|
59 EUnknown = 0, |
|
60 EModuleRequestUpdateInit, // TH --> AGPS-Module |
|
61 EModuleRequestTimeOut, // TH --> AGPS-Module |
|
62 EModuleRequestOptions, // TH --> AGPS-Module |
|
63 EModuleRequestError, // TH --> AGPS-Module |
|
64 EModuleRequestForcedUpdate, // TH --> AGPS-Module |
|
65 EModuleResponse, // AGPS-Module --> TH |
|
66 EModuleImmediateMeasurements// TH --> AGPS-Module |
|
67 }; |
|
68 |
|
69 public: |
|
70 IMPORT_C TT_LbsMsgBase(); |
|
71 |
|
72 IMPORT_C TLbsMsgType Type() const; |
|
73 |
|
74 protected: |
|
75 // Derived classes set their type by using these constructors. |
|
76 IMPORT_C TT_LbsMsgBase(TLbsMsgType aType); |
|
77 |
|
78 private: |
|
79 TLbsMsgType iType; |
|
80 |
|
81 protected: |
|
82 // A TUint64 is used to ensure that any objects that use the buffer |
|
83 // are at least 8byte aligned. (The compiler will organise the arrangement |
|
84 // of iBuffer within TLbsNetInternalMsgBase to be aligned to the minimum |
|
85 // for a TUint64, which is 8bytes.) |
|
86 TUint64 iBuffer[((1576 - (sizeof(TLbsMsgType))) >> 3)]; |
|
87 }; |
|
88 |
|
89 /** |
|
90 Test A-Gps Module Request UpdateInit Message |
|
91 */ |
|
92 NONSHARABLE_CLASS(TT_LbsAGpsRequestUpdateInitMsg) : public TT_LbsMsgBase |
|
93 { |
|
94 public: |
|
95 IMPORT_C TT_LbsAGpsRequestUpdateInitMsg(const TDesC& aConfigFileName, const TDesC& aConfigSection); |
|
96 |
|
97 IMPORT_C const TDesC& ConfigFileName() const; |
|
98 IMPORT_C const TDesC& ConfigSection() const; |
|
99 |
|
100 private: |
|
101 TT_LbsAGpsRequestUpdateInitMsg(); |
|
102 |
|
103 private: |
|
104 struct ST_LbsAGpsRequestUpdateInit |
|
105 { |
|
106 TBuf<KMaxModuleDataBusIniFileName> iConfigFileName; /** Config request data. */ |
|
107 TBuf<40> iConfigSection; /** Config request data. */ |
|
108 }; |
|
109 |
|
110 inline ST_LbsAGpsRequestUpdateInit& Data(); |
|
111 inline const ST_LbsAGpsRequestUpdateInit& Data() const; |
|
112 }; |
|
113 |
|
114 /** |
|
115 Test A-Gps Module Request TimeOut Message |
|
116 */ |
|
117 NONSHARABLE_CLASS(TT_LbsAGpsRequestTimeOut) : public TT_LbsMsgBase |
|
118 { |
|
119 public: |
|
120 IMPORT_C TT_LbsAGpsRequestTimeOut(const TTimeIntervalMicroSeconds& aTimeOut); |
|
121 IMPORT_C const TTimeIntervalMicroSeconds& TimeOut() const; |
|
122 |
|
123 private: |
|
124 TT_LbsAGpsRequestTimeOut(); |
|
125 |
|
126 private: |
|
127 struct ST_LbsAGpsRequestTimeOut |
|
128 { |
|
129 TTimeIntervalMicroSeconds iTimeOut; /** Module time out. */ |
|
130 }; |
|
131 inline ST_LbsAGpsRequestTimeOut& Data(); |
|
132 inline const ST_LbsAGpsRequestTimeOut& Data() const; |
|
133 }; |
|
134 |
|
135 |
|
136 /** |
|
137 Test A-Gps Module Immediate Measurements Message |
|
138 */ |
|
139 NONSHARABLE_CLASS(TT_LbsAGpsImmediateMeasurements) : public TT_LbsMsgBase |
|
140 { |
|
141 public: |
|
142 IMPORT_C TT_LbsAGpsImmediateMeasurements(TInt aImmediateMeasurements); |
|
143 IMPORT_C TInt ImmediateMeasurements() const; |
|
144 |
|
145 private: |
|
146 TT_LbsAGpsImmediateMeasurements(); |
|
147 |
|
148 private: |
|
149 struct ST_LbsAGpsImmediateMeasurements |
|
150 { |
|
151 TInt iImmediateMeasurements; /** Immediate Measurements */ |
|
152 }; |
|
153 |
|
154 inline ST_LbsAGpsImmediateMeasurements& Data(); |
|
155 inline const ST_LbsAGpsImmediateMeasurements& Data() const; |
|
156 }; |
|
157 |
|
158 |
|
159 /** |
|
160 Test A-Gps Module Request Options Message |
|
161 */ |
|
162 NONSHARABLE_CLASS(TT_LbsAGpsRequestOptions) : public TT_LbsMsgBase |
|
163 { |
|
164 public: |
|
165 IMPORT_C TT_LbsAGpsRequestOptions(TLbsHybridModuleOptions aModuleOption); |
|
166 IMPORT_C TT_LbsAGpsRequestOptions(TLbsHybridModuleOptions aModuleOption, TBool aOptionValue); |
|
167 |
|
168 IMPORT_C TLbsHybridModuleOptions ModuleOption() const; |
|
169 IMPORT_C TBool ModuleValue() const; |
|
170 |
|
171 private: |
|
172 TT_LbsAGpsRequestOptions(); |
|
173 |
|
174 private: |
|
175 struct ST_LbsAGpsRequestOptions |
|
176 { |
|
177 TLbsHybridModuleOptions iModuleOption; // Module option |
|
178 TBool iModuleValue; // Value for the module option |
|
179 }; |
|
180 |
|
181 inline ST_LbsAGpsRequestOptions& Data(); |
|
182 inline const ST_LbsAGpsRequestOptions& Data() const; |
|
183 }; |
|
184 |
|
185 /** |
|
186 Test A-Gps Module Request Error Message |
|
187 */ |
|
188 NONSHARABLE_CLASS(TT_LbsAGpsRequestError) : public TT_LbsMsgBase |
|
189 { |
|
190 public: |
|
191 IMPORT_C TT_LbsAGpsRequestError(TInt aOptions); |
|
192 IMPORT_C TInt Error() const; |
|
193 |
|
194 private: |
|
195 TT_LbsAGpsRequestError(); |
|
196 |
|
197 private: |
|
198 struct ST_LbsAGpsRequestError |
|
199 { |
|
200 TInt iError; /** Module Error Code */ |
|
201 }; |
|
202 |
|
203 inline ST_LbsAGpsRequestError& Data(); |
|
204 inline const ST_LbsAGpsRequestError& Data() const; |
|
205 }; |
|
206 |
|
207 /** |
|
208 Test A-Gps Module Request Forced Update Message |
|
209 |
|
210 This message forces the test A-Gps module to send |
|
211 the next position update from the update array |
|
212 now, even if there is no outstanding request from LBS. |
|
213 */ |
|
214 NONSHARABLE_CLASS(TT_LbsAGpsRequestForcedUpdate) : public TT_LbsMsgBase |
|
215 { |
|
216 public: |
|
217 IMPORT_C TT_LbsAGpsRequestForcedUpdate(); |
|
218 |
|
219 private: |
|
220 struct ST_LbsAGpsRequestForcedUpdate |
|
221 { |
|
222 TInt iDummy; /** Dummy value; unused */ |
|
223 }; |
|
224 |
|
225 inline ST_LbsAGpsRequestForcedUpdate& Data(); |
|
226 inline const ST_LbsAGpsRequestForcedUpdate& Data() const; |
|
227 }; |
|
228 |
|
229 /** |
|
230 Test A-Gps Module Response Message |
|
231 */ |
|
232 NONSHARABLE_CLASS(TT_LbsAGpsResponseMsg) : public TT_LbsMsgBase |
|
233 { |
|
234 public: |
|
235 |
|
236 enum TModuleResponseType |
|
237 { |
|
238 EModuleResponseOk, |
|
239 EModuleErr |
|
240 }; |
|
241 |
|
242 IMPORT_C TT_LbsAGpsResponseMsg(const TModuleResponseType& aResponse); |
|
243 |
|
244 IMPORT_C TModuleResponseType ResponseType() const; |
|
245 |
|
246 private: |
|
247 TT_LbsAGpsResponseMsg(); |
|
248 |
|
249 private: |
|
250 |
|
251 struct ST_LbsAGpsResponse |
|
252 { |
|
253 TModuleResponseType iResponseType; |
|
254 }; |
|
255 |
|
256 inline ST_LbsAGpsResponse& Data(); |
|
257 inline const ST_LbsAGpsResponse& Data() const; |
|
258 }; |
|
259 |
|
260 #endif // TLBSCHANNELUTILS_H |