|
1 /* |
|
2 * Copyright (c) 2005-2010 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: |
|
15 * Implements CRFsScript class which controls the parsing of the Rfs scripts |
|
16 * |
|
17 */ |
|
18 |
|
19 #include <e32debug.h> |
|
20 |
|
21 #include "rfscontimer.h" |
|
22 #include "RfsTraces.h" |
|
23 |
|
24 const TInt KRfsConnectionTimeOut = 60000000; |
|
25 |
|
26 CRfsConTimer :: CRfsConTimer(CRfsConnectionObserver * aRfsConnectionObserver):CActive( EPriorityStandard ) |
|
27 { |
|
28 iRfsConnectionObserver = aRfsConnectionObserver; |
|
29 iTimer.CreateLocal(); |
|
30 CActiveScheduler::Add( this ); |
|
31 } |
|
32 |
|
33 CRfsConTimer :: ~CRfsConTimer() |
|
34 { |
|
35 TRACES("CRfsConTimer :: ~CRfsConTimer()"); |
|
36 |
|
37 iRfsConnectionObserver = NULL; |
|
38 Cancel(); |
|
39 iTimer.Close(); |
|
40 } |
|
41 |
|
42 CRfsConTimer* CRfsConTimer::NewL(CRfsConnectionObserver * aRfsConnectionObserver) |
|
43 { |
|
44 TRACES("CRfsConTimer :: NewL()"); |
|
45 |
|
46 CRfsConTimer* self = new (ELeave) CRfsConTimer(aRfsConnectionObserver ); |
|
47 return self; |
|
48 } |
|
49 |
|
50 void CRfsConTimer :: IssueTimerRequest() |
|
51 { |
|
52 TRACES("CRfsConTimer :: IssueTimerRequest()"); |
|
53 |
|
54 if(!IsActive()) |
|
55 { |
|
56 iTimer.After(iStatus, KRfsConnectionTimeOut); |
|
57 SetActive(); |
|
58 } |
|
59 } |
|
60 void CRfsConTimer :: RunL() |
|
61 { |
|
62 TRACES("CRfsConTimer :: RunL()"); |
|
63 |
|
64 if(iRfsConnectionObserver->iState == ESipConnectionClose && iRfsConnectionObserver->iIsPDPFeatureEnabled) |
|
65 { |
|
66 // If SIP doesn't respond with in the set time, RunL will be called, |
|
67 // Rfs cancels the outstanding SIP request and If PDP connection exists, |
|
68 // Rfs will inform the PDP and start the timer. |
|
69 |
|
70 iRfsConnectionObserver->Cancel(); |
|
71 iRfsConnectionObserver->iState = EPdpConnectionClose; |
|
72 iRfsConnectionObserver->Subscribe(); |
|
73 iTimer.After(iStatus, KRfsConnectionTimeOut); |
|
74 SetActive(); |
|
75 } |
|
76 else |
|
77 { |
|
78 iRfsConnectionObserver->Cancel(); |
|
79 } |
|
80 } |
|
81 |
|
82 void CRfsConTimer :: DoCancel() |
|
83 { |
|
84 TRACES("CRfsConTimer :: DoCancel()"); |
|
85 |
|
86 if(IsActive()) |
|
87 { |
|
88 iTimer.Cancel(); |
|
89 } |
|
90 } |