1 /* |
|
2 * Copyright (c) 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: Connection shutdown timer for haptics server connection. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "hapticsconntimer.h" |
|
20 |
|
21 const TInt KHapticsConnectionTimeout = 30000000; // 30 sec. |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // Two phased constructor. |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 CHapticsConnTimer* CHapticsConnTimer::NewL( MHapticsConnectionShutdown* aCallback ) |
|
28 { |
|
29 CHapticsConnTimer* self = new ( ELeave ) CHapticsConnTimer(aCallback); |
|
30 CleanupStack::PushL( self ); |
|
31 self->ConstructL(); |
|
32 CleanupStack::Pop( self ); |
|
33 return self; |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------------------------- |
|
37 // Destructor. |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 CHapticsConnTimer::~CHapticsConnTimer() |
|
41 { |
|
42 } |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // Activates this timer. |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 void CHapticsConnTimer::Start() |
|
49 { |
|
50 After( KHapticsConnectionTimeout ); |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // Constructor of the shutdown timer. |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 CHapticsConnTimer::CHapticsConnTimer( MHapticsConnectionShutdown* aCallback ) |
|
58 : CTimer( EPriorityStandard ), iCallback(aCallback) |
|
59 { |
|
60 CActiveScheduler::Add( this ); |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // Second phase construction. |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 void CHapticsConnTimer::ConstructL() |
|
68 { |
|
69 CTimer::ConstructL(); |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 void CHapticsConnTimer::RunL() |
|
77 { |
|
78 iCallback->NotifyShutdown(); |
|
79 } |
|
80 |
|
81 // End of File |
|