usbengines/usbotgwatcher/src/cusbstatehostainitiate.cpp
branchRCL_3
changeset 5 7068aba64af5
parent 1 705ec7b86991
child 6 a15c582fbf97
equal deleted inserted replaced
4:7e15987c4500 5:7068aba64af5
    99     TInt err = iWatcher->Usb().EnableFunctionDriverLoading();
    99     TInt err = iWatcher->Usb().EnableFunctionDriverLoading();
   100 
   100 
   101     if (KErrNone != err)
   101     if (KErrNone != err)
   102         {
   102         {
   103             FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiate::JustAdvancedToThisStateL EnableFunctionDriverLoading error" ) );
   103             FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiate::JustAdvancedToThisStateL EnableFunctionDriverLoading error" ) );
   104         iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection);
   104         iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection, EUsbStateHostHandle);
   105         return;
   105         return;
   106         }
   106         }
   107 
   107 
   108         FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostAInitiate::JustAdvancedToThisStateL EnableFunctionDriverLoading(); = %d" ), err));
   108         FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostAInitiate::JustAdvancedToThisStateL EnableFunctionDriverLoading(); = %d" ), err));
   109 
   109 
   115         TInt busReqErr(KErrGeneral);
   115         TInt busReqErr(KErrGeneral);
   116         TUint count(0);
   116         TUint count(0);
   117 
   117 
   118         while (count < maxTrial && KErrNone != busReqErr)
   118         while (count < maxTrial && KErrNone != busReqErr)
   119             {
   119             {
       
   120             FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiate Calling RUsb::BusRequest()..." ) );
   120             busReqErr = iWatcher->Usb().BusRequest();
   121             busReqErr = iWatcher->Usb().BusRequest();
   121                 FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostAInitiate::JustAdvancedToThisStateL BusRequest() = %d" ), err));
   122                 FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostAInitiate::JustAdvancedToThisStateL BusRequest() = %d" ), err));
   122 
   123 
   123             if (KErrNone != busReqErr)
   124             if (KErrNone != busReqErr)
   124                 {
   125                 {
   125                 err = iWatcher->Usb().BusClearError();
   126                 err = iWatcher->Usb().BusClearError();
   126                 if (KErrNone != err)
   127                 if (KErrNone != err)
   127                     {
   128                     {
   128                     iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection);
   129                     iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection, EUsbStateHostHandle);
   129                     return;
   130                     return;
   130                     }
   131                     }
   131                 }
   132                 }
   132             ++count;
   133             ++count;
   133             }
   134             }
   134         if (KErrNone != busReqErr)
   135         if (KErrNone != busReqErr)
   135             {
   136             {
   136             iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection);
   137             iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection, EUsbStateHostHandle);
   137             return;
   138             return;
   138             }
   139             }
   139         }
   140         }
   140 
   141 
   141     // start timer, waiting for device attachment
   142     // start timer, waiting for device attachment