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); |