33 /** |
33 /** |
34 * This class implements behaviour when some problem needs vbus drop, and mostly, user action. |
34 * This class implements behaviour when some problem needs vbus drop, and mostly, user action. |
35 * |
35 * |
36 */ |
36 */ |
37 NONSHARABLE_CLASS( CUsbStateHostHandle ) : public CUsbState, |
37 NONSHARABLE_CLASS( CUsbStateHostHandle ) : public CUsbState, |
38 MWaitNotifierObserver, |
38 MWaitNotifierObserver |
39 MUsbTimerObserver |
|
40 // this means only one wait notifier at a time can be shown by this state, might be redesigned |
39 // this means only one wait notifier at a time can be shown by this state, might be redesigned |
41 { |
40 { |
42 friend class CtUsbOtgWatcher; |
41 friend class CtUsbOtgWatcher; |
43 friend class CUsbOtgWatcher; |
42 friend class CUsbOtgWatcher; |
44 |
43 |
66 * Callback when notifier is completed |
65 * Callback when notifier is completed |
67 * @param aFeedback how notifier completed |
66 * @param aFeedback how notifier completed |
68 */ |
67 */ |
69 void WaitNotifierCompletedL(TInt aFeedback); |
68 void WaitNotifierCompletedL(TInt aFeedback); |
70 |
69 |
71 // From MUsbTimerObserver |
|
72 /** |
|
73 * Call back when timer expired |
|
74 * @param aTimerId timer id |
|
75 */ |
|
76 void TimerElapsedL(TUsbTimerId aTimerId); |
|
77 |
|
78 private: |
|
79 |
|
80 // From VBus observer |
70 // From VBus observer |
81 /** |
71 /** |
82 * VBus down |
72 * VBus down |
83 */ |
73 */ |
84 void VBusDownL(); |
74 virtual void VBusUpL(); |
|
75 /** |
|
76 * VBus down |
|
77 */ |
|
78 virtual void VBusDownL(); |
|
79 /** |
|
80 * VBus error happened |
|
81 */ |
|
82 virtual void VBusErrorL(); |
85 |
83 |
86 // From OTG state observer |
84 // From OTG state observer |
87 /** |
85 /** |
88 * Became to Idle when A |
86 * Became to Idle when A |
89 */ |
87 */ |
90 void AIdleL(); |
88 virtual void AIdleL(); |
91 /** |
89 /** |
92 * Became a Host when A |
90 * Became a Host when A |
93 */ |
91 */ |
94 void AHostL(); |
92 virtual void AHostL(); |
95 /** |
93 /** |
96 * Became a peripheral when A |
94 * Became a peripheral when A |
97 */ |
95 */ |
98 void APeripheralL(); |
96 virtual void APeripheralL(); |
99 /** |
97 /** |
100 * VBus error happen |
98 * VBus error happen |
101 */ |
99 */ |
102 void AVBusErrorL(); |
100 virtual void AVBusErrorL(); |
103 /** |
|
104 * Became to Idle when B |
|
105 */ |
|
106 void BIdleL(); |
|
107 /** |
|
108 * Became a peripheral when B |
|
109 */ |
|
110 void BPeripheralL(); |
|
111 /** |
|
112 * Became a Host when B |
|
113 */ |
|
114 void BHostL(); |
|
115 |
101 |
116 // From bus activity observer |
102 // From bus activity observer |
117 /** |
103 /** |
118 * Bus is in idle |
104 * Bus is in idle |
119 */ |
105 */ |
120 void BusIdleL(); |
106 virtual void BusIdleL(); |
121 /** |
107 /** |
122 * Bus active |
108 * Bus active |
123 */ |
109 */ |
124 void BusActiveL(); |
110 virtual void BusActiveL(); |
125 |
111 |
126 // From Host Event notification observer |
112 // From Host Event notification observer |
127 /** |
113 /** |
128 * Device is attached |
114 * Device is attached |
129 * @param aInfo Device event data |
115 * @param aInfo Device event data |
137 |
123 |
138 /** |
124 /** |
139 * Drivers successfully loaded |
125 * Drivers successfully loaded |
140 * @param aInfo Device event data |
126 * @param aInfo Device event data |
141 */ |
127 */ |
142 virtual void DriverLoadSuccessL(TDeviceEventInformation aInfo); |
128 virtual void DriverLoadSuccessL(TDeviceEventInformation aInfo); |
143 /** |
129 /** |
144 * Drivers loaded partially |
130 * Drivers loaded partially |
145 * @param aInfo Device event data |
131 * @param aInfo Device event data |
146 */ |
132 */ |
147 virtual void DriverLoadPartialSuccessL(TDeviceEventInformation aInfo); |
133 virtual void DriverLoadPartialSuccessL(TDeviceEventInformation aInfo); |
148 /** |
134 /** |
149 * Drivers loading failed |
135 * Drivers loading failed |
150 * @param aInfo Device event data |
136 * @param aInfo Device event data |
151 */ |
137 */ |
152 virtual void DriverLoadFailureL(TDeviceEventInformation aInfo); |
138 virtual void DriverLoadFailureL(TDeviceEventInformation aInfo); |
153 |
139 |
154 // From message notification observer |
140 // From message notification observer |
155 /** |
141 /** |
156 * Message received |
142 * Message received |
157 * @param aMessage message id |
143 * @param aMessage message id |
158 */ |
144 */ |
159 void MessageNotificationReceivedL(TInt aMessage); |
145 virtual void MessageNotificationReceivedL(TInt aMessage); |
160 /** |
146 |
161 * Connected to hub in wrong level |
|
162 */ |
|
163 void BadHubPositionL(); |
|
164 /** |
|
165 * VBus error happened |
|
166 */ |
|
167 void VBusErrorL(); |
|
168 /** |
147 /** |
169 * SRP request received |
148 * SRP request received |
170 */ |
149 */ |
171 void SrpReceivedL(); |
150 virtual void SrpReceivedL(); |
172 /** |
151 /** |
173 * Session request received |
152 * Session request received |
174 */ |
153 */ |
175 void SessionRequestedL(); |
154 virtual void SessionRequestedL(); |
176 |
|
177 /** |
|
178 * Default constructor |
|
179 * @param aWatcher owner |
|
180 */ |
|
181 CUsbStateHostHandle(CUsbOtgWatcher* aWatcher); |
|
182 |
|
183 /** |
|
184 * 2nd phase construction |
|
185 */ |
|
186 void ConstructL(); |
|
187 |
155 |
188 //from CUsbState |
156 //from CUsbState |
189 /** |
157 /** |
190 * State id |
158 * State id |
191 * @return state id |
159 * @return state id |
192 */ |
160 */ |
193 TUsbStateIds Id(); |
161 virtual TUsbStateIds Id(); |
194 |
162 |
195 /** |
163 /** |
196 * This is called when switched to this state, |
164 * This is called when switched to this state, |
197 * because If all conditions for transition to another state exist, nothing will |
165 * because If all conditions for transition to another state exist, nothing will |
198 * trigger it and transition will not happen. This forces the transition in such cases. |
166 * trigger it and transition will not happen. This forces the transition in such cases. |
199 * |
167 * |
200 */ |
168 */ |
201 void JustAdvancedToThisStateL(); |
169 virtual void JustAdvancedToThisStateL(); |
202 |
170 |
203 /** |
171 /** |
204 * This is called when leaving this state, |
172 * This is called when leaving this state, |
205 * |
173 * |
206 */ |
174 */ |
207 void JustBeforeLeavingThisStateL(); |
175 virtual void JustBeforeLeavingThisStateL(); |
208 |
176 |
209 /** |
177 /** |
210 * handles issue |
178 * handles issue |
211 */ |
179 */ |
212 void DoHandleL(); |
180 virtual void DoHandleL(); |
213 |
181 |
214 private: |
182 protected: |
|
183 |
|
184 /** |
|
185 * Default constructor |
|
186 * @param aWatcher owner |
|
187 */ |
|
188 CUsbStateHostHandle(CUsbOtgWatcher* aWatcher); |
|
189 |
|
190 /** |
|
191 * 2nd phase construction |
|
192 */ |
|
193 void ConstructL(); |
|
194 |
|
195 protected: |
215 // data |
196 // data |
216 |
197 |
217 /** |
198 /** |
218 * identifies situation to be handled |
199 * identifies situation to be handled |
219 */ |
200 */ |
220 TInt iWhat; |
201 TInt iWhat; |
221 |
202 |
222 /** |
|
223 * too much power timer |
|
224 * own |
|
225 */ |
|
226 CUsbTimer* iTooMuchPowerTimer; |
|
227 |
|
228 /** |
|
229 * drivers not found |
|
230 * own |
|
231 */ |
|
232 CUsbTimer* iDriversNotFoundTimer; |
|
233 }; |
203 }; |
234 |
204 |
235 #endif // C_USBSTATEHOSTHANDLE_H |
205 #endif // C_USBSTATEHOSTHANDLE_H |