|
1 // Copyright (c) 2006-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 // Header file for the api for talking to the stub protocol module. |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef LBSNETGATEWAYPROTOCOLTESTAPI_H_ |
|
19 #define LBSNETGATEWAYPROTOCOLTESTAPI_H_ |
|
20 |
|
21 #include <e32property.h> |
|
22 #include <lbs/lbslocdatasourcegpsbase.h> |
|
23 #include <lbs/lbsassistancedatabuilderset.h> |
|
24 #include <lbs/lbsnetcommon.h> |
|
25 #include <lbs/lbsnetprotocolbase.h> |
|
26 #include <lbs/lbsextendedsatellite.h> |
|
27 |
|
28 const TUint KTe_LbsNetGatewayTestProtocolIndex = 0; |
|
29 const TUid KTe_LbsNetGatewayTestProtocolUid = { 0x10282250 }; |
|
30 const TUint KTe_LbsNetGatewayTestProtocolIndex2 = 1; |
|
31 const TUid KTe_LbsNetGatewayTestProtocolUid2 = { 0x10285AB9 }; |
|
32 |
|
33 const TUint KTe_LbsNetGatewayTestProtocolIndex3 = 2; |
|
34 const TUid KTe_LbsNetGatewayTestProtocolUid3 = { 0x102871C8 }; |
|
35 |
|
36 const TUint KTe_LbsNetGatewayTestProtocolIndex4 = 3; |
|
37 const TUid KTe_LbsNetGatewayTestProtocolUid4 = { 0x102871C9 }; |
|
38 |
|
39 const TUint KTe_LbsNetGatewayTestProtocolIndex5 = 4; |
|
40 const TUid KTe_LbsNetGatewayTestProtocolUid5 = { 0x102871CA }; |
|
41 |
|
42 const TUint KTe_LbsNetGatewayTestProtocolIndex6 = 5; |
|
43 const TUid KTe_LbsNetGatewayTestProtocolUid6 = { 0x102871CB }; |
|
44 |
|
45 const TUint KTe_LbsNetGatewayTestProtocolIndex7 = 6; |
|
46 const TUid KTe_LbsNetGatewayTestProtocolUid7 = { 0x102871CC }; |
|
47 |
|
48 const TUint KTe_LbsNetGatewayTestProtocolIndex8 = 7; |
|
49 const TUid KTe_LbsNetGatewayTestProtocolUid8 = { 0x102871CD }; |
|
50 |
|
51 const TUint KTe_LbsNetGatewayTestProtocolIndex9 = 8; |
|
52 const TUid KTe_LbsNetGatewayTestProtocolUid9 = { 0x102871CE }; |
|
53 |
|
54 const TUint KTe_LbsNetGatewayTestProtocolIndex10 = 9; |
|
55 const TUid KTe_LbsNetGatewayTestProtocolUid10 = { 0x102871CF }; |
|
56 |
|
57 const TUint KTe_LbsNetGatewayTestProtocolIndex11 = 10; |
|
58 const TUid KTe_LbsNetGatewayTestProtocolUid11 = { 0x102871D0 }; |
|
59 |
|
60 //10 PM uids for roaming modules |
|
61 const TUint KTe_LbsNetGatewayTestProtocolIndex12 = 11; |
|
62 const TUid KTe_LbsNetGatewayTestProtocolUid12 = { 0x102871D1 }; |
|
63 |
|
64 const TUint KTe_LbsNetGatewayTestProtocolIndex13 = 12; |
|
65 const TUid KTe_LbsNetGatewayTestProtocolUid13 = { 0x102871D2 }; |
|
66 |
|
67 const TUint KTe_LbsNetGatewayTestProtocolIndex14 = 13; |
|
68 const TUid KTe_LbsNetGatewayTestProtocolUid14 = { 0x102871D3 }; |
|
69 |
|
70 const TUint KTe_LbsNetGatewayTestProtocolIndex15 = 14; |
|
71 const TUid KTe_LbsNetGatewayTestProtocolUid15 = { 0x102871D4 }; |
|
72 |
|
73 const TUint KTe_LbsNetGatewayTestProtocolIndex16 = 15; |
|
74 const TUid KTe_LbsNetGatewayTestProtocolUid16 = { 0x102871D5 }; |
|
75 |
|
76 const TUint KTe_LbsNetGatewayTestProtocolIndex17 = 16; |
|
77 const TUid KTe_LbsNetGatewayTestProtocolUid17 = { 0x102871D6 }; |
|
78 |
|
79 const TUint KTe_LbsNetGatewayTestProtocolIndex18 = 17; |
|
80 const TUid KTe_LbsNetGatewayTestProtocolUid18 = { 0x102871D7 }; |
|
81 |
|
82 const TUint KTe_LbsNetGatewayTestProtocolIndex19 = 18; |
|
83 const TUid KTe_LbsNetGatewayTestProtocolUid19 = { 0x102871D8 }; |
|
84 |
|
85 const TUint KTe_LbsNetGatewayTestProtocolIndex20 = 19; |
|
86 const TUid KTe_LbsNetGatewayTestProtocolUid20 = { 0x102871D9 }; |
|
87 |
|
88 |
|
89 |
|
90 // |
|
91 // Base Message Type |
|
92 // |
|
93 |
|
94 enum TNetGatewayMsgType |
|
95 { |
|
96 ENetMsgUnknown = 0, |
|
97 |
|
98 // Messages coming from test code to PM. |
|
99 ENetMsgProcessPrivacyRequest = 1000, |
|
100 ENetMsgProcessLocationRequest, |
|
101 ENetMsgProcessSessionComplete, |
|
102 ENetMsgProcessAssistanceData, |
|
103 ENetMsgProcessLocationUpdate, |
|
104 ENetMsgGetCurrentCapabilitiesRequest, |
|
105 ENetMsgProcessStatusUpdate, |
|
106 |
|
107 // Messages coming from PM to test code. |
|
108 ENetMsgRespondPrivacyRequest = 2000, |
|
109 ENetMsgRespondLocationRequest, |
|
110 ENetMsgRequestTransmitLocation, |
|
111 ENetMsgCancelTransmitLocation, |
|
112 ENetMsgRequestAssistanceData, |
|
113 ENetMsgRequestSelfLocation, |
|
114 ENetMsgCancelSelfLocation, |
|
115 ENetMsgRequestNetworkLocation, |
|
116 ENetMsgCancelNetworkLocation, |
|
117 ENetMsgGetCurrentCapabilitiesResponse, |
|
118 |
|
119 // Special test message to force the NetGateway to shutdown |
|
120 ENetMsgShutdownNetGateway, |
|
121 |
|
122 ENetMsgCancelExternalLocation=2015 |
|
123 }; |
|
124 |
|
125 |
|
126 /* Base message class used to pass data. |
|
127 */ |
|
128 class TNetGatewayMsg |
|
129 { |
|
130 public: |
|
131 TNetGatewayMsg() : iType(ENetMsgUnknown) {} |
|
132 |
|
133 TAny* Data() { return reinterpret_cast<TAny*>(iBuffer); } |
|
134 const TAny* Data() const { return reinterpret_cast<const TAny*>(iBuffer); } |
|
135 |
|
136 public: |
|
137 TNetGatewayMsgType iType; |
|
138 |
|
139 private: |
|
140 TUint32 iBuffer[1024 - sizeof(TNetGatewayMsgType)]; |
|
141 }; |
|
142 |
|
143 // |
|
144 // Channel interface |
|
145 // |
|
146 |
|
147 /* Definition of keys use for each property |
|
148 */ |
|
149 const TUint KChannelAckOffset = 0x800; |
|
150 const TUint KNetProtocolChannelKey = 0x10001000; |
|
151 const TUint KNetProtocolChannelAckKey = (KNetProtocolChannelKey + KChannelAckOffset); |
|
152 const TUint KTestAppChannelKey = 0x10002000; |
|
153 const TUint KTestAppChannelAckKey = (KTestAppChannelKey + KChannelAckOffset); |
|
154 const TUint KAgpsDataSetKey = 0x10003000; |
|
155 |
|
156 class CNetProtocolMessageListener; |
|
157 class CNetProtocolMessageTransmitter; |
|
158 |
|
159 /* Obsever for messages arriving. |
|
160 */ |
|
161 class MNetGatewayProtocolTestObserver |
|
162 { |
|
163 public: |
|
164 virtual void ProcessNetProtocolMessage(const TNetGatewayMsg& aMessage) = 0; |
|
165 }; |
|
166 |
|
167 /* Interface to the channel. |
|
168 */ |
|
169 class RNetGatewayProtocolTestChannel |
|
170 { |
|
171 public: |
|
172 IMPORT_C RNetGatewayProtocolTestChannel(TUint aModuleIndex); |
|
173 IMPORT_C RNetGatewayProtocolTestChannel(); |
|
174 |
|
175 IMPORT_C static void InitialiseL(TUint aModuleIndex); |
|
176 IMPORT_C static void Shutdown(TUint aModuleIndex); |
|
177 |
|
178 IMPORT_C void OpenL(TUint aTxKey, TUint aRxKey, MNetGatewayProtocolTestObserver& aRxObserver); |
|
179 IMPORT_C void OpenL(TUint aTxKey, TUint aRxKey, MNetGatewayProtocolTestObserver& aRxObserver, TUint aModuleIndex); |
|
180 IMPORT_C void Close(); |
|
181 |
|
182 IMPORT_C void SendNetProtocolMessageL(const TNetGatewayMsg& aMessage); |
|
183 |
|
184 private: |
|
185 CNetProtocolMessageListener* iListener; |
|
186 CNetProtocolMessageTransmitter* iTransmitter; |
|
187 TUint iModuleIndex; |
|
188 }; |
|
189 |
|
190 // |
|
191 // Message Data Types |
|
192 // |
|
193 |
|
194 struct SNetMsgProcessPrivacyRequest |
|
195 { |
|
196 TLbsNetSessionId iSessionId; |
|
197 TBool iEmergency; |
|
198 TLbsNetPosRequestPrivacy iPrivacy; |
|
199 TLbsExternalRequestInfo iRequestInfo; |
|
200 }; |
|
201 |
|
202 struct SNetMsgProcessLocationRequest |
|
203 { |
|
204 TLbsNetSessionId iSessionId; |
|
205 TBool iEmergency; |
|
206 MLbsNetworkProtocolObserver::TLbsNetProtocolService iService; |
|
207 TLbsNetPosRequestQuality iQuality; |
|
208 TLbsNetPosRequestMethod iMethod; |
|
209 }; |
|
210 |
|
211 struct SNetMsgProcessSessionComplete |
|
212 { |
|
213 TLbsNetSessionId iSessionId; |
|
214 TInt iReason; |
|
215 }; |
|
216 |
|
217 struct SNetMsgProcessAssistanceData |
|
218 { |
|
219 TLbsAssistanceDataGroup iDataMask; |
|
220 TInt iReason; |
|
221 RLbsAssistanceDataBuilderSet iData; |
|
222 }; |
|
223 |
|
224 struct SNetMsgProcessLocationUpdate |
|
225 { |
|
226 TLbsNetSessionId iSessionId; |
|
227 TPositionExtendedSatelliteInfo iReferenceLocation; |
|
228 }; |
|
229 |
|
230 struct SNetMsgRespondPrivacyRequest |
|
231 { |
|
232 TLbsNetSessionId iSessionId; |
|
233 CLbsNetworkProtocolBase::TLbsPrivacyResponse iResponse; |
|
234 }; |
|
235 |
|
236 struct SNetMsgRespondLocationRequest |
|
237 { |
|
238 TLbsNetSessionId iSessionId; |
|
239 TInt iReason; |
|
240 TPositionExtendedSatelliteInfo iPositionInfo; |
|
241 }; |
|
242 |
|
243 struct SNetMsgRequestTransmitLocation |
|
244 { |
|
245 TLbsNetSessionId iSessionId; |
|
246 TInt iPriority; |
|
247 TBuf<128> iDestination; |
|
248 TLbsNetPosRequestOptionsTechnology iOptions; |
|
249 }; |
|
250 |
|
251 struct SNetMsgCancelTransmitLocation |
|
252 { |
|
253 TLbsNetSessionId iSessionId; |
|
254 TInt iReason; |
|
255 }; |
|
256 |
|
257 struct SNetMsgCancelExternalLocation |
|
258 { |
|
259 TLbsNetSessionId iSessionId; |
|
260 TInt iReason; |
|
261 }; |
|
262 |
|
263 struct SNetMsgRequestAssistanceData |
|
264 { |
|
265 TLbsAssistanceDataGroup iDataRequestMask; |
|
266 }; |
|
267 |
|
268 struct SNetMsgRequestSelfLocation |
|
269 { |
|
270 TLbsNetSessionId iSessionId; |
|
271 TBool iNewClient; |
|
272 TLbsAssistanceDataGroup iDataRequestMask; |
|
273 }; |
|
274 |
|
275 struct SNetMsgCancelSelfLocation |
|
276 { |
|
277 TLbsNetSessionId iSessionId; |
|
278 TInt iReason; |
|
279 }; |
|
280 |
|
281 struct SNetMsgRequestNetworkLocation |
|
282 { |
|
283 TLbsNetSessionId iSessionId; |
|
284 TLbsNetPosRequestQuality iQuality; |
|
285 }; |
|
286 |
|
287 struct SNetMsgCancelNetworkLocation |
|
288 { |
|
289 TLbsNetSessionId iSessionId; |
|
290 TInt iReason; |
|
291 }; |
|
292 |
|
293 struct SNetMsgGetCurrentCapabilitiesRequest |
|
294 { |
|
295 }; |
|
296 |
|
297 struct SNetMsgGetCurrentCapabilitiesResponse |
|
298 { |
|
299 TLbsNetPosCapabilities iCapabilities; |
|
300 }; |
|
301 |
|
302 struct SNetMsgProcessStatusUpdate |
|
303 { |
|
304 MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask iActiveServiceMask; |
|
305 }; |
|
306 |
|
307 #endif // LBSNETGATEWAYPROTOCOLTESTAPI_H_ |