1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
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: Implementation of the concret state |
|
15 * |
8 * |
16 */ |
9 * Initial Contributors: |
17 |
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of the concret state |
|
15 * |
|
16 */ |
18 |
17 |
19 #ifndef C_USBSTATEHOSTAINITIATE_H |
18 #ifndef C_USBSTATEHOSTAINITIATE_H |
20 #define C_USBSTATEHOSTAINITIATE_H |
19 #define C_USBSTATEHOSTAINITIATE_H |
21 |
20 |
22 #include "cusbotgwatcher.h" |
21 #include "cusbstatehostabase.h" |
23 #include "cusbstatehostainitiatebase.h" |
22 |
24 #ifndef STIF |
23 #ifndef STIF |
25 #include "cusbtimer.h" |
24 #include "cusbtimer.h" |
26 #else |
25 #else |
27 #include "mockcusbtimer.h" |
26 #include "mockcusbtimer.h" |
28 #endif |
27 #endif |
29 |
28 |
|
29 class CUsbOtgWatcher; |
|
30 |
30 /** |
31 /** |
31 * This class implements behaviour when Id pin just detected (initiating host role, loading drivers) |
32 * This class implements behaviour when Id pin just detected (initiating host role, loading drivers) |
32 * |
33 * |
33 */ |
34 */ |
34 NONSHARABLE_CLASS( CUsbStateHostAInitiate ) : public CUsbStateHostAInitiateBase |
35 NONSHARABLE_CLASS( CUsbStateHostAInitiate ) : public CUsbStateHostABase, |
|
36 MUsbTimerObserver |
35 { |
37 { |
36 friend class CtUsbOtgWatcher; |
38 friend class CtUsbOtgWatcher; |
37 |
39 |
38 public: |
40 public: |
39 |
41 |
40 /** |
42 /** |
41 * Two-phased constructor. |
43 * Two-phased constructor. |
42 * @param aWatcher owner |
44 * @param aWatcher owner |
43 */ |
45 */ |
44 static CUsbStateHostAInitiate* NewL(CUsbOtgWatcher* aWatcher); |
46 static CUsbStateHostAInitiate* NewL(CUsbOtgWatcher& aWatcher); |
45 |
47 |
46 /** |
48 /** |
47 * Destructor. |
49 * Destructor. |
48 */ |
50 */ |
49 virtual ~CUsbStateHostAInitiate(); |
51 virtual ~CUsbStateHostAInitiate(); |
50 |
52 |
51 private: |
53 private: |
52 |
54 |
|
55 // From MUsbTimerObserver |
|
56 /** |
|
57 * timer expired call back |
|
58 * @param aTimerId timer id |
|
59 */ |
|
60 void TimerElapsedL(TUsbTimerId aTimerId); |
|
61 |
53 /** |
62 /** |
54 * default construction |
63 * default construction |
55 * @param aWatcher owner |
64 * @param aWatcher owner |
56 */ |
65 */ |
57 CUsbStateHostAInitiate(CUsbOtgWatcher* aWatcher); |
66 CUsbStateHostAInitiate(CUsbOtgWatcher& aWatcher); |
58 |
67 |
59 /** |
68 /** |
60 * 2nd phase construction |
69 * 2nd phase construction |
61 */ |
70 */ |
62 void ConstructL(); |
71 void ConstructL(); |
73 * because If all conditions for transition to another state exist, nothing will |
82 * because If all conditions for transition to another state exist, nothing will |
74 * trigger it and transition will not happen. This forces the transition in such cases. |
83 * trigger it and transition will not happen. This forces the transition in such cases. |
75 * |
84 * |
76 */ |
85 */ |
77 void JustAdvancedToThisStateL(); |
86 void JustAdvancedToThisStateL(); |
78 |
87 |
79 /** |
88 /** |
80 * This is called when switched to this state, |
89 * This is called when switched to this state, |
81 * because If all conditions for transition to another state exist, nothing will |
90 * because If all conditions for transition to another state exist, nothing will |
82 * trigger it and transition will not happen. This forces the transition in such cases. |
91 * trigger it and transition will not happen. This forces the transition in such cases. |
83 * |
92 * |
84 */ |
93 */ |
85 virtual void JustBeforeLeavingThisStateL(); |
94 void JustBeforeLeavingThisStateL(); |
|
95 |
|
96 // From VBus observer |
|
97 /** |
|
98 * VBus up |
|
99 */ |
|
100 void VBusUpL(); |
|
101 |
|
102 // From Host Event notification observer |
|
103 /** |
|
104 * Device is attached |
|
105 * @param Device event data |
|
106 */ |
|
107 void DeviceAttachedL(TDeviceEventInformation); |
|
108 |
|
109 /** |
|
110 * Device is detached |
|
111 * @param Device event data |
|
112 */ |
|
113 void DriverLoadSuccessL(TDeviceEventInformation); |
|
114 |
|
115 /** |
|
116 * Drivers loaded partially |
|
117 * @param Device event data |
|
118 */ |
|
119 void DriverLoadPartialSuccessL(TDeviceEventInformation); |
|
120 |
|
121 /** |
|
122 * Drivers loading failed |
|
123 * @param Device event data |
|
124 */ |
|
125 void DriverLoadFailureL(TDeviceEventInformation); |
|
126 |
|
127 private: |
|
128 // data |
|
129 |
|
130 /* |
|
131 * attachment timer |
|
132 * own |
|
133 */ |
|
134 CUsbTimer* iAttachmentTimer; |
86 |
135 |
87 }; |
136 }; |
88 |
137 |
89 #endif // C_USBSTATEHOSTINITIATE_H |
138 #endif // C_USBSTATEHOSTINITIATE_H |