1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
15 // @internalComponent |
15 // @internalComponent |
16 // |
16 // |
17 // |
17 // |
18 |
18 |
19 #include "wakeuptimer.h" |
19 #include "wakeuptimer.h" |
|
20 #include "OstTraceDefinitions.h" |
|
21 #ifdef OST_TRACE_COMPILER_IN_USE |
|
22 #include "wakeuptimerTraces.h" |
|
23 #endif |
20 |
24 |
21 |
25 |
22 namespace NUnitTesting_USBDI |
26 namespace NUnitTesting_USBDI |
23 { |
27 { |
24 |
28 |
25 const TInt KOneSecond(1000000); |
29 const TInt KOneSecond(1000000); |
26 |
30 |
27 CRemoteWakeupTimer* CRemoteWakeupTimer::NewL(RUsbTestDevice& aTestDevice) |
31 CRemoteWakeupTimer* CRemoteWakeupTimer::NewL(RUsbTestDevice& aTestDevice) |
28 { |
32 { |
|
33 OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_NEWL_ENTRY, ( TUint )&( aTestDevice ) ); |
29 CRemoteWakeupTimer* self = new (ELeave) CRemoteWakeupTimer(aTestDevice); |
34 CRemoteWakeupTimer* self = new (ELeave) CRemoteWakeupTimer(aTestDevice); |
30 CleanupStack::PushL(self); |
35 CleanupStack::PushL(self); |
31 self->ConstructL(); |
36 self->ConstructL(); |
32 CleanupStack::Pop(self); |
37 CleanupStack::Pop(self); |
|
38 OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_NEWL_EXIT, ( TUint )( self ) ); |
33 return self; |
39 return self; |
34 } |
40 } |
35 |
41 |
36 |
42 |
37 CRemoteWakeupTimer::CRemoteWakeupTimer(RUsbTestDevice& aTestDevice) |
43 CRemoteWakeupTimer::CRemoteWakeupTimer(RUsbTestDevice& aTestDevice) |
38 : CTimer(EPriorityStandard), |
44 : CTimer(EPriorityStandard), |
39 iTestDevice(aTestDevice) |
45 iTestDevice(aTestDevice) |
40 { |
46 { |
|
47 OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY, this ); |
41 CActiveScheduler::Add(this); |
48 CActiveScheduler::Add(this); |
|
49 OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT, this ); |
42 } |
50 } |
43 |
51 |
44 |
52 |
45 CRemoteWakeupTimer::~CRemoteWakeupTimer() |
53 CRemoteWakeupTimer::~CRemoteWakeupTimer() |
46 { |
54 { |
|
55 OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_ENTRY_DUP01, this ); |
|
56 OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CREMOTEWAKEUPTIMER_EXIT_DUP01, this ); |
47 } |
57 } |
48 |
58 |
49 |
59 |
50 void CRemoteWakeupTimer::ConstructL() |
60 void CRemoteWakeupTimer::ConstructL() |
51 { |
61 { |
52 LOG_FUNC |
62 OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_CONSTRUCTL_ENTRY, this ); |
53 CTimer::ConstructL(); |
63 CTimer::ConstructL(); |
|
64 OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_CONSTRUCTL_EXIT, this ); |
54 } |
65 } |
55 |
66 |
56 |
67 |
57 void CRemoteWakeupTimer::WakeUp(TUint16 aInterval) |
68 void CRemoteWakeupTimer::WakeUp(TUint16 aInterval) |
58 { |
69 { |
59 LOG_FUNC |
70 OstTraceFunctionEntryExt( CREMOTEWAKEUPTIMER_WAKEUP_ENTRY, this ); |
60 After(aInterval*KOneSecond); |
71 After(aInterval*KOneSecond); |
|
72 OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_WAKEUP_EXIT, this ); |
61 } |
73 } |
62 |
74 |
63 |
75 |
64 void CRemoteWakeupTimer::RunL() |
76 void CRemoteWakeupTimer::RunL() |
65 { |
77 { |
66 LOG_FUNC |
78 OstTraceFunctionEntry1( CREMOTEWAKEUPTIMER_RUNL_ENTRY, this ); |
67 TInt completionCode(iStatus.Int()); |
79 TInt completionCode(iStatus.Int()); |
68 |
80 |
69 if(completionCode != KErrNone) |
81 if(completionCode != KErrNone) |
70 { |
82 { |
71 RDebug::Printf("<Error %d> software connect/disconnect timer error",completionCode); |
83 OstTrace1(TRACE_NORMAL, CREMOTEWAKEUPTIMER_RUNL, "<Error %d> software connect/disconnect timer error",completionCode); |
72 iTestDevice.ReportError(completionCode); |
84 iTestDevice.ReportError(completionCode); |
73 } |
85 } |
74 else |
86 else |
75 { |
87 { |
76 iTestDevice.RemoteWakeup(); |
88 iTestDevice.RemoteWakeup(); |
77 } |
89 } |
|
90 OstTraceFunctionExit1( CREMOTEWAKEUPTIMER_RUNL_EXIT, this ); |
78 } |
91 } |
79 |
92 |
80 } |
93 } |
81 |
94 |
82 |
95 |