296 Setup the parameter block payload dataset. Note that since this is a |
296 Setup the parameter block payload dataset. Note that since this is a |
297 variable length dataset, it must first be reset. |
297 variable length dataset, it must first be reset. |
298 */ |
298 */ |
299 iUsbBulkParameterBlock.Reset(); |
299 iUsbBulkParameterBlock.Reset(); |
300 TBool isNullParamValid = EFalse; |
300 TBool isNullParamValid = EFalse; |
301 TUint numberOfNullParam = 0; |
301 TUint numberOfNullParam = 0; |
302 /* |
302 iUsbBulkParameterBlock.CopyIn(aResponse, TMTPTypeResponse::EResponseParameter1, TMTPTypeResponse::EResponseParameter1 + aResponse.GetNumOfValidParams(), isNullParamValid, numberOfNullParam); |
303 A special case: for GetNumObjects the first response parameter can be null, which means 0 objects. |
|
304 */ |
|
305 if(opCode == EMTPOpCodeGetNumObjects) |
|
306 { |
|
307 isNullParamValid = ETrue; |
|
308 numberOfNullParam = 1; |
|
309 } |
|
310 iUsbBulkParameterBlock.CopyIn(aResponse, TMTPTypeResponse::EResponseParameter1, TMTPTypeResponse::EResponseParameter5, isNullParamValid, numberOfNullParam); |
|
311 |
303 |
312 // Setup the bulk container. |
304 // Setup the bulk container. |
313 iUsbBulkContainer->SetPayloadL(const_cast<TMTPUsbParameterPayloadBlock*>(&iUsbBulkParameterBlock)); |
305 iUsbBulkContainer->SetPayloadL(const_cast<TMTPUsbParameterPayloadBlock*>(&iUsbBulkParameterBlock)); |
314 iUsbBulkContainer->SetUint32L(CMTPUsbContainer::EContainerLength, static_cast<TUint32>(iUsbBulkContainer->Size())); |
306 iUsbBulkContainer->SetUint32L(CMTPUsbContainer::EContainerLength, static_cast<TUint32>(iUsbBulkContainer->Size())); |
315 iUsbBulkContainer->SetUint16L(CMTPUsbContainer::EContainerType, EMTPUsbContainerTypeResponseBlock); |
307 iUsbBulkContainer->SetUint16L(CMTPUsbContainer::EContainerType, EMTPUsbContainerTypeResponseBlock); |
1567 { |
1559 { |
1568 __FLOG(_L8("Aborting active R to I data phase")); |
1560 __FLOG(_L8("Aborting active R to I data phase")); |
1569 TRAPD(err, BoundProtocolLayer().SendDataCompleteL(KErrAbort, *iUsbBulkContainer->Payload(), iMTPRequest)); |
1561 TRAPD(err, BoundProtocolLayer().SendDataCompleteL(KErrAbort, *iUsbBulkContainer->Payload(), iMTPRequest)); |
1570 UNUSED_VAR(err); |
1562 UNUSED_VAR(err); |
1571 } |
1563 } |
|
1564 else if ((iBulkTransactionState == EResponsePhase) && iUsbBulkContainer->Payload()) |
|
1565 { |
|
1566 __FLOG(_L8("Aborting active response phase")); |
|
1567 TRAPD(err, BoundProtocolLayer().SendResponseCompleteL(KErrAbort, *static_cast<TMTPTypeResponse*>(iUsbBulkContainer->Payload()), iMTPRequest)); |
|
1568 UNUSED_VAR(err); |
|
1569 } |
1572 } |
1570 } |
1573 #ifdef __FLOG_ACTIVE |
1571 #ifdef __FLOG_ACTIVE |
1574 else |
1572 else |
1575 { |
1573 { |
1576 __FLOG(_L8("Endpoints inactive, do nothing")); |
1574 __FLOG(_L8("Endpoints inactive, do nothing")); |