mtptransports/mtpusbtransport/usbsic_imp/src/cmtpusbconnection.cpp
changeset 31 a26669f87b46
parent 29 3ae5cb0b4c02
child 35 c4c427c00f31
--- a/mtptransports/mtpusbtransport/usbsic_imp/src/cmtpusbconnection.cpp	Fri Jun 25 16:54:01 2010 +0800
+++ b/mtptransports/mtpusbtransport/usbsic_imp/src/cmtpusbconnection.cpp	Fri Jul 09 17:58:21 2010 +0800
@@ -636,7 +636,11 @@
     {
     __FLOG(_L8("SendInterruptDataCompleteL - Entry"));
     iEventPending = EFalse;	
+    
+    if ( NULL != iProtocolLayer)
+        {
     BoundProtocolLayer().SendEventCompleteL(aError, iMTPEvent);
+        }
     __FLOG(_L8("SendInterruptDataCompleteL - Exit"));
     }    
 
@@ -1358,7 +1362,17 @@
         {
         // Invalid bulk transaction state, close the connection.
         __FLOG_VA((_L8("Expected bulk transaction state = %d"), aExpectedTransactionState));
+
+        //if transaction is in request phase, while the container type of data we received is other transaction phase,
+        //just ignore the data and initiate another request receiving. 
+        if (ERequestPhase == iBulkTransactionState)
+            {
+            InitiateBulkRequestSequenceL();
+            }
+        else
+            {
         CloseConnection();
+            }
         }
     __FLOG(_L8("BulkRequestTransactionStateValid - Exit"));
     return valid;
@@ -1503,6 +1517,7 @@
     __FLOG(_L8("BulkEndpointsStallL - Entry"));
     EndpointStallL(EMTPUsbEpBulkIn);
     EndpointStallL(EMTPUsbEpBulkOut);
+    SetDeviceStatus(EMTPUsbDeviceStatusTransactionCancelled);
     __FLOG(_L8("BulkEndpointsStallL - Exit"));
     }