58 // --------------------------------------------------------------------------- |
58 // --------------------------------------------------------------------------- |
59 // |
59 // |
60 void CUsbStateHostHandle::ConstructL() |
60 void CUsbStateHostHandle::ConstructL() |
61 { |
61 { |
62 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::ConstructL" ) ); |
62 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::ConstructL" ) ); |
63 |
|
64 iTooMuchPowerTimer = CUsbTimer::NewL(this, ETooMuchPowerRequiredTimer); |
|
65 iDriversNotFoundTimer = CUsbTimer::NewL(this, EDriversNotFoundTimer); |
|
66 |
|
67 } |
63 } |
68 |
64 |
69 // --------------------------------------------------------------------------- |
65 // --------------------------------------------------------------------------- |
70 // |
66 // |
71 // --------------------------------------------------------------------------- |
67 // --------------------------------------------------------------------------- |
72 // |
68 // |
73 CUsbStateHostHandle::~CUsbStateHostHandle() |
69 CUsbStateHostHandle::~CUsbStateHostHandle() |
74 { |
70 { |
75 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::~CUsbStateHostHandle" ) ); |
71 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::~CUsbStateHostHandle" ) ); |
76 |
72 |
77 delete iTooMuchPowerTimer; |
|
78 delete iDriversNotFoundTimer; |
|
79 } |
73 } |
80 |
74 |
81 // --------------------------------------------------------------------------- |
75 // --------------------------------------------------------------------------- |
82 // |
76 // |
83 // --------------------------------------------------------------------------- |
77 // --------------------------------------------------------------------------- |
218 // --------------------------------------------------------------------------- |
209 // --------------------------------------------------------------------------- |
219 // |
210 // |
220 void CUsbStateHostHandle::DoHandleL() |
211 void CUsbStateHostHandle::DoHandleL() |
221 { |
212 { |
222 FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL iWhat = %d" ), iWhat)); |
213 FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL iWhat = %d" ), iWhat)); |
223 |
214 |
224 if (iTooMuchPowerTimer) |
215 // Drop VBus first |
225 iTooMuchPowerTimer->Cancel(); |
216 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
226 |
217 iWatcher->Usb().BusDrop(); |
|
218 |
227 switch (iWhat) |
219 switch (iWhat) |
228 { |
220 { |
229 case EUsbWatcherErrDriversNotFound: |
|
230 { |
|
231 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL DriversNotFound" ) ); |
|
232 |
221 |
233 iDriversNotFoundTimer->After(KTimeDriversNotFound); |
|
234 break; |
|
235 |
|
236 } |
|
237 case EUsbWatcherHubsNotSupported: |
222 case EUsbWatcherHubsNotSupported: |
238 { |
223 { |
239 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherHubsNotSupported" ) ); |
224 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherHubsNotSupported" ) ); |
240 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
241 iWatcher->Usb().BusDrop(); |
|
242 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
225 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
243 EUsbOtgHubUnsupported, this); |
226 EUsbOtgHubUnsupported, this); |
244 break; |
227 break; |
245 } |
228 } |
246 case EUsbWatcherErrDeviceRequiresTooMuchPowerOnEnumeration: |
|
247 { |
|
248 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDeviceRequiresTooMuchPowerOnEnumeration" ) ); |
|
249 |
|
250 iTooMuchPowerTimer->After(KTimeTooMuchPowerRequired); |
|
251 break; |
|
252 } |
|
253 case EUsbWatcherErrDeviceRequiresTooMuchPower: |
229 case EUsbWatcherErrDeviceRequiresTooMuchPower: |
254 { |
230 { |
255 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDeviceRequiresTooMuchPower" ) ); |
231 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDeviceRequiresTooMuchPower" ) ); |
256 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
257 iWatcher->Usb().BusDrop(); |
|
258 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
232 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
259 EUsbOtgTooMuchPower, this); |
233 EUsbOtgTooMuchPower, this); |
260 break; |
234 break; |
261 } |
235 } |
262 case EUsbWatcherErrUnsupportedDevice: |
236 case EUsbWatcherErrUnsupportedDevice: |
263 { |
237 { |
264 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrUnsupportedDevice" ) ); |
238 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrUnsupportedDevice" ) ); |
265 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
266 iWatcher->Usb().BusDrop(); |
|
267 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
239 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
268 EUsbOtgUnsupportedDevice, this); |
240 EUsbOtgUnsupportedDevice, this); |
269 break; |
241 break; |
270 } |
242 } |
271 case EUsbWatcherConnectedToOTG: |
243 case EUsbWatcherConnectedToOTG: |
272 { |
244 { |
273 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherConnectedToOTG" ) ); |
245 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherConnectedToOTG" ) ); |
274 |
|
275 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
276 iWatcher->Usb().BusDrop(); |
|
277 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
246 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
278 EUsbOtgUnsupportedDevice, this); |
247 EUsbOtgUnsupportedDevice, this); |
|
248 |
279 break; |
249 break; |
280 } |
250 } |
281 case EUsbWatcherErrDandlingCable: |
251 case EUsbWatcherErrDandlingCable: |
282 { |
252 { |
283 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDandlingCable" ) ); |
253 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDandlingCable" ) ); |
284 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
285 iWatcher->Usb().BusDrop(); |
|
286 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
254 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
287 EUsbOtgErrorAttachTimedOut, this); |
255 EUsbOtgErrorAttachTimedOut, this); |
288 break; |
256 break; |
289 } |
257 } |
290 case EUsbWatcherNoActivity: |
258 case EUsbWatcherNoActivity: |
291 { |
259 { |
292 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherNoActivity" ) ); |
260 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherNoActivity" ) ); |
293 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
294 iWatcher->Usb().BusDrop(); |
|
295 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
261 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
296 EUsbOtgUnsupportedDevice, this); |
262 EUsbOtgUnsupportedDevice, this); |
297 |
263 |
298 break; |
264 break; |
299 } |
265 } |
300 case EUsbWatcherErrorInConnection: |
266 case EUsbWatcherErrorInConnection: |
301 { |
267 { |
302 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrorInConnection" ) ); |
268 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrorInConnection" ) ); |
303 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
304 iWatcher->Usb().BusDrop(); |
|
305 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
269 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
306 EUsbOtgErrorInConnection, this); |
270 EUsbOtgErrorInConnection, this); |
307 break; |
271 break; |
308 } |
272 } |
309 case EUsbWatcherCanNotStartUsbServices: |
273 case EUsbWatcherCanNotStartUsbServices: |
319 case EUsbWatcherHostEventNotificationError: |
283 case EUsbWatcherHostEventNotificationError: |
320 case EUsbWatcherOtgStateError: |
284 case EUsbWatcherOtgStateError: |
321 case EUsbWatcherMessageNotificationError: |
285 case EUsbWatcherMessageNotificationError: |
322 { |
286 { |
323 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL Error from observer" ) ); |
287 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL Error from observer" ) ); |
324 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
325 iWatcher->Usb().BusDrop(); |
|
326 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
288 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
327 EUsbOtgErrorInConnection, this); |
289 EUsbOtgErrorInConnection, this); |
328 break; |
290 break; |
329 } |
291 } |
330 default: |
292 default: |
331 { |
293 { |
332 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::WaitNotifierCompletedL Unexpected situation to be handled" ) ); |
294 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL Unexpected situation to be handled" ) ); |
333 Panic(EUnexpectedSituationToHandle); |
295 Panic(EUnexpectedSituationToHandle); |
334 break; |
296 break; |
335 } |
297 } |
336 } |
298 } |
337 } |
299 } |
338 |
300 |
339 ///////////////////////////////////////////////////////////////////////////////////// |
301 ///////////////////////////////////////////////////////////////////////////////////// |
340 // just ignore all the events |
|
341 // From VBus observer |
302 // From VBus observer |
|
303 // --------------------------------------------------------------------------- |
|
304 // |
|
305 // --------------------------------------------------------------------------- |
|
306 // |
|
307 void CUsbStateHostHandle::VBusUpL() |
|
308 { |
|
309 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::VBusUpL" ) ); |
|
310 // as result of BusRespondSrp() VBus might rise up. |
|
311 // role swap is not supported => drop vbus |
|
312 // when role swap is supported, leave this function empty |
|
313 |
|
314 iWatcher->Usb().BusDrop(); |
|
315 } |
|
316 |
|
317 // --------------------------------------------------------------------------- |
|
318 // this is expected in the state, for example after calling BusDrop |
|
319 // --------------------------------------------------------------------------- |
|
320 // |
342 void CUsbStateHostHandle::VBusDownL() |
321 void CUsbStateHostHandle::VBusDownL() |
343 { |
322 { |
344 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::VBusDownL" ) ); |
323 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::VBusDownL" ) ); |
345 } |
324 } |
346 |
325 |
|
326 // --------------------------------------------------------------------------- |
|
327 // |
|
328 // --------------------------------------------------------------------------- |
|
329 // |
|
330 void CUsbStateHostHandle::VBusErrorL() |
|
331 { |
|
332 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::VBusErrorL" ) ); |
|
333 |
|
334 iWatcher->Usb().BusClearError(); |
|
335 } |
|
336 |
347 // From OTG state observer |
337 // From OTG state observer |
348 // --------------------------------------------------------------------------- |
338 // --------------------------------------------------------------------------- |
349 // |
339 // this AIdle means that VBus gets down. From usbwatcher POV no need to change state here |
350 // --------------------------------------------------------------------------- |
340 // --------------------------------------------------------------------------- |
351 // |
341 // |
352 void CUsbStateHostHandle::AIdleL() |
342 void CUsbStateHostHandle::AIdleL() |
353 { |
343 { |
354 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::AIdleL" ) ); |
344 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::AIdleL" ) ); |
355 |
345 |
356 } |
346 } |
357 |
347 |
358 // --------------------------------------------------------------------------- |
348 // --------------------------------------------------------------------------- |
359 // |
349 // this means VBus gets up (for example as result RespondSrp()). Do not change state to Host, due to for usbwatcher it would mean |
|
350 // that device attached and driverls found. |
360 // --------------------------------------------------------------------------- |
351 // --------------------------------------------------------------------------- |
361 // |
352 // |
362 void CUsbStateHostHandle::AHostL() |
353 void CUsbStateHostHandle::AHostL() |
363 { |
354 { |
364 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::AHostL" ) ); |
355 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::AHostL" ) ); |
369 // --------------------------------------------------------------------------- |
360 // --------------------------------------------------------------------------- |
370 // |
361 // |
371 void CUsbStateHostHandle::APeripheralL() |
362 void CUsbStateHostHandle::APeripheralL() |
372 { |
363 { |
373 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::APeripheralL" ) ); |
364 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::APeripheralL" ) ); |
374 |
365 |
375 } |
366 ChangeHostStateL(EUsbStateHostAPeripheral); |
376 |
367 |
377 // --------------------------------------------------------------------------- |
368 } |
|
369 |
|
370 // --------------------------------------------------------------------------- |
|
371 // ignore any problems on VBus, just clear it |
378 // |
372 // |
379 // --------------------------------------------------------------------------- |
373 // --------------------------------------------------------------------------- |
380 // |
374 // |
381 void CUsbStateHostHandle::AVBusErrorL() |
375 void CUsbStateHostHandle::AVBusErrorL() |
382 { |
376 { |
383 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::AVBusErrorL" ) ); |
377 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::AVBusErrorL" ) ); |
384 |
378 iWatcher->Usb().BusClearError(); |
385 } |
|
386 |
|
387 // --------------------------------------------------------------------------- |
|
388 // |
|
389 // --------------------------------------------------------------------------- |
|
390 // |
|
391 void CUsbStateHostHandle::BIdleL() |
|
392 { |
|
393 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BIdleL" ) ); |
|
394 |
|
395 } |
|
396 |
|
397 // --------------------------------------------------------------------------- |
|
398 // |
|
399 // --------------------------------------------------------------------------- |
|
400 // |
|
401 void CUsbStateHostHandle::BPeripheralL() |
|
402 { |
|
403 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BPeripheralL" ) ); |
|
404 |
|
405 } |
|
406 |
|
407 // --------------------------------------------------------------------------- |
|
408 // |
|
409 // --------------------------------------------------------------------------- |
|
410 // |
|
411 void CUsbStateHostHandle::BHostL() |
|
412 { |
|
413 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BHostL" ) ); |
|
414 |
|
415 } |
379 } |
416 |
380 |
417 // From bus activity observer |
381 // From bus activity observer |
418 // --------------------------------------------------------------------------- |
382 // --------------------------------------------------------------------------- |
419 // |
383 // |
420 // --------------------------------------------------------------------------- |
384 // --------------------------------------------------------------------------- |
421 // |
385 // |
422 void CUsbStateHostHandle::BusIdleL() |
386 void CUsbStateHostHandle::BusIdleL() |
423 { |
387 { |
424 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BusIdleL" ) ); |
388 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BusIdleL" ) ); |
425 |
|
426 } |
389 } |
427 |
390 |
428 // --------------------------------------------------------------------------- |
391 // --------------------------------------------------------------------------- |
429 // |
392 // |
430 // --------------------------------------------------------------------------- |
393 // --------------------------------------------------------------------------- |
431 // |
394 // |
432 void CUsbStateHostHandle::BusActiveL() |
395 void CUsbStateHostHandle::BusActiveL() |
433 { |
396 { |
434 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BusActiveL" ) ); |
397 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BusActiveL" ) ); |
435 |
|
436 } |
398 } |
437 |
399 |
438 // From Host Event notification observer |
400 // From Host Event notification observer |
439 // --------------------------------------------------------------------------- |
401 // --------------------------------------------------------------------------- |
440 // |
402 // |
443 void CUsbStateHostHandle::DeviceAttachedL( |
405 void CUsbStateHostHandle::DeviceAttachedL( |
444 TDeviceEventInformation aDevEventInfo) |
406 TDeviceEventInformation aDevEventInfo) |
445 { |
407 { |
446 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceAttachedL" ) ); |
408 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceAttachedL" ) ); |
447 |
409 |
448 if (iTooMuchPowerTimer->IsActive() || iDriversNotFoundTimer->IsActive()) |
410 } |
449 { |
|
450 ChangeHostStateL(EUsbStateHostAInitiate); |
|
451 iWatcher->DeviceAttachedL(aDevEventInfo); |
|
452 return; |
|
453 } |
|
454 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceAttachedL Unexpected situation" ) ); |
|
455 } |
|
456 |
411 |
457 // --------------------------------------------------------------------------- |
412 // --------------------------------------------------------------------------- |
458 // |
413 // |
459 // --------------------------------------------------------------------------- |
414 // --------------------------------------------------------------------------- |
460 // |
415 // |
461 void CUsbStateHostHandle::DeviceDetachedL(TDeviceEventInformation) |
416 void CUsbStateHostHandle::DeviceDetachedL(TDeviceEventInformation) |
462 { |
417 { |
463 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceDetachedL" ) ); |
418 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceDetachedL" ) ); |
464 |
419 |
465 } |
420 } |
466 |
421 |
467 // --------------------------------------------------------------------------- |
422 // --------------------------------------------------------------------------- |
468 // |
423 // |
469 // --------------------------------------------------------------------------- |
424 // --------------------------------------------------------------------------- |
470 // |
425 // |
471 void CUsbStateHostHandle::DriverLoadSuccessL(TDeviceEventInformation) |
426 void CUsbStateHostHandle::DriverLoadSuccessL(TDeviceEventInformation) |
472 { |
427 { |
473 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DriverLoadSuccessL" ) ); |
428 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DriverLoadSuccessL" ) ); |
474 |
429 |
475 } |
430 } |
476 |
431 |
477 // --------------------------------------------------------------------------- |
432 // --------------------------------------------------------------------------- |
478 // |
433 // |
479 // --------------------------------------------------------------------------- |
434 // --------------------------------------------------------------------------- |
480 // |
435 // |
481 void CUsbStateHostHandle::DriverLoadPartialSuccessL(TDeviceEventInformation) |
436 void CUsbStateHostHandle::DriverLoadPartialSuccessL(TDeviceEventInformation) |
490 // |
445 // |
491 void CUsbStateHostHandle::DriverLoadFailureL(TDeviceEventInformation) |
446 void CUsbStateHostHandle::DriverLoadFailureL(TDeviceEventInformation) |
492 { |
447 { |
493 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DriverLoadFailureL" ) ); |
448 FLOG( _L( "[USBOTGWATCHER]\tCUsbState::DriverLoadFailureL" ) ); |
494 |
449 |
495 } |
|
496 |
|
497 // --------------------------------------------------------------------------- |
|
498 // |
|
499 // --------------------------------------------------------------------------- |
|
500 // |
|
501 void CUsbStateHostHandle::BadHubPositionL() |
|
502 { |
|
503 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::BadHubPositionL" ) ); |
|
504 |
|
505 if (iTooMuchPowerTimer->IsActive()) |
|
506 { |
|
507 ChangeHostStateL(EUsbStateHostAInitiate); |
|
508 iWatcher->BadHubPositionL(); |
|
509 } |
|
510 else |
|
511 { |
|
512 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceAttachedL Unexpected situation" ) ); |
|
513 } |
|
514 } |
|
515 |
|
516 // --------------------------------------------------------------------------- |
|
517 // |
|
518 // --------------------------------------------------------------------------- |
|
519 // |
|
520 void CUsbStateHostHandle::VBusErrorL() |
|
521 { |
|
522 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::VBusErrorL" ) ); |
|
523 |
|
524 iWatcher->Usb().BusClearError(); |
|
525 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::VBusErrorL Unexpected situation" ) ); |
|
526 } |
450 } |
527 |
451 |
528 // --------------------------------------------------------------------------- |
452 // --------------------------------------------------------------------------- |
529 // |
453 // |
530 // --------------------------------------------------------------------------- |
454 // --------------------------------------------------------------------------- |
566 void CUsbStateHostHandle::SessionRequestedL() |
486 void CUsbStateHostHandle::SessionRequestedL() |
567 { |
487 { |
568 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::SessionRequestedL" ) ); |
488 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::SessionRequestedL" ) ); |
569 |
489 |
570 } |
490 } |
571 |
|
572 // From TimerObserver |
|
573 // --------------------------------------------------------------------------- |
|
574 // |
|
575 // --------------------------------------------------------------------------- |
|
576 // |
|
577 void CUsbStateHostHandle::TimerElapsedL(TUsbTimerId aTimerId) |
|
578 { |
|
579 switch (aTimerId) |
|
580 { |
|
581 case ETooMuchPowerRequiredTimer: |
|
582 { |
|
583 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::TimerElapsedL - ETooMuchPowerRequiredTimer" ) ); |
|
584 iWatcher->Usb().BusDrop(); |
|
585 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
|
586 EUsbOtgTooMuchPowerRequired, this); |
|
587 break; |
|
588 } |
|
589 case EDriversNotFoundTimer: |
|
590 { |
|
591 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::TimerElapsedL - EDriversNotFoundTimer" ) ); |
|
592 // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped |
|
593 iWatcher->Usb().BusDrop(); |
|
594 iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, |
|
595 EUsbOtgUnsupportedDevice, this); |
|
596 |
|
597 break; |
|
598 } |
|
599 default: |
|
600 { |
|
601 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::TimerElapsedL - Unknown timer" ) ); |
|
602 Panic(EWrongTimerId); |
|
603 } |
|
604 } |
|
605 } |
|