usbengines/usbotgwatcher/src/cusbstatehosthandledropping.cpp
branchRCL_3
changeset 7 ff9df6630274
parent 6 a15c582fbf97
child 10 f6533aee8b2b
equal deleted inserted replaced
6:a15c582fbf97 7:ff9df6630274
     1 /*
     1 /*
     2  * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008 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".
    16  */
    16  */
    17 
    17 
    18 #include <usbuinotif.h>
    18 #include <usbuinotif.h>
    19 #include <d32usbdi_errors.h>
    19 #include <d32usbdi_errors.h>
    20 
    20 
       
    21 #include "cusbotgwatcher.h"
    21 #include "cusbstatehosthandledropping.h"
    22 #include "cusbstatehosthandledropping.h"
       
    23 
    22 #ifndef STIF
    24 #ifndef STIF
    23 #include "cusbnotifmanager.h"
    25 #include "cusbnotifmanager.h"
    24 #else
    26 #else
    25 #include "mockcusbnotifmanager.h"
    27 #include "mockcusbnotifmanager.h"
    26 #endif
    28 #endif
   158             LOG( "EUsbWatcherCanNotStartUsbServices" );
   160             LOG( "EUsbWatcherCanNotStartUsbServices" );
   159 
   161 
   160             // no break here                     
   162             // no break here                     
   161             }
   163             }
   162 
   164 
   163             // no break statement for following cases    
   165             // no break statement for following cases 
       
   166         case EUsbWatcherNoMemory:
   164         case EUsbWatcherIdPinError:
   167         case EUsbWatcherIdPinError:
   165         case EUsbWatcherVBusObserverError:
   168         case EUsbWatcherVBusObserverError:
   166         case EUsbWatcherHostEventNotificationError:
   169         case EUsbWatcherHostEventNotificationError:
   167         case EUsbWatcherOtgStateError:
   170         case EUsbWatcherOtgStateError:
   168         case EUsbWatcherMessageNotificationError:
   171         case EUsbWatcherMessageNotificationError:
   176             break;
   179             break;
   177             }
   180             }
   178         default:
   181         default:
   179             {
   182             {
   180             LOG1("Unexpected situation to be handled iWhat = %d" , iWhat );
   183             LOG1("Unexpected situation to be handled iWhat = %d" , iWhat );
   181             Panic( EUnexpectedSituationToHandle);
   184             PANIC( EUnexpectedSituationToHandle);
   182             break;
   185             break;
   183             }
   186             }
   184 
   187 
   185         }
   188         }
   186     }
   189     }
   249         case EUsbWatcherErrorInConnection:
   252         case EUsbWatcherErrorInConnection:
   250             {
   253             {
   251             LOG("EUsbWatcherErrorInConnection" );
   254             LOG("EUsbWatcherErrorInConnection" );
   252             iWatcher.NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   255             iWatcher.NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
   253                     EUsbOtgErrorInConnection, this);
   256                     EUsbOtgErrorInConnection, this);
       
   257             break;
       
   258             }
       
   259         case EUsbWatcherNoMemory:
       
   260             {
       
   261             LOG("EUsbWatcherNoMemory" );
       
   262             iWatcher.NotifManager()->ShowNotifierL(KUsbUiNotifOtgError,
       
   263                     EUsbOtgErrorNoMemory, this);
   254             break;
   264             break;
   255             }
   265             }
   256         case EUsbWatcherCanNotStartUsbServices:
   266         case EUsbWatcherCanNotStartUsbServices:
   257             {
   267             {
   258             LOG("EUsbWatcherCanNotStartUsbServices" );
   268             LOG("EUsbWatcherCanNotStartUsbServices" );
   275             break;
   285             break;
   276             }
   286             }
   277         default:
   287         default:
   278             {
   288             {
   279             LOG1("Unexpected situation to be handled iWhat = %d", iWhat );
   289             LOG1("Unexpected situation to be handled iWhat = %d", iWhat );
   280             Panic( EUnexpectedSituationToHandle);
   290             PANIC( EUnexpectedSituationToHandle);
   281             break;
   291             break;
   282             }
   292             }
   283         }
   293         }
   284     }
   294     }
   285 
   295 
   303     {
   313     {
   304     LOG_FUNC
   314     LOG_FUNC
   305     }
   315     }
   306 
   316 
   307 // From Host Event notification observer
   317 // From Host Event notification observer
       
   318 // ---------------------------------------------------------------------------
       
   319 // 
       
   320 // ---------------------------------------------------------------------------
       
   321 //
       
   322 void CUsbStateHostHandleDropping::AVBusErrorL()
       
   323     {
       
   324     LOG_FUNC
       
   325     iWatcher.Usb().BusClearError();
       
   326     }
       
   327 
   308 // ---------------------------------------------------------------------------
   328 // ---------------------------------------------------------------------------
   309 // 
   329 // 
   310 // ---------------------------------------------------------------------------
   330 // ---------------------------------------------------------------------------
   311 //
   331 //
   312 void CUsbStateHostHandleDropping::DeviceAttachedL(
   332 void CUsbStateHostHandleDropping::DeviceAttachedL(
   378             break;
   398             break;
   379             }
   399             }
   380 
   400 
   381         }
   401         }
   382     }
   402     }
       
   403 
       
   404 // ---------------------------------------------------------------------------
       
   405 // 
       
   406 // ---------------------------------------------------------------------------
       
   407 //
       
   408 void CUsbStateHostHandleDropping::VBusErrorL()
       
   409     {
       
   410     LOG_FUNC
       
   411     iWatcher.Usb().BusClearError();
       
   412     }