|
1 #ifndef __SOFTWARE_CONNECT_TIMER_H |
|
2 #define __SOFTWARE_CONNECT_TIMER_H |
|
3 |
|
4 /* |
|
5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
6 * All rights reserved. |
|
7 * This component and the accompanying materials are made available |
|
8 * under the terms of the License "Eclipse Public License v1.0" |
|
9 * which accompanies this distribution, and is available |
|
10 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
11 * |
|
12 * Initial Contributors: |
|
13 * Nokia Corporation - initial contribution. |
|
14 * |
|
15 * Contributors: |
|
16 * |
|
17 * Description: |
|
18 * @file softwareconnecttimer.h |
|
19 * @internalComponent |
|
20 * |
|
21 * |
|
22 */ |
|
23 |
|
24 |
|
25 |
|
26 #include <e32base.h> |
|
27 #include "testdevicebase.h" |
|
28 |
|
29 namespace NUnitTesting_USBDI |
|
30 { |
|
31 |
|
32 /** |
|
33 This class represents a timer for performing USB connection and disconnection |
|
34 in software. i.e. the D+/- pull-ups |
|
35 */ |
|
36 |
|
37 class CSoftwareConnectTimer : public CTimer |
|
38 { |
|
39 private: |
|
40 // The type of connection to be performed |
|
41 enum TConnectionType |
|
42 { |
|
43 EUnknown, |
|
44 EConnect, |
|
45 EDisconnect |
|
46 }; |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 2 phase construction |
|
52 @param aTestDevice a client usb test device |
|
53 */ |
|
54 |
|
55 static CSoftwareConnectTimer* NewL(RUsbTestDevice& aTestDevice); |
|
56 |
|
57 /** |
|
58 Destructor |
|
59 */ |
|
60 |
|
61 ~CSoftwareConnectTimer(); |
|
62 |
|
63 /** |
|
64 Perform software connection after the specified interval has elapsed |
|
65 @param aInterval the time gap before connecting in seconds |
|
66 */ |
|
67 |
|
68 void SoftwareConnect(TInt aInterval); |
|
69 |
|
70 /** |
|
71 Perform software disconnection after the specified interval has elapsed |
|
72 @param aInterval the time gap before disconnecting in seconds |
|
73 */ |
|
74 |
|
75 void SoftwareDisconnect(TInt aInterval); |
|
76 |
|
77 /** |
|
78 Peform a software disconnection and then after the specified interval, perform a software connection. |
|
79 @param aInterval the time gap between disconnecting and connecting in a reconnect step in seconds |
|
80 */ |
|
81 |
|
82 void SoftwareReConnect(TInt aInterval); |
|
83 |
|
84 private: |
|
85 |
|
86 /** |
|
87 Constructor, build a timer for performing software usb connection and disconnection |
|
88 */ |
|
89 |
|
90 CSoftwareConnectTimer(RUsbTestDevice& aTestDevice); |
|
91 |
|
92 /** |
|
93 */ |
|
94 void RunL(); |
|
95 |
|
96 private: |
|
97 /** |
|
98 The test device object to instruct to connect of disonnect |
|
99 */ |
|
100 |
|
101 RUsbTestDevice& iTestDevice; |
|
102 |
|
103 /** |
|
104 The type of connection to be performed |
|
105 */ |
|
106 |
|
107 TConnectionType iConnectType; |
|
108 }; |
|
109 |
|
110 |
|
111 |
|
112 } |
|
113 |
|
114 |
|
115 #endif |
|
116 |
|
117 |
|
118 |