|
1 /* |
|
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Header file for COMASUPLProtocolManager implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_COMASUPLPROTOCOLMANAGER_H |
|
20 #define C_COMASUPLPROTOCOLMANAGER_H |
|
21 |
|
22 // Include Files |
|
23 #include <e32cmn.h> |
|
24 #include <etel.h> |
|
25 #include <etelmm.h> |
|
26 |
|
27 #include "epos_csuplprotocolmanagerbase.h" // interface |
|
28 #include "epos_comasuplinitilizeobserver.h" |
|
29 #include "epos_comasupldeinitializer.h" |
|
30 |
|
31 // Farward Declaration |
|
32 class COMASuplTrace; |
|
33 class CSuplCommunicationManager; |
|
34 class COMASuplCommonConfig; |
|
35 class TSuplTerminalQop; |
|
36 class COMASuplInitilizeRequestor; |
|
37 class COMASuplAsnHandlerBase; |
|
38 |
|
39 /** |
|
40 * An implementation of the COMASUPLProtocolManagerBase definition. |
|
41 * @lib eposomasuplprotocolhandler.lib |
|
42 * @since S60 v3.1 |
|
43 */ |
|
44 class COMASUPLProtocolManager : public CSUPLProtocolManagerBase, |
|
45 public MCompleteInitilization, |
|
46 public MCompleteDeInitialization |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * NewL, Create instance of concrete implementation. |
|
51 * @since S60 v3.1u |
|
52 * @param None |
|
53 * @return Instance of this class. |
|
54 */ |
|
55 IMPORT_C static COMASUPLProtocolManager* NewL(); |
|
56 |
|
57 /** |
|
58 * ~COMASUPLProtocolManager |
|
59 * @since S60 v3.1u |
|
60 * @param None |
|
61 * @return None |
|
62 */ |
|
63 IMPORT_C ~COMASUPLProtocolManager(); |
|
64 |
|
65 /** |
|
66 * CreateNewSessionL, Creates new SuplSession instance |
|
67 * @since S60 v3.1u |
|
68 * @param aRequestType, used for differentiation between SET & NET cases |
|
69 * @return Instance of CSuplSessionBase. |
|
70 */ |
|
71 IMPORT_C virtual CSuplSessionBase* CreateNewSessionL( |
|
72 CSUPLProtocolManagerBase::TSuplReqType aRequestType, |
|
73 TInt aIpcSessionId, |
|
74 RSuplTerminalSubSession::TSuplServiceType aSuplService); |
|
75 |
|
76 /** |
|
77 * RunSessionL, Starts the SUPL Sesssion for Terminal Initiated Location Request |
|
78 * @since S60 v3.1 |
|
79 * @param aSuplSession , session object on which processing will start |
|
80 * @param aStatus, On completion, sets status of the request |
|
81 * @param aAllowedCapabilities , Allowed capabilities of SET |
|
82 * @Param: aQop, specifies the quality of position |
|
83 * @param aRequestID , Request ID of Session |
|
84 * @return None |
|
85 */ |
|
86 IMPORT_C virtual void RunSessionL( |
|
87 CSuplSessionBase *const aSuplSession, |
|
88 TRequestStatus& aStatus, |
|
89 const TDesC& aHslpAddress, |
|
90 TBool aFallBack, |
|
91 TBool aFirstReq, |
|
92 TInt aAllowedCapabilities, |
|
93 TSuplTerminalQop& aQop, |
|
94 TInt aRequestID = 0); |
|
95 |
|
96 /** |
|
97 * RunSessionL, Starts the SUPL Sesssion for Terminal Initiated Location Request |
|
98 * @since S60 v3.1 |
|
99 * @param aSuplSession , session object on which processing will start |
|
100 * @param aStatus, On completion, sets status of the request |
|
101 * @param aAllowedCapabilities , Allowed capabilities of SET |
|
102 * @param aRequestID , Request ID of Session |
|
103 * @return None |
|
104 */ |
|
105 IMPORT_C virtual void RunSessionL( |
|
106 CSuplSessionBase *const aSuplSession, |
|
107 TRequestStatus& aStatus, |
|
108 const TDesC& aHslpAddress, |
|
109 TBool aFallBack, |
|
110 TBool aFirstReq, |
|
111 TInt aAllowedCapabilities, |
|
112 TInt aRequestID = 0); |
|
113 /** |
|
114 * HandleSuplMessage, Handles session in NET initiated case |
|
115 * @since S60 v3.1 |
|
116 * @param aSuplSession , session object on which processing will start |
|
117 * @param aStatus, On completion, sets status of the request |
|
118 * @param aMessage, message to be decoded. |
|
119 * @return None |
|
120 */ |
|
121 IMPORT_C virtual void HandleSuplMessageL( |
|
122 CSuplSessionBase *const aSuplSession, |
|
123 TRequestStatus& aStatus, |
|
124 HBufC8* aMessage); |
|
125 |
|
126 /** |
|
127 * DestroySession, Destroys the specified Supl Session instance |
|
128 * @since S60 v3.1u |
|
129 * @param aSuplSession , session object which has to delete |
|
130 * @return TInt,returns KErrNone if deleted successfully else KErrArgument |
|
131 */ |
|
132 IMPORT_C TInt DestroySession(CSuplSessionBase* aSuplSession); |
|
133 |
|
134 /** |
|
135 * InitializeL, Does the asynchonous initilization. |
|
136 * @since S60 v3.1u |
|
137 * @param aCommManager,Communication Manager |
|
138 * @param aInitilizationRequestStatus, TRequestStatus for asynchronous initilization operation |
|
139 * @return None |
|
140 */ |
|
141 IMPORT_C void InitializeL( |
|
142 CSuplCommunicationManager* aCommManager, |
|
143 TRequestStatus& aInitilizationRequestStatus); |
|
144 |
|
145 /** |
|
146 * Function: CancelInitialize, |
|
147 * @Description: Does the cancellation of asynchonous initilization. |
|
148 * @Param: None |
|
149 * @Returns: None |
|
150 */ |
|
151 IMPORT_C void CancelInitialize(); |
|
152 |
|
153 /** |
|
154 * Function: DeInitialize, |
|
155 * @Description: Does the de-initilization. |
|
156 * @Param: aDeInitRequestStatus,for asynchronous de-initilization of protocol manager |
|
157 * @Returns: None |
|
158 */ |
|
159 IMPORT_C void DeInitialize(TRequestStatus& aDeInitRequestStatus); |
|
160 |
|
161 /** |
|
162 * Function: CancelDeInitialize, |
|
163 * @Description: Does the cancellation of asynchonous de-initilization. |
|
164 * @Param: None |
|
165 * @Returns: None |
|
166 */ |
|
167 IMPORT_C void CancelDeInitialize(); |
|
168 |
|
169 /** |
|
170 * HandleSuplPackets,Process Supl message which are comming from SLP |
|
171 * @since S60 v3.1u |
|
172 * @param aPacket, message packet |
|
173 * @return None |
|
174 */ |
|
175 IMPORT_C void HandlePacket(const TDesC8& aPacket, TUint aPortNum); |
|
176 |
|
177 /** |
|
178 * HandlePacketError,Process Supl message receiving Errors |
|
179 * @since S60 v3.1u |
|
180 * @param aError, the Error Code |
|
181 * @return None |
|
182 */ |
|
183 IMPORT_C virtual void HandlePacketError(TInt aError); |
|
184 |
|
185 /** |
|
186 * CancelRunSession,Cancels an in-progress Terminal Initiated Location Request |
|
187 * @param aSession, The session on which the request has to be cancelled |
|
188 * @return None |
|
189 */ |
|
190 IMPORT_C void CancelRunSession(CSuplSessionBase* aSuplSession); |
|
191 |
|
192 /** |
|
193 * Function: RunSuplTriggerSessionL, |
|
194 * @since S60 v5.2 |
|
195 * @Description: Starts processing on session |
|
196 * @Param: aSuplSession , session object on which processing will start |
|
197 * @Param: aStatus, On return, the status of the request |
|
198 * @Param: aAllowedCapabilities , Allowed capabilities of SET |
|
199 * @Param: aPTrigger , specifies the periodic trigger session |
|
200 * @Param: aRequestID , Request ID of Session |
|
201 * |
|
202 * @Returns: None |
|
203 */ |
|
204 IMPORT_C virtual void RunSuplTriggerSessionL( |
|
205 CSuplSessionBase *const aSuplSession, |
|
206 TRequestStatus& aStatus, |
|
207 TSuplTerminalPeriodicTrigger& aPTrigger, |
|
208 const TDesC& aHslpAddress, |
|
209 TBool aFallBack, |
|
210 TInt aAllowedCapabilities, |
|
211 TInt aRequestID = 0); |
|
212 |
|
213 /** |
|
214 * CancelPeriodicTriggerSession,Cancels an in-progress Terminal Initiated |
|
215 * Periodic Trigger Session Location Request |
|
216 * @since S60 v5.2 |
|
217 * @Description: Cancels the Triggering Session |
|
218 * @param aSession, The session on which the request has to be cancelled |
|
219 * @return None |
|
220 */ |
|
221 IMPORT_C virtual void CancelSuplTriggerSession(CSuplSessionBase* aSuplSession); |
|
222 |
|
223 /** |
|
224 * Function: NotifyTriggerFired |
|
225 * @since S60 v5.2 |
|
226 * @Description: Starts listening for the trigger fired event |
|
227 * @Param: None |
|
228 * @Returns: None |
|
229 * |
|
230 */ |
|
231 IMPORT_C virtual void NotifyTriggerFiredL( |
|
232 CSuplSessionBase *const aSuplSession, |
|
233 TRequestStatus& aStatus, |
|
234 TSuplTriggerFireInfo& aFireInfo); |
|
235 |
|
236 /** |
|
237 * Function: SetCommonConfig |
|
238 * @since S60 v5.2 |
|
239 * @Description: Sets the common configuration data |
|
240 * @Param: aCommmonConfig, common data structure |
|
241 * @Returns: None |
|
242 * |
|
243 */ |
|
244 IMPORT_C virtual void SetCommonConfig(COMASuplCommonConfig*& aCommmonConfig); |
|
245 |
|
246 /** |
|
247 * Function: GetSUPLMessageVersionL |
|
248 * @since S60 v5.2 |
|
249 * @Description: Gets the SUPL Message Version |
|
250 * @Param: aMajorVersion, Major Version Number |
|
251 * @Param: aReceivedMessage, Recived Message Data |
|
252 * @Returns: None |
|
253 * |
|
254 */ |
|
255 IMPORT_C virtual TInt GetSUPLMessageVersionL(TInt& aMajorVersion, const TDesC8& aReceivedMessage); |
|
256 |
|
257 protected: // Construction |
|
258 /** |
|
259 * COMASUPLProtocolManager,Perform the first phase of two phase construction |
|
260 * @since S60 v3.1u |
|
261 * @param None |
|
262 * @return None |
|
263 */ |
|
264 IMPORT_C COMASUPLProtocolManager(); |
|
265 |
|
266 private: |
|
267 /** |
|
268 * ConstructL,Perform the second phase construction of a COMASUPLProtocolManager object. |
|
269 * @since S60 v3.1u |
|
270 * @param None |
|
271 * @return None |
|
272 */ |
|
273 void ConstructL(); |
|
274 |
|
275 private : //For internal use only |
|
276 /** |
|
277 * CompleteInitilization,Completes TRequestStatus used for initilization. |
|
278 * @since S60 v3.1u |
|
279 * @param aError, error code by which we are going to complete TRequestStatus. |
|
280 * @return None |
|
281 */ |
|
282 void CompleteInitilization(TInt aError); |
|
283 |
|
284 |
|
285 void DeInitilizationCompletedL(TInt aError); |
|
286 |
|
287 /** |
|
288 * GetNetworkModeL, |
|
289 * @since S60 v5.2 |
|
290 * @param None |
|
291 * @return TInt,returns KErrNone |
|
292 */ |
|
293 TInt GetNetworkModeL(); |
|
294 |
|
295 /** |
|
296 * LoadOMASUPLPluginsL, Loads supl protocolhandler plugins |
|
297 * @since S60 v5.2 |
|
298 * @param None |
|
299 * @return None |
|
300 */ |
|
301 void LoadOMASUPLPluginsL(); |
|
302 |
|
303 /** |
|
304 * GetSuplVersion, Gets Supl Version |
|
305 * @since S60 v5.2 |
|
306 * @param None |
|
307 * @return None |
|
308 */ |
|
309 TInt GetSuplVersion(TInt& aMajor,const TPtrC8& aSuplAsnMessage ); |
|
310 |
|
311 |
|
312 private: //From MCompleteInitilization |
|
313 |
|
314 /** |
|
315 * InitilizationCompletedL, Gets called after initilization gets completed with error or without error. |
|
316 * @since S60 v3.1u |
|
317 * @param aError,Error code if any happen while initilization. |
|
318 * @return None. |
|
319 */ |
|
320 void InitilizationCompletedL(TInt aError); |
|
321 |
|
322 private: // Data Members |
|
323 |
|
324 //Tracing utility |
|
325 COMASuplTrace* iTrace; |
|
326 |
|
327 // Asynchronous request status for Initilization |
|
328 TRequestStatus* iInitilizationRequestStatus; |
|
329 TRequestStatus* iInitilizationRequestStatus2; |
|
330 TRequestStatus* iDeInitRequestStatus; |
|
331 |
|
332 COMASuplInitilizeRequestor* iOMASuplInitilizeRequestor; |
|
333 |
|
334 CSUPLProtocolManagerBase* iOMASuplProtocolHandler1; |
|
335 |
|
336 CSUPLProtocolManagerBase* iOMASuplProtocolHandler2; |
|
337 |
|
338 COMASuplCommonConfig* iCommonConfig; |
|
339 |
|
340 //Communication Manager |
|
341 CSuplCommunicationManager* iCommManager; |
|
342 |
|
343 COMASuplAsnHandlerBase* iOMASuplAsnHandlerBaseImpl; |
|
344 |
|
345 COMASuplDeInitilizer* iOMASuplDeInitilizer; |
|
346 |
|
347 TInt iSuplService; |
|
348 // Indicates if the Protocol Manager was initialized or not |
|
349 TBool iIsInitilized; |
|
350 |
|
351 TBool isPH2Shared; |
|
352 |
|
353 TBool iIsPhDeinitialized1; |
|
354 TBool iIsPhDeinitialized2; |
|
355 |
|
356 }; |
|
357 |
|
358 #endif // C_COMASUPLPROTOCOLMANAGER_H |