1 /* |
|
2 * Copyright (c) 2005-2007 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: File Transfer Profile Plug-in Service Timer implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "sconservicetimer.h" |
|
22 #include "sconftpplugin.h" |
|
23 #include "debug.h" |
|
24 |
|
25 // ============================= MEMBER FUNCTIONS =============================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CSConServiceTimer::CSConServiceTimer( CSConFTPplugin* aEngine, TInt aValue ) |
|
29 // Constuctor |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CSConServiceTimer::CSConServiceTimer( CSConFTPplugin* aEngine, TInt aValue ) |
|
33 : CActive( EPriorityStandard ), iEngine( aEngine ), iValue( aValue ) {} |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // CSConServiceTimer::ConstructL() |
|
37 // Initializes member data |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 void CSConServiceTimer::ConstructL() |
|
41 { |
|
42 LOGGER_ENTERFN( "CSConServiceTimer::ConstructL()" ); |
|
43 // create a thread-relative timer |
|
44 User::LeaveIfError( iTimer.CreateLocal() ); |
|
45 LOGGER_LEAVEFN( "CSConServiceTimer::ConstructL()" ); |
|
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CSConServiceTimer::~CSConServiceTimer() |
|
50 // Destructor |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 CSConServiceTimer::~CSConServiceTimer() |
|
54 { |
|
55 LOGGER_ENTERFN( "CSConServiceTimer::~CSConServiceTimer()" ); |
|
56 iTimer.Close(); |
|
57 LOGGER_LEAVEFN( "CSConServiceTimer::~CSConServiceTimer()" ); |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CSConServiceTimer::~CSConServiceTimer() |
|
62 // Starts the timer |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 void CSConServiceTimer::StartTimer() |
|
66 { |
|
67 LOGGER_ENTERFN( "CSConServiceTimer::StartTimer()" ); |
|
68 if( !IsActive() ) |
|
69 { |
|
70 LOGGER_WRITE( "CSConServiceTimer::StartTimer() : !IsActive()" ); |
|
71 iTimer.After( iStatus, TTimeIntervalMicroSeconds32( iValue ) ); |
|
72 iEngine->iSessionActive = ETrue; |
|
73 SetActive(); |
|
74 LOGGER_WRITE( "CSConServiceTimer::StartTimer() : SetActive()" ); |
|
75 } |
|
76 LOGGER_LEAVEFN( "CSConServiceTimer::StartTimer()" ); |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CSConServiceTimer::StopTimer() |
|
81 // StopTimer() |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 void CSConServiceTimer::StopTimer() |
|
85 { |
|
86 LOGGER_ENTERFN( "CSConServiceTimer::StopTimer()" ); |
|
87 iEngine->iSessionActive = ETrue; |
|
88 LOGGER_WRITE( "CSConServiceTimer::StopTimer() : iSessionActive = ETrue" ); |
|
89 LOGGER_LEAVEFN( "CSConServiceTimer::StopTimer()" ); |
|
90 } |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // CSConServiceTimer::DoCancel() |
|
94 // Cancels the timer |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 void CSConServiceTimer::DoCancel() |
|
98 { |
|
99 LOGGER_ENTERFN( "CSConServiceTimer::DoCancel()" ); |
|
100 iTimer.Cancel(); |
|
101 LOGGER_LEAVEFN( "CSConServiceTimer::DoCancel()" ); |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CSConServiceTimer::RunL() |
|
106 // Executed when timer is triggered |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 void CSConServiceTimer::RunL() |
|
110 { |
|
111 LOGGER_ENTERFN( "CSConServiceTimer::RunL()" ); |
|
112 iEngine->iSessionActive = EFalse; |
|
113 LOGGER_WRITE( "CSConServiceTimer::RunL() : iSessionActive = EFalse" ); |
|
114 iEngine->iStartTimer = EFalse; |
|
115 LOGGER_WRITE( "CSConServiceTimer::RunL() : iStartTimer = EFalse " ); |
|
116 LOGGER_LEAVEFN( "CSConServiceTimer::RunL()" ); |
|
117 } |
|
118 |
|
119 // End of file |
|