usbengines/usbotgwatcher/src/cusbstatehosthandle.cpp
changeset 1 705ec7b86991
parent 0 1e05558e2206
child 3 47c263f7e521
equal deleted inserted replaced
0:1e05558e2206 1:705ec7b86991
   225         case EUsbWatcherErrDriversNotFound:
   225         case EUsbWatcherErrDriversNotFound:
   226             {
   226             {
   227                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL DriversNotFound" ) );
   227                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL DriversNotFound" ) );
   228             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   228             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   229             iWatcher->Usb().BusDrop();
   229             iWatcher->Usb().BusDrop();
   230             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   231             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   230             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   232                     EUsbOtgUnsupportedDevice, this);
   231                     EUsbOtgUnsupportedDevice, this);
   233 
   232 
   234             break;
   233             break;
   235             }
   234             }
   236         case EUsbWatcherHubsNotSupported:
   235         case EUsbWatcherHubsNotSupported:
   237             {
   236             {
   238                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherHubsNotSupported" ) );
   237                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherHubsNotSupported" ) );
   239             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   238             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   240             iWatcher->Usb().BusDrop();
   239             iWatcher->Usb().BusDrop();
   241             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   242             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   240             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   243                     EUsbOtgHubUnsupported, this);
   241                     EUsbOtgHubUnsupported, this);
   244             break;
   242             break;
   245             }
   243             }
   246         case EUsbWatcherErrDeviceRequiresTooMuchPowerOnEnumeration:
   244         case EUsbWatcherErrDeviceRequiresTooMuchPowerOnEnumeration:
   253         case EUsbWatcherErrDeviceRequiresTooMuchPower:
   251         case EUsbWatcherErrDeviceRequiresTooMuchPower:
   254             {
   252             {
   255                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDeviceRequiresTooMuchPower" ) );
   253                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDeviceRequiresTooMuchPower" ) );
   256             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   254             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   257             iWatcher->Usb().BusDrop();
   255             iWatcher->Usb().BusDrop();
   258             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   259             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   256             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   260                     EUsbOtgTooMuchPower, this);
   257                     EUsbOtgTooMuchPower, this);
   261             break;
   258             break;
   262             }
   259             }
   263         case EUsbWatcherErrUnsupportedDevice:
   260         case EUsbWatcherErrUnsupportedDevice:
   264             {
   261             {
   265                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrUnsupportedDevice" ) );
   262                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrUnsupportedDevice" ) );
   266             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   263             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   267             iWatcher->Usb().BusDrop();
   264             iWatcher->Usb().BusDrop();
   268             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   269             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   265             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   270                     EUsbOtgUnsupportedDevice, this);
   266                     EUsbOtgUnsupportedDevice, this);
   271             break;
   267             break;
   272             }
   268             }
   273         case EUsbWatcherConnectedToOTG:
   269         case EUsbWatcherConnectedToOTG:
   274             {
   270             {
   275                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherConnectedToOTG" ) );
   271                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherConnectedToOTG" ) );
   276                 
   272                 
   277             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped
   273             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped
   278             iWatcher->Usb().BusDrop();
   274             iWatcher->Usb().BusDrop();
   279             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   280             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   275             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   281                     EUsbOtgUnsupportedDevice, this);
   276                     EUsbOtgUnsupportedDevice, this);
   282             break;
   277             break;
   283             }
   278             }
   284         case EUsbWatcherErrDandlingCable:
   279         case EUsbWatcherErrDandlingCable:
   285             {
   280             {
   286                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDandlingCable" ) );
   281                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrDandlingCable" ) );
   287             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   282             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   288             iWatcher->Usb().BusDrop();
   283             iWatcher->Usb().BusDrop();
   289             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   290             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   284             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   291                     EUsbOtgErrorAttachTimedOut, this);
   285                     EUsbOtgErrorAttachTimedOut, this);
   292             break;
   286             break;
   293             }
   287             }
   294         case EUsbWatcherNoActivity:
   288         case EUsbWatcherNoActivity:
   295             {
   289             {
   296                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherNoActivity" ) );
   290                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherNoActivity" ) );
   297             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   291             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   298             iWatcher->Usb().BusDrop();
   292             iWatcher->Usb().BusDrop();
   299             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   300             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   293             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   301                     EUsbOtgUnsupportedDevice, this);
   294                     EUsbOtgUnsupportedDevice, this);
   302 
   295 
   303             break;
   296             break;
   304             }
   297             }
   305         case EUsbWatcherErrorInConnection:
   298         case EUsbWatcherErrorInConnection:
   306             {
   299             {
   307                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrorInConnection" ) );
   300                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherErrorInConnection" ) );
   308             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   301             // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   309             iWatcher->Usb().BusDrop();
   302             iWatcher->Usb().BusDrop();
   310             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   311             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   303             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   312                     EUsbOtgErrorInConnection, this);
   304                     EUsbOtgErrorInConnection, this);
   313             break;
   305             break;
   314             }
   306             }
   315         case EUsbWatcherCanNotStartUsbServices:
   307         case EUsbWatcherCanNotStartUsbServices:
   316             {
   308             {
   317             FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherCanNotStartUsbServices" ) );
   309             FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL EUsbWatcherCanNotStartUsbServices" ) );
   318             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   319             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   310             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   320                 EUsbOtgErrorInConnection, this);
   311                 EUsbOtgErrorInConnection, this);
   321             break;           
   312             break;           
   322             }
   313             }
   323         // errors from observers mapped to one
   314         // errors from observers mapped to one
   328         case EUsbWatcherMessageNotificationError:
   319         case EUsbWatcherMessageNotificationError:
   329             {
   320             {
   330             FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL Error from observer" ) );
   321             FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL Error from observer" ) );
   331         // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   322         // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped 
   332         iWatcher->Usb().BusDrop();
   323         iWatcher->Usb().BusDrop();
   333         iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   334         iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   324         iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   335                 EUsbOtgErrorInConnection, this);
   325                 EUsbOtgErrorInConnection, this);
   336             break;
   326             break;
   337             }
   327             }
   338         default:
   328         default:
   590         {
   580         {
   591         case ETooMuchPowerRequiredTimer:
   581         case ETooMuchPowerRequiredTimer:
   592             {
   582             {
   593                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::TimerElapsedL - ETooMuchPowerRequiredTimer" ) );
   583                 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::TimerElapsedL - ETooMuchPowerRequiredTimer" ) );
   594             iWatcher->Usb().BusDrop();
   584             iWatcher->Usb().BusDrop();
   595             iWatcher->NotifManager()->ShowIndicatorL(EFalse);
       
   596             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   585             iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   597                     EUsbOtgTooMuchPowerRequired, this);
   586                     EUsbOtgTooMuchPowerRequired, this);
   598             break;
   587             break;
   599             }
   588             }
   600         default:
   589         default: