usbengines/usbwatcher/src/cusbactivestate.cpp
changeset 52 831068540b07
parent 43 4712310216c0
child 80 e02eb84a14d2
equal deleted inserted replaced
51:e7f64b6bf69e 52:831068540b07
    54     LOG1( "Intial UsbDeviceState = %d" , iCurrentState );
    54     LOG1( "Intial UsbDeviceState = %d" , iCurrentState );
    55         
    55         
    56     // start USB if cable is pluged-in at bootup
    56     // start USB if cable is pluged-in at bootup
    57     if( EUsbDeviceStateUndefined != iCurrentState )
    57     if( EUsbDeviceStateUndefined != iCurrentState )
    58         {
    58         {
    59         iOwner.StateChangeNotify( iPreviousState, iCurrentState );
    59         iOwner.StateChangeNotifyL( iPreviousState, iCurrentState );
    60         iPreviousState = iCurrentState;
    60         iPreviousState = iCurrentState;
    61         }
    61         }
    62     iUsbMan.DeviceStateNotification( KUsbAllStates, iCurrentState, iStatus );
    62     iUsbMan.DeviceStateNotification( KUsbAllStates, iCurrentState, iStatus );
    63     SetActive();
    63     SetActive();
    64     }
    64     }
   104     // Notify only if there is a change
   104     // Notify only if there is a change
   105     if ( newState != iPreviousState )
   105     if ( newState != iPreviousState )
   106         {
   106         {
   107         LOG2( "USB device state changed: %d ==> %d", iPreviousState,
   107         LOG2( "USB device state changed: %d ==> %d", iPreviousState,
   108             newState );
   108             newState );
   109         iOwner.StateChangeNotify( iPreviousState, newState );
   109         iOwner.StateChangeNotifyL( iPreviousState, newState );
   110         iPreviousState = newState;
   110         iPreviousState = newState;
   111         }
   111         }
   112      else
   112      else
   113         {
   113         {
   114         LOG2("USB device change ignored: %d -> %d", iPreviousState,
   114         LOG2("USB device change ignored: %d -> %d", iPreviousState,