47 CSuplSessionRequest::CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver): |
47 CSuplSessionRequest::CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver): |
48 CActive(EPriorityStandard), |
48 CActive(EPriorityStandard), |
49 iRequestPhase(ESuplReqInactive), |
49 iRequestPhase(ESuplReqInactive), |
50 iObserver(aObserver), |
50 iObserver(aObserver), |
51 iSessnMgr(aSessnMgr), |
51 iSessnMgr(aSessnMgr), |
52 iSuplSessn(aSuplSessn) |
52 iSuplSessn(aSuplSessn), |
|
53 iParamExtendedFallback(NULL) |
53 { |
54 { |
54 DEBUG_TRACE("CSuplSessionRequest::CSuplSessionRequest", __LINE__) |
55 DEBUG_TRACE("CSuplSessionRequest::CSuplSessionRequest", __LINE__) |
55 CActiveScheduler::Add(this); |
56 CActiveScheduler::Add(this); |
56 |
57 |
57 } |
58 } |
58 CSuplSessionRequest::CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver): |
59 CSuplSessionRequest::CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver): |
59 CActive(EPriorityStandard), |
60 CActive(EPriorityStandard), |
60 iRequestPhase(ESuplReqInactive), |
61 iRequestPhase(ESuplReqInactive), |
61 iNetObserver(aObserver), |
62 iNetObserver(aObserver), |
62 iSessnMgr(aSessnMgr), |
63 iSessnMgr(aSessnMgr), |
63 iSuplSessn(aSuplSessn) |
64 iSuplSessn(aSuplSessn), |
|
65 iParamExtendedFallback(NULL) |
64 { |
66 { |
65 DEBUG_TRACE("CSuplSessionRequest::CSuplSessionRequest", __LINE__) |
67 DEBUG_TRACE("CSuplSessionRequest::CSuplSessionRequest", __LINE__) |
66 CActiveScheduler::Add(this); |
68 CActiveScheduler::Add(this); |
67 |
69 |
68 } |
70 } |
113 TBool fallBack = ETrue; |
122 TBool fallBack = ETrue; |
114 TBuf<KMaxHslpAddressLength> aHslpAddress (KNullDesC); |
123 TBuf<KMaxHslpAddressLength> aHslpAddress (KNullDesC); |
115 |
124 |
116 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, fallBack, aSetCaps, aReqId, aFirstReq); |
125 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, fallBack, aSetCaps, aReqId, aFirstReq); |
117 SetActive(); |
126 SetActive(); |
|
127 iParamFallback = ETrue; |
|
128 iParamSuplSessn = aSuplSessn; |
|
129 iParamSetCaps = aSetCaps; |
|
130 iParamReqId = aReqId; |
|
131 iParamFirstReq = aFirstReq; |
|
132 if (iParamExtendedFallback) |
|
133 { |
|
134 delete iParamExtendedFallback; |
|
135 iParamExtendedFallback = NULL; |
|
136 } |
|
137 iParamExtendedQopUsed = EFalse; |
118 } |
138 } |
119 // --------------------------------------------------------- |
139 // --------------------------------------------------------- |
120 // CSuplSessionRequest::MakeSuplSessionRequestL |
140 // CSuplSessionRequest::MakeSuplSessionRequestL |
121 // |
141 // |
122 // (other items were commented in a header). |
142 // (other items were commented in a header). |
130 TBool fallBack = ETrue; |
150 TBool fallBack = ETrue; |
131 TBuf<KMaxHslpAddressLength> aHslpAddress ( KNullDesC); |
151 TBuf<KMaxHslpAddressLength> aHslpAddress ( KNullDesC); |
132 |
152 |
133 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, fallBack, aSetCaps, aReqId, aQop, aFirstReq); |
153 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, fallBack, aSetCaps, aReqId, aQop, aFirstReq); |
134 SetActive(); |
154 SetActive(); |
|
155 |
|
156 iParamFallback = ETrue; |
|
157 iParamSuplSessn = aSuplSessn; |
|
158 iParamSetCaps = aSetCaps; |
|
159 iParamReqId = aReqId; |
|
160 iParamFirstReq = aFirstReq; |
|
161 if (iParamExtendedFallback) |
|
162 { |
|
163 delete iParamExtendedFallback; |
|
164 iParamExtendedFallback = NULL; |
|
165 } |
|
166 iParamQop = aQop; |
|
167 iParamExtendedQopUsed = ETrue; |
135 } |
168 } |
136 |
169 |
137 void CSuplSessionRequest::MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn,const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TBool aFirstReq) |
170 void CSuplSessionRequest::MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn,const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TBool aFirstReq) |
138 { |
171 { |
139 DEBUG_TRACE("CSuplSessionRequest::MakeSuplSessionRequestL", __LINE__) |
172 DEBUG_TRACE("CSuplSessionRequest::MakeSuplSessionRequestL", __LINE__) |
140 iRequestPhase = ESuplSessionRequest; |
173 iRequestPhase = ESuplSessionRequest; |
141 iStatus = KRequestPending; |
174 iStatus = KRequestPending; |
142 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, aFallBack, aSetCaps, aReqId, aFirstReq); |
175 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, aFallBack, aSetCaps, aReqId, aFirstReq); |
143 SetActive(); |
176 SetActive(); |
|
177 |
|
178 iParamFallback = aFallBack; |
|
179 iParamSuplSessn = aSuplSessn; |
|
180 iParamSetCaps = aSetCaps; |
|
181 iParamReqId = aReqId; |
|
182 iParamFirstReq = aFirstReq; |
|
183 if (iParamExtendedFallback) |
|
184 { |
|
185 delete iParamExtendedFallback; |
|
186 iParamExtendedFallback = NULL; |
|
187 } |
|
188 iParamExtendedFallback = HBufC::NewL(aHslpAddress.Length()); |
|
189 *iParamExtendedFallback = aHslpAddress; |
|
190 iParamExtendedQopUsed = EFalse; |
144 } |
191 } |
145 |
192 |
146 void CSuplSessionRequest::MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn,const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq) |
193 void CSuplSessionRequest::MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn,const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq) |
147 { |
194 { |
148 DEBUG_TRACE("CSuplSessionRequest::MakeSuplSessionRequestL", __LINE__) |
195 DEBUG_TRACE("CSuplSessionRequest::MakeSuplSessionRequestL", __LINE__) |
149 iRequestPhase = ESuplSessionRequest; |
196 iRequestPhase = ESuplSessionRequest; |
150 iStatus = KRequestPending; |
197 iStatus = KRequestPending; |
151 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, aFallBack, aSetCaps, aReqId, aQop, aFirstReq); |
198 iSessnMgr.RunSuplSessionL(aSuplSessn, iStatus, aHslpAddress, aFallBack, aSetCaps, aReqId, aQop, aFirstReq); |
152 SetActive(); |
199 SetActive(); |
|
200 |
|
201 iParamFallback = aFallBack; |
|
202 iParamSuplSessn = aSuplSessn; |
|
203 iParamSetCaps = aSetCaps; |
|
204 iParamReqId = aReqId; |
|
205 iParamFirstReq = aFirstReq; |
|
206 iParamQop = aQop; |
|
207 iParamExtendedQopUsed = ETrue; |
|
208 if (iParamExtendedFallback) |
|
209 { |
|
210 delete iParamExtendedFallback; |
|
211 iParamExtendedFallback = NULL; |
|
212 } |
|
213 iParamExtendedFallback = HBufC::NewL(aHslpAddress.Length()); |
|
214 *iParamExtendedFallback = aHslpAddress; |
153 } |
215 } |
154 |
216 |
155 // --------------------------------------------------------- |
217 // --------------------------------------------------------- |
156 // CSuplSessionRequest::ForwardMessageRequestL |
218 // CSuplSessionRequest::ForwardMessageRequestL |
157 // |
219 // |
210 // |
272 // |
211 void CSuplSessionRequest::RunL() |
273 void CSuplSessionRequest::RunL() |
212 { |
274 { |
213 DEBUG_TRACE("CSuplSessionRequest::RunL", __LINE__) |
275 DEBUG_TRACE("CSuplSessionRequest::RunL", __LINE__) |
214 TInt err = iStatus.Int(); |
276 TInt err = iStatus.Int(); |
215 switch (iRequestPhase) |
277 |
216 { |
278 if(err != KErrNone && iRequestPhase == ESuplSessionRequest) |
217 case ESuplStartTriggerRequest: |
279 { |
218 case ESuplStopTriggerRequest: |
280 DEBUG_TRACE("Retrying session", __LINE__) |
219 { |
281 iRequestPhase = ESuplWaitingToRetrySession; |
220 iRequestPhase = ESuplReqInactive; |
282 iSessnMgr.QueueForReIssueRequestL(*this); |
221 iObserver->CompleteTriggerRunSession(err); |
283 } |
222 break; |
284 else |
223 } |
285 { |
224 case ESuplTriggerFiredNotifyRequest: |
286 switch (iRequestPhase) |
225 { |
287 { |
226 iRequestPhase = ESuplReqInactive; |
288 case ESuplStartTriggerRequest: |
227 iObserver->CompleteTriggerFiredNotifyRequest(err); |
289 case ESuplStopTriggerRequest: |
228 break; |
290 { |
229 } |
291 iRequestPhase = ESuplReqInactive; |
230 case ESuplSessionRequest: |
292 iObserver->CompleteTriggerRunSession(err); |
|
293 break; |
|
294 } |
|
295 case ESuplTriggerFiredNotifyRequest: |
|
296 { |
|
297 iRequestPhase = ESuplReqInactive; |
|
298 iObserver->CompleteTriggerFiredNotifyRequest(err); |
|
299 break; |
|
300 } |
|
301 case ESuplSessionRequest: |
|
302 case ESuplRetryingSession: |
|
303 { |
|
304 iRequestPhase = ESuplReqInactive; |
|
305 iObserver->CompleteRunSession(err); |
|
306 break; |
|
307 } |
|
308 case ESuplCancelRunSessionRequest: |
|
309 { |
|
310 iRequestPhase = ESuplReqInactive; |
|
311 iObserver->CompleteRunSession(err); |
|
312 break; |
|
313 } |
|
314 case ESuplForwardMessage: |
|
315 { |
|
316 iRequestPhase = ESuplReqInactive; |
|
317 iNetObserver->CompleteForwardMessageL(iHandle); |
|
318 break; |
|
319 } |
|
320 case ESuplLocationConversionRequest: |
|
321 case ESuplCancelLocationConversionRequest: |
|
322 { |
|
323 iRequestPhase = ESuplReqInactive; |
|
324 iObserver->CompleteRunSession(err); |
|
325 break; |
|
326 } |
|
327 default : |
|
328 DebugPanic(EPosSuplServerPanicRequestInconsistency); |
|
329 } |
|
330 } |
|
331 } |
|
332 |
|
333 void CSuplSessionRequest::ReIssueRequestL() |
|
334 { |
|
335 DEBUG_TRACE("CSuplSessionRequest::ReIssueRequestL", __LINE__) |
|
336 if(!iParamExtendedQopUsed) |
|
337 { |
|
338 if (!iParamExtendedFallback) |
231 { |
339 { |
232 iRequestPhase = ESuplReqInactive; |
340 MakeSuplSessionRequestL(iParamSuplSessn, iParamSetCaps, iParamReqId, iParamFirstReq); |
233 iObserver->CompleteRunSession(err); |
|
234 break; |
|
235 } |
341 } |
236 case ESuplCancelRunSessionRequest: |
342 else |
237 { |
343 { |
238 iRequestPhase = ESuplReqInactive; |
344 MakeSuplSessionRequestL(iParamSuplSessn, *iParamExtendedFallback, iParamFallback, iParamSetCaps, iParamReqId, iParamFirstReq); |
239 iObserver->CompleteRunSession(err); |
|
240 break; |
|
241 } |
345 } |
242 case ESuplForwardMessage: |
346 } |
243 { |
347 else |
244 iRequestPhase = ESuplReqInactive; |
348 { |
245 iNetObserver->CompleteForwardMessageL(iHandle); |
349 if (!iParamExtendedFallback) |
246 break; |
|
247 } |
|
248 case ESuplLocationConversionRequest: |
|
249 case ESuplCancelLocationConversionRequest: |
|
250 { |
350 { |
251 iRequestPhase = ESuplReqInactive; |
351 MakeSuplSessionRequestL(iParamSuplSessn, iParamSetCaps, iParamReqId, iParamQop, iParamFirstReq); |
252 iObserver->CompleteRunSession(err); |
|
253 break; |
|
254 } |
352 } |
255 default : |
353 else |
256 DebugPanic(EPosSuplServerPanicRequestInconsistency); |
354 { |
257 } |
355 MakeSuplSessionRequestL(iParamSuplSessn, *iParamExtendedFallback, iParamFallback, iParamSetCaps, iParamReqId, iParamQop, iParamFirstReq); |
258 } |
356 } |
|
357 } |
|
358 DEBUG_TRACE("Retry request succesfull", __LINE__) |
|
359 iRequestPhase = ESuplRetryingSession; |
|
360 } |
259 |
361 |
260 // --------------------------------------------------------- |
362 // --------------------------------------------------------- |
261 // CSuplSessionRequest::RunError |
363 // CSuplSessionRequest::RunError |
262 // |
364 // |
263 // (other items were commented in a header). |
365 // (other items were commented in a header). |