author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1 |
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 2 |
// All rights reserved. |
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "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 |
// @file wakeuptimer.cpp |
|
15 |
// @internalComponent |
|
16 |
// |
|
17 |
// |
|
18 |
||
19 |
#include "wakeuptimer.h" |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
#include "OstTraceDefinitions.h" |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
21 |
#ifdef OST_TRACE_COMPILER_IN_USE |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
22 |
#include "wakeuptimerTraces.h" |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
23 |
#endif |
0 | 24 |
|
25 |
||
26 |
namespace NUnitTesting_USBDI |
|
27 |
{ |
|
28 |
||
29 |
const TInt KOneSecond(1000000); |
|
30 |
||
31 |
CRemoteWakeupTimer* CRemoteWakeupTimer::NewL(RUsbTestDevice& aTestDevice) |
|
32 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
33 |
OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_NEWL_ENTRY, ( TUint )&( aTestDevice ) ); |
0 | 34 |
CRemoteWakeupTimer* self = new (ELeave) CRemoteWakeupTimer(aTestDevice); |
35 |
CleanupStack::PushL(self); |
|
36 |
self->ConstructL(); |
|
37 |
CleanupStack::Pop(self); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
38 |
OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_NEWL_EXIT, ( TUint )( self ) ); |
0 | 39 |
return self; |
40 |
} |
|
41 |
||
42 |
||
43 |
CRemoteWakeupTimer::CRemoteWakeupTimer(RUsbTestDevice& aTestDevice) |
|
44 |
: CTimer(EPriorityStandard), |
|
45 |
iTestDevice(aTestDevice) |
|
46 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
47 |
OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY, this ); |
0 | 48 |
CActiveScheduler::Add(this); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
49 |
OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT, this ); |
0 | 50 |
} |
51 |
||
52 |
||
53 |
CRemoteWakeupTimer::~CRemoteWakeupTimer() |
|
54 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
55 |
OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY_DUP01, this ); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT_DUP01, this ); |
0 | 57 |
} |
58 |
||
59 |
||
60 |
void CRemoteWakeupTimer::ConstructL() |
|
61 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CONSTRUCTL_ENTRY, this ); |
0 | 63 |
CTimer::ConstructL(); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CONSTRUCTL_EXIT, this ); |
0 | 65 |
} |
66 |
||
67 |
||
68 |
void CRemoteWakeupTimer::WakeUp(TUint16 aInterval) |
|
69 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
70 |
OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_WAKEUP_ENTRY, this ); |
0 | 71 |
After(aInterval*KOneSecond); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_WAKEUP_EXIT, this ); |
0 | 73 |
} |
74 |
||
75 |
||
76 |
void CRemoteWakeupTimer::RunL() |
|
77 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_RUNL_ENTRY, this ); |
0 | 79 |
TInt completionCode(iStatus.Int()); |
80 |
||
81 |
if(completionCode != KErrNone) |
|
82 |
{ |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
OstTrace1(TRACE_NORMAL, CREMOTEWAKEUPTIMER_RUNL, "<Error %d> software connect/disconnect timer error",completionCode); |
0 | 84 |
iTestDevice.ReportError(completionCode); |
85 |
} |
|
86 |
else |
|
87 |
{ |
|
88 |
iTestDevice.RemoteWakeup(); |
|
89 |
} |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
90 |
OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_RUNL_EXIT, this ); |
0 | 91 |
} |
92 |
||
93 |
} |
|
94 |
||
95 |
||
96 |