|
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: Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "cusbstate.h" |
|
20 |
|
21 #include "panic.h" |
|
22 #include "debug.h" |
|
23 |
|
24 // --------------------------------------------------------------------------- |
|
25 // |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 CUsbState::CUsbState(CUsbOtgWatcher* aWatcher) : |
|
29 iWatcher(aWatcher) |
|
30 { |
|
31 } |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 CUsbState::~CUsbState() |
|
38 { |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 void CUsbState::JustAdvancedToThisStateL() |
|
46 { |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 void CUsbState::JustBeforeLeavingThisStateL() |
|
54 { |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 void CUsbState::ChangeStateL(TUsbStateIds aNewStateId) |
|
62 { |
|
63 |
|
64 iWatcher->ChangeStateL(aNewStateId); |
|
65 |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 void CUsbState::ChangeHostStateL(TUsbStateIds aNewStateId) |
|
73 { |
|
74 |
|
75 iWatcher->ChangeHostStateL(aNewStateId); |
|
76 |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 void CUsbState::SetPersonalityL() |
|
84 { |
|
85 } |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 void CUsbState::CancelSetPersonalityL() |
|
92 { |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 void CUsbState::SetPreviousPersonalityL() |
|
100 { |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 void CUsbState::CancelSetPreviousPersonalityL() |
|
108 { |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 void CUsbState::SetPreviousPreviousPersonalityOnDisconnectL() |
|
116 { |
|
117 } |
|
118 |
|
119 ///////////////////////////////////////////////////////////////////////////////////// |
|
120 |
|
121 // From IdPin observer |
|
122 // --------------------------------------------------------------------------- |
|
123 // |
|
124 // --------------------------------------------------------------------------- |
|
125 // |
|
126 void CUsbState::IdPinOffL() |
|
127 { |
|
128 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::IdPinOffL" ) ); |
|
129 Panic(EIdPinOffNotExpected); |
|
130 } |
|
131 |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 // --------------------------------------------------------------------------- |
|
135 // |
|
136 void CUsbState::IdPinOnL() |
|
137 { |
|
138 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::IdPinOnL" ) ); |
|
139 Panic(EIdPinOnNotExpected); |
|
140 } |
|
141 |
|
142 // From VBus observer |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 void CUsbState::VBusDownL() |
|
148 { |
|
149 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::VBusDownL" ) ); |
|
150 Panic(EVBusDownNotExpected); |
|
151 } |
|
152 |
|
153 // --------------------------------------------------------------------------- |
|
154 // |
|
155 // --------------------------------------------------------------------------- |
|
156 // |
|
157 void CUsbState::VBusUpL() |
|
158 { |
|
159 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::VBusUpL" ) ); |
|
160 } |
|
161 |
|
162 // From OTG state observer |
|
163 // --------------------------------------------------------------------------- |
|
164 // |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 void CUsbState::AIdleL() |
|
168 { |
|
169 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::AIdleL" ) ); |
|
170 Panic(EAIdleNotExpected); |
|
171 } |
|
172 |
|
173 // --------------------------------------------------------------------------- |
|
174 // |
|
175 // --------------------------------------------------------------------------- |
|
176 // |
|
177 void CUsbState::AHostL() |
|
178 { |
|
179 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::AHostL" ) ); |
|
180 Panic(EAHostNotExpected); |
|
181 } |
|
182 |
|
183 // --------------------------------------------------------------------------- |
|
184 // |
|
185 // --------------------------------------------------------------------------- |
|
186 // |
|
187 void CUsbState::APeripheralL() |
|
188 { |
|
189 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::APeripheralL" ) ); |
|
190 Panic(EAPeripheralNotExpected); |
|
191 } |
|
192 |
|
193 // --------------------------------------------------------------------------- |
|
194 // |
|
195 // --------------------------------------------------------------------------- |
|
196 // |
|
197 void CUsbState::AVBusErrorL() |
|
198 { |
|
199 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::AVBusErrorL" ) ); |
|
200 Panic(EAVBusErrorNotExpected); |
|
201 } |
|
202 |
|
203 // --------------------------------------------------------------------------- |
|
204 // |
|
205 // --------------------------------------------------------------------------- |
|
206 // |
|
207 void CUsbState::BIdleL() |
|
208 { |
|
209 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::BIdleL" ) ); |
|
210 Panic(EBIdleNotExpected); |
|
211 } |
|
212 |
|
213 // --------------------------------------------------------------------------- |
|
214 // |
|
215 // --------------------------------------------------------------------------- |
|
216 // |
|
217 void CUsbState::BPeripheralL() |
|
218 { |
|
219 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::BPeripheralL" ) ); |
|
220 Panic(EBPeripheralNotExpected); |
|
221 } |
|
222 |
|
223 // --------------------------------------------------------------------------- |
|
224 // |
|
225 // --------------------------------------------------------------------------- |
|
226 // |
|
227 void CUsbState::BHostL() |
|
228 { |
|
229 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::BHostL" ) ); |
|
230 Panic(EBHostNotExpected); |
|
231 } |
|
232 |
|
233 // From bus activity observer |
|
234 // --------------------------------------------------------------------------- |
|
235 // |
|
236 // --------------------------------------------------------------------------- |
|
237 // |
|
238 void CUsbState::BusIdleL() |
|
239 { |
|
240 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::BusIdleL" ) ); |
|
241 Panic(EBusIdleNotExpected); |
|
242 } |
|
243 |
|
244 // --------------------------------------------------------------------------- |
|
245 // |
|
246 // --------------------------------------------------------------------------- |
|
247 // |
|
248 void CUsbState::BusActiveL() |
|
249 { |
|
250 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::BusActiveL" ) ); |
|
251 Panic(EBusActiveNotExpected); |
|
252 } |
|
253 |
|
254 // From Host Event notification observer |
|
255 // --------------------------------------------------------------------------- |
|
256 // |
|
257 // --------------------------------------------------------------------------- |
|
258 // |
|
259 void CUsbState::DeviceAttachedL(TDeviceEventInformation) |
|
260 { |
|
261 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DeviceAttachedL" ) ); |
|
262 Panic(EDeviceAttachedNotExpected); |
|
263 } |
|
264 |
|
265 // --------------------------------------------------------------------------- |
|
266 // |
|
267 // --------------------------------------------------------------------------- |
|
268 // |
|
269 void CUsbState::DeviceDetachedL(TDeviceEventInformation) |
|
270 { |
|
271 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DeviceDetachedL" ) ); |
|
272 Panic(EDeviceDetachedNotExpected); |
|
273 } |
|
274 |
|
275 // --------------------------------------------------------------------------- |
|
276 // |
|
277 // --------------------------------------------------------------------------- |
|
278 // |
|
279 void CUsbState::DriverLoadSuccessL(TDeviceEventInformation) |
|
280 { |
|
281 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DriverLoadSuccessL" ) ); |
|
282 Panic(EDriverLoadSuccessNotExpected); |
|
283 } |
|
284 |
|
285 // --------------------------------------------------------------------------- |
|
286 // |
|
287 // --------------------------------------------------------------------------- |
|
288 // |
|
289 void CUsbState::DriverLoadPartialSuccessL(TDeviceEventInformation) |
|
290 { |
|
291 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DriverLoadPartialSuccessL" ) ); |
|
292 Panic(EDriverLoadPartialSuccessNotExpected); |
|
293 } |
|
294 |
|
295 // --------------------------------------------------------------------------- |
|
296 // |
|
297 // --------------------------------------------------------------------------- |
|
298 // |
|
299 void CUsbState::DriverLoadFailureL(TDeviceEventInformation) |
|
300 { |
|
301 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DriverLoadFailureL" ) ); |
|
302 Panic(EDriverLoadFailureNotExpected); |
|
303 } |
|
304 |
|
305 // --------------------------------------------------------------------------- |
|
306 // |
|
307 // --------------------------------------------------------------------------- |
|
308 // |
|
309 void CUsbState::BadHubPositionL() |
|
310 { |
|
311 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::BadHubPositionL" ) ); |
|
312 Panic(EBadHubPositionNotExpected); |
|
313 } |
|
314 |
|
315 // --------------------------------------------------------------------------- |
|
316 // |
|
317 // --------------------------------------------------------------------------- |
|
318 // |
|
319 void CUsbState::VBusErrorL() |
|
320 { |
|
321 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::VBusErrorL" ) ); |
|
322 Panic(EVBusErrorNotExpected); |
|
323 } |
|
324 |
|
325 // --------------------------------------------------------------------------- |
|
326 // |
|
327 // --------------------------------------------------------------------------- |
|
328 // |
|
329 void CUsbState::MessageNotificationReceivedL(TInt) |
|
330 { |
|
331 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::MessageNotificationReceivedL" ) ); |
|
332 Panic(EMessageNotificationNotExpected); |
|
333 } |
|
334 |
|
335 // --------------------------------------------------------------------------- |
|
336 // |
|
337 // --------------------------------------------------------------------------- |
|
338 // |
|
339 void CUsbState::SrpReceivedL() |
|
340 { |
|
341 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::SrpReceivedL" ) ); |
|
342 Panic(ESrpNotExpected); |
|
343 } |
|
344 |
|
345 // --------------------------------------------------------------------------- |
|
346 // |
|
347 // --------------------------------------------------------------------------- |
|
348 // |
|
349 void CUsbState::SessionRequestedL() |
|
350 { |
|
351 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::SessionRequestedL" ) ); |
|
352 Panic(ESessionRequestNotExpected); |
|
353 } |