|
1 /* |
|
2 * Copyright (c) 2008-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: Implements concrete state |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_USBSTATEHOSTDALAYATTACHEDHANDLE_H |
|
19 #define C_USBSTATEHOSTDALAYATTACHEDHANDLE_H |
|
20 |
|
21 #include "cusbstatehostdelayhandle.h" |
|
22 |
|
23 #ifndef STIF |
|
24 #include "cusbtimer.h" |
|
25 #else |
|
26 #include "mockcusbtimer.h" |
|
27 #endif |
|
28 |
|
29 class CUsbOtgWatcher; |
|
30 |
|
31 /** |
|
32 * problem handling, device is attached, vbus not dropping |
|
33 * |
|
34 */ |
|
35 NONSHARABLE_CLASS( CUsbStateHostDelayAttachedHandle ) : public CUsbStateHostDelayHandle, |
|
36 public MUsbTimerObserver |
|
37 { |
|
38 friend class CtUsbOtgWatcher; |
|
39 friend class CUsbOtgWatcher; |
|
40 |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param aWatcher owner |
|
46 */ |
|
47 static CUsbStateHostDelayAttachedHandle* NewL(CUsbOtgWatcher& aWatcher); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CUsbStateHostDelayAttachedHandle(); |
|
53 |
|
54 protected: |
|
55 |
|
56 // From MUsbTimerObserver |
|
57 /** |
|
58 * Call back when timer expired |
|
59 * @param aTimerId timer id |
|
60 */ |
|
61 void TimerElapsedL(TUsbTimerId aTimerId); |
|
62 |
|
63 /** |
|
64 * Device is detached |
|
65 * @param aInfo Device event data |
|
66 */ |
|
67 virtual void DeviceDetachedL(TDeviceEventInformation aInfo); |
|
68 |
|
69 //from CUsbState |
|
70 /** |
|
71 * State id |
|
72 * @return state id |
|
73 */ |
|
74 virtual TUsbStateIds Id(); |
|
75 |
|
76 /** |
|
77 * This is called when leaving this state, |
|
78 * |
|
79 */ |
|
80 virtual void JustBeforeLeavingThisStateL(); |
|
81 |
|
82 /** |
|
83 * handles issue |
|
84 */ |
|
85 virtual void DoHandleL(); |
|
86 |
|
87 /** |
|
88 * Default constructor |
|
89 * @param aWatcher owner |
|
90 */ |
|
91 CUsbStateHostDelayAttachedHandle(CUsbOtgWatcher& aWatcher); |
|
92 |
|
93 /** |
|
94 * 2nd phase construction |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 // data |
|
99 |
|
100 private: |
|
101 /** |
|
102 * drivers not found |
|
103 * own |
|
104 */ |
|
105 CUsbTimer* iDriversNotFoundTimer; |
|
106 }; |
|
107 |
|
108 #endif // C_USBSTATEHOSTDELAYATTACHEDHANDLE_H |