equal
deleted
inserted
replaced
|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "BTSimTimer.h" |
|
17 #include "btcomm.h" |
|
18 |
|
19 |
|
20 CBTTimerSimple::CBTTimerSimple(TInt aPriority,CBTPortProxy* aContext) : CTimer(aPriority), |
|
21 iClient(aContext) |
|
22 { |
|
23 } |
|
24 |
|
25 CBTTimerSimple::~CBTTimerSimple() |
|
26 { |
|
27 CancelAlarm(); |
|
28 } |
|
29 |
|
30 |
|
31 CBTTimerSimple* CBTTimerSimple::NewL(TInt aPriority,CBTPortProxy* aContext) |
|
32 { |
|
33 CBTTimerSimple* self = new (ELeave) CBTTimerSimple(aPriority,aContext); |
|
34 CleanupStack::PushL(self); |
|
35 self->ConstructL(); |
|
36 CleanupStack::Pop(); |
|
37 return self; |
|
38 } |
|
39 |
|
40 void CBTTimerSimple::ConstructL() |
|
41 { |
|
42 CTimer::ConstructL(); |
|
43 CActiveScheduler::Add(this); |
|
44 } |
|
45 |
|
46 void CBTTimerSimple::CancelAlarm() |
|
47 { |
|
48 if(IsActive()) |
|
49 { |
|
50 CActive::Cancel(); |
|
51 } |
|
52 } |
|
53 |
|
54 void CBTTimerSimple::RunL() |
|
55 { |
|
56 iClient->ShutdownAlarm(); |
|
57 } |