hti/HtiFramework/src/HtiCommAdapter.cpp
branchRCL_3
changeset 9 8a14024f954a
parent 4 73ff0d268e1d
equal deleted inserted replaced
8:ecff51f1e7fb 9:8a14024f954a
   211             }
   211             }
   212         }
   212         }
   213     // USB errors from d32usbc.h
   213     // USB errors from d32usbc.h
   214     else if ( -6700 > iStatus.Int() && iStatus.Int() > -6712 )
   214     else if ( -6700 > iStatus.Int() && iStatus.Int() > -6712 )
   215         {
   215         {
       
   216         if(iDispatcher->CommReconnect())
       
   217             {
       
   218             return;
       
   219             }
       
   220 
   216         if ( iDispatcher->GetShowErrorDialogs() )
   221         if ( iDispatcher->GetShowErrorDialogs() )
   217             {
   222             {
   218             TBuf<48> errorText;
   223             TBuf<48> errorText;
   219             errorText.Append( _L( "USB connection lost (" ) );
   224             errorText.Append( _L( "USB connection lost (" ) );
   220             errorText.AppendNum( iStatus.Int() );
   225             errorText.AppendNum( iStatus.Int() );
   224         User::Exit( KErrDisconnected );
   229         User::Exit( KErrDisconnected );
   225         }
   230         }
   226     else if ( iStatus == KErrDisconnected )
   231     else if ( iStatus == KErrDisconnected )
   227         {
   232         {
   228         // This happens if Bluetooth connection is lost.
   233         // This happens if Bluetooth connection is lost.
       
   234         if(iDispatcher->CommReconnect())
       
   235             {
       
   236             return;
       
   237             }
       
   238         
   229         if ( iDispatcher->GetShowErrorDialogs() )
   239         if ( iDispatcher->GetShowErrorDialogs() )
   230             {
   240             {
   231             CHtiNotifier::ShowErrorL(
   241             CHtiNotifier::ShowErrorL(
   232                     _L( "Connection lost. HTI stopped." ), KErrDisconnected );
   242                     _L( "Connection lost. HTI stopped." ), KErrDisconnected );
   233             }
   243             }
   257                 }
   267                 }
   258             else
   268             else
   259                 {
   269                 {
   260                 HTI_LOG_FORMAT( "Error %d, reissue request", iStatus.Int() );
   270                 HTI_LOG_FORMAT( "Error %d, reissue request", iStatus.Int() );
   261                 iDispatcher->Notify( iStatus.Int() );
   271                 iDispatcher->Notify( iStatus.Int() );
       
   272                 User::After(2000000);
   262                 ReceiveMessage();
   273                 ReceiveMessage();
   263                 }
   274                 }
   264             break;
   275             break;
   265         case EReceivingCont:
   276         case EReceivingCont:
   266             //process
   277             //process
   287                 HTI_LOG_TEXT( "and dismiss received HTI msg beginning" );
   298                 HTI_LOG_TEXT( "and dismiss received HTI msg beginning" );
   288                 delete iMsgToReceive;
   299                 delete iMsgToReceive;
   289                 iMsgToReceive = NULL;
   300                 iMsgToReceive = NULL;
   290 
   301 
   291                 iDispatcher->Notify( iStatus.Int() );
   302                 iDispatcher->Notify( iStatus.Int() );
   292 
   303                 User::After(2000000);
   293                 ReceiveMessage();
   304                 ReceiveMessage();
   294                 }
   305                 }
   295             break;
   306             break;
   296         case ESending:
   307         case ESending:
   297             HTI_LOG_TEXT( "ESending" );
   308             HTI_LOG_TEXT( "ESending" );