253
|
1 |
// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// @file PBASE-T_USBDI-0496.cpp
|
|
15 |
// @internalComponent
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
#include "PBASE-T_USBDI-0496.h"
|
|
20 |
#include "testpolicy.h"
|
|
21 |
#include "modelleddevices.h"
|
|
22 |
#include "testliterals.h"
|
253
|
23 |
#include "OstTraceDefinitions.h"
|
|
24 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
25 |
#include "PBASE-T_USBDI-0496Traces.h"
|
|
26 |
#endif
|
0
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
namespace NUnitTesting_USBDI
|
|
32 |
{
|
|
33 |
const TUint KTotalBytesToTransfer = 2*1024*1024+511; //2MB + 511 bytes
|
|
34 |
const TUint KHostNumReadBytes = 1024*256;
|
|
35 |
const TInt KBulkMaxTransferSize = KHostNumReadBytes + 1000;
|
|
36 |
const TInt KDeviceNumWriteBytes = 1024;
|
|
37 |
|
|
38 |
|
|
39 |
//Make these single bit values ...
|
|
40 |
// ... so that their completion can be easily recorded in a bit mask!
|
|
41 |
const TUint32 KBulkTransferInId0 = 1<<0;
|
|
42 |
const TUint32 KBulkTransferInId1 = 1<<1;
|
|
43 |
const TUint32 KBulkTransferInId[KMaxNumInTransfers] = {KBulkTransferInId0, KBulkTransferInId1};
|
|
44 |
const TUint32 KBulkTransferIdMask = KBulkTransferInId[0] | KBulkTransferInId[1];
|
|
45 |
|
|
46 |
const TInt KUndefinedStep = -102;
|
|
47 |
const TInt KUnexpectedTransferID = -103;
|
|
48 |
|
|
49 |
|
|
50 |
_LIT(KTestCaseId,"PBASE-T_USBDI-0496");
|
|
51 |
const TFunctorTestCase<CUT_PBASE_T_USBDI_0496,TBool> CUT_PBASE_T_USBDI_0496::iFunctor(KTestCaseId);
|
|
52 |
|
|
53 |
CUT_PBASE_T_USBDI_0496* CUT_PBASE_T_USBDI_0496::NewL(TBool aHostRole)
|
|
54 |
{
|
253
|
55 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_NEWL_ENTRY, aHostRole );
|
0
|
56 |
CUT_PBASE_T_USBDI_0496* self = new (ELeave) CUT_PBASE_T_USBDI_0496(aHostRole);
|
|
57 |
CleanupStack::PushL(self);
|
|
58 |
self->ConstructL();
|
|
59 |
CleanupStack::Pop(self);
|
253
|
60 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_NEWL_EXIT, ( TUint )( self ) );
|
0
|
61 |
return self;
|
|
62 |
}
|
|
63 |
|
|
64 |
|
|
65 |
CUT_PBASE_T_USBDI_0496::CUT_PBASE_T_USBDI_0496(TBool aHostRole)
|
|
66 |
: CBaseBulkTestCase(KTestCaseId,aHostRole),
|
|
67 |
iCaseStep(EInProgress)
|
|
68 |
{
|
253
|
69 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY, this );
|
|
70 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT, this );
|
0
|
71 |
}
|
|
72 |
|
|
73 |
|
|
74 |
void CUT_PBASE_T_USBDI_0496::ConstructL()
|
|
75 |
{
|
253
|
76 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_CONSTRUCTL_ENTRY, this );
|
0
|
77 |
BaseBulkConstructL();
|
|
78 |
|
|
79 |
iInBuffer = HBufC8::NewL(KTestBufferLength);
|
|
80 |
|
|
81 |
//Create buffer to contain two lots of the payload pattern
|
|
82 |
//..so that we may grab cyclic chunks of said payload pattern
|
|
83 |
TInt repeats = KHostNumReadBytes / (KLiteralEnglish5().Length()) + 1 + 1; //1 extra to accommodate start point plus 1 to accomodate remainder in division
|
|
84 |
iValidateBuffer = HBufC8::NewL(KLiteralEnglish5().Length() * repeats);
|
|
85 |
iValidateBufferPtr.Set(iValidateBuffer->Des());
|
|
86 |
iValidateBufferPtr.Zero();
|
|
87 |
for(TInt i=0;i<repeats;i++)
|
|
88 |
{
|
|
89 |
iValidateBufferPtr.Append(KLiteralEnglish5());
|
|
90 |
}
|
|
91 |
|
253
|
92 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_CONSTRUCTL, "CUT_PBASE_T_USBDI_0496::ConstructL(): buffer created");
|
|
93 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CONSTRUCTL_EXIT, this );
|
0
|
94 |
}
|
|
95 |
|
|
96 |
|
|
97 |
CUT_PBASE_T_USBDI_0496::~CUT_PBASE_T_USBDI_0496()
|
|
98 |
{
|
253
|
99 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_ENTRY_DUP01, this );
|
|
100 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_CUT_PBASE_T_USBDI_0496_EXIT_DUP01, this );
|
0
|
101 |
}
|
|
102 |
|
|
103 |
void CUT_PBASE_T_USBDI_0496::KillTransfers()
|
|
104 |
{
|
253
|
105 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_ENTRY, this );
|
0
|
106 |
|
|
107 |
iInTransfer[0]->Cancel();
|
|
108 |
iInTransfer[1]->Cancel();
|
253
|
109 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_KILLTRANSFERS_EXIT, this );
|
0
|
110 |
}
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
void CUT_PBASE_T_USBDI_0496::Ep0TransferCompleteL(TInt aCompletionCode)
|
|
115 |
{
|
253
|
116 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_ENTRY, this );
|
0
|
117 |
|
253
|
118 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d", aCompletionCode);
|
0
|
119 |
|
|
120 |
if(aCompletionCode != KErrNone)
|
|
121 |
{
|
|
122 |
if(iCaseStep == EFailed)
|
|
123 |
{// ignore error, nad catch the TestFailed method called further down.
|
253
|
124 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***");
|
0
|
125 |
}
|
|
126 |
else
|
|
127 |
{
|
|
128 |
KillTransfers();
|
|
129 |
TBuf<256> msg;
|
|
130 |
_LIT(lit, "<Error %d> Transfer to control endpoint 0 was not successful");
|
|
131 |
msg.Format(lit,aCompletionCode);
|
253
|
132 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP02, msg);
|
0
|
133 |
iCaseStep = EFailed;
|
|
134 |
TTestCaseFailed request(aCompletionCode,msg);
|
|
135 |
iControlEp0->SendRequest(request,this);
|
253
|
136 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT, this );
|
0
|
137 |
return;
|
|
138 |
}
|
|
139 |
}
|
|
140 |
|
|
141 |
switch(iCaseStep)
|
|
142 |
{
|
|
143 |
// Test case passed
|
|
144 |
case EPassed:
|
|
145 |
TestPassed();
|
|
146 |
break;
|
|
147 |
|
|
148 |
// Test case failed
|
|
149 |
case EFailed:
|
|
150 |
TestFailed(KErrCompletion);
|
|
151 |
break;
|
|
152 |
|
|
153 |
case ERequestRepeatedWrite:
|
|
154 |
{
|
253
|
155 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP03, "Try to perform ALL transfers");
|
0
|
156 |
|
|
157 |
iCaseStep = ETransfer;
|
|
158 |
iIsValid = ETrue; //innocent until proved guilty
|
253
|
159 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP04, "\n");
|
0
|
160 |
iTransferComplete |= ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[0]); //should not validate - just perform necessary transfers
|
|
161 |
iTransferComplete |= ValidatePreviousAndPerformNextTransfers(KBulkTransferInId[1]); //should not validate - just perform necessary transfers
|
253
|
162 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP05, "\n");
|
0
|
163 |
if((iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
|
|
164 |
{
|
|
165 |
iTransferComplete = 0; //reset
|
|
166 |
_LIT(lit, "TEST FAILURE: No data to send!!");
|
|
167 |
TBuf<40> msg(lit);
|
253
|
168 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP06, msg);
|
0
|
169 |
iCaseStep = EFailed;
|
|
170 |
TTestCaseFailed request(KErrAbort,msg);
|
|
171 |
return iControlEp0->SendRequest(request,this);
|
|
172 |
}
|
|
173 |
}
|
|
174 |
break;
|
|
175 |
|
|
176 |
default:
|
253
|
177 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_DUP07, "<Error> Unknown test step");
|
0
|
178 |
TestFailed(KErrUnknown);
|
|
179 |
break;
|
|
180 |
}
|
253
|
181 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this );
|
0
|
182 |
}
|
|
183 |
|
|
184 |
void CUT_PBASE_T_USBDI_0496::TransferCompleteL(TInt aTransferId,TInt aCompletionCode)
|
|
185 |
{
|
253
|
186 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_ENTRY, this );
|
0
|
187 |
Cancel();
|
|
188 |
|
|
189 |
TInt err(KErrNone);
|
|
190 |
TBuf<256> msg;
|
253
|
191 |
OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d, test step = %d",aTransferId, aCompletionCode, iCaseStep);
|
0
|
192 |
|
|
193 |
|
|
194 |
switch(iCaseStep)
|
|
195 |
{
|
|
196 |
case ETransfer:
|
|
197 |
{
|
|
198 |
if(aCompletionCode != KErrNone)
|
|
199 |
{
|
|
200 |
KillTransfers();
|
|
201 |
err = KErrCorrupt;
|
|
202 |
_LIT(lit, "<Error %d> The transfer completed with an error.");
|
|
203 |
msg.Format(lit, aCompletionCode);
|
|
204 |
break;
|
|
205 |
}
|
|
206 |
if(aTransferId != KBulkTransferInId[0] && aTransferId != KBulkTransferInId[1])
|
|
207 |
{
|
|
208 |
iTransferComplete = 0; //reset
|
|
209 |
err = KUnexpectedTransferID;
|
|
210 |
_LIT(lit, "<Error %d> Unexpected transfer ID, wanted %d or %d, got %d");
|
|
211 |
msg.Format(lit, err, KBulkTransferInId[0], KBulkTransferInId[1], aTransferId);
|
|
212 |
break;
|
|
213 |
}
|
|
214 |
|
253
|
215 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP01, "\n");
|
0
|
216 |
iTransferComplete |= ValidatePreviousAndPerformNextTransfers(aTransferId);
|
253
|
217 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP02, "\n");
|
0
|
218 |
|
|
219 |
if(err==KErrNone && (iTransferComplete & KBulkTransferIdMask) == KBulkTransferIdMask)
|
|
220 |
{
|
|
221 |
/*
|
|
222 |
Transfers all complete - check all were valid, and if so pass the test
|
|
223 |
*/
|
253
|
224 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP03, "All Transfers Completed Successfully: Transfer Completion Aggregation Mask 0x%x", iTransferComplete);
|
0
|
225 |
if(!iIsValid)
|
|
226 |
{
|
|
227 |
err = KErrCompletion; //indicates data validation failure
|
|
228 |
iIsValid = ETrue; //reset
|
|
229 |
break;
|
|
230 |
}
|
|
231 |
// Comparison is a match
|
253
|
232 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match");
|
0
|
233 |
iCaseStep = EPassed;
|
|
234 |
TTestCasePassed request;
|
|
235 |
iControlEp0->SendRequest(request,this);
|
|
236 |
iTransferComplete = 0; //reset
|
|
237 |
}
|
|
238 |
}
|
|
239 |
break;
|
|
240 |
|
|
241 |
default:
|
|
242 |
err = KUndefinedStep;
|
|
243 |
_LIT(lit, "<Error %d> Undefined case step %d reached");
|
|
244 |
msg.Format(lit,KUndefinedStep, iCaseStep);
|
|
245 |
break;
|
|
246 |
}
|
|
247 |
|
|
248 |
|
|
249 |
if(err == KErrCompletion)
|
|
250 |
//indicates data validation failure
|
|
251 |
{
|
|
252 |
_LIT(lit, "<Error %d> Bulk transfer IN data received does not match the data expected");
|
|
253 |
msg.Format(lit, err);
|
|
254 |
}
|
|
255 |
|
|
256 |
if(err!=KErrNone)
|
|
257 |
{
|
|
258 |
KillTransfers();
|
253
|
259 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_DUP05, msg);
|
0
|
260 |
iCaseStep = EFailed;
|
|
261 |
TTestCaseFailed request(err,msg);
|
|
262 |
return iControlEp0->SendRequest(request,this);
|
|
263 |
}
|
253
|
264 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_TRANSFERCOMPLETEL_EXIT, this );
|
0
|
265 |
}
|
|
266 |
|
|
267 |
void CUT_PBASE_T_USBDI_0496::DeviceInsertedL(TUint aDeviceHandle)
|
|
268 |
{
|
253
|
269 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_ENTRY, this );
|
0
|
270 |
|
|
271 |
Cancel();
|
253
|
272 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL, "this - %08x", this);
|
0
|
273 |
|
|
274 |
TBuf<256> msg;
|
|
275 |
TInt err = KErrNone;
|
|
276 |
if(BaseBulkDeviceInsertedL(aDeviceHandle, EFalse) == EDeviceConfigurationError)
|
|
277 |
// Prepare for response from control transfer to client
|
|
278 |
{
|
|
279 |
err = KErrGeneral;
|
|
280 |
_LIT(lit, "Base class DeviceInsertedL failed");
|
|
281 |
msg.Format(lit);
|
|
282 |
}
|
|
283 |
else
|
|
284 |
{
|
|
285 |
if(SetUpInterfaceAndPipesL(aDeviceHandle, 2) == EDeviceConfigurationError)
|
|
286 |
// Prepare for response from control transfer to client
|
|
287 |
{
|
|
288 |
err = KErrGeneral;
|
|
289 |
_LIT(lit, "Base class SetUpInterfaceAndPipes for Interface 2 failed");
|
|
290 |
msg.Format(lit);
|
|
291 |
}
|
|
292 |
else
|
|
293 |
{
|
|
294 |
|
|
295 |
iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferInId[0]);
|
|
296 |
iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxTransferSize,*this,KBulkTransferInId[1]);
|
|
297 |
|
|
298 |
// Initialise the descriptors for transfer
|
253
|
299 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors - interface 1");
|
0
|
300 |
err = iUsbInterface1.InitialiseTransferDescriptors();
|
|
301 |
if(err != KErrNone)
|
|
302 |
{
|
|
303 |
_LIT(lit, "<Error %d> Unable to initialise transfer descriptors");
|
|
304 |
msg.Format(lit,err);
|
|
305 |
}
|
|
306 |
}
|
|
307 |
}
|
|
308 |
if(err != KErrNone)
|
|
309 |
{
|
253
|
310 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP02, msg);
|
0
|
311 |
iCaseStep = EFailed;
|
|
312 |
TTestCaseFailed request(err,msg);
|
|
313 |
iControlEp0->SendRequest(request,this);
|
|
314 |
}
|
|
315 |
else
|
|
316 |
{
|
253
|
317 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_DUP03, "Asking client for 'Read' on interface 1");
|
0
|
318 |
iCaseStep = ERequestRepeatedWrite;
|
|
319 |
TRepeatedWriteDataRequest request(1,1,KLiteralEnglish5(),KDeviceNumWriteBytes,KTotalBytesToTransfer);// EP2 means endpoint index 2 not the actual endpoint number, here the ep with 32 byte max packet size
|
|
320 |
iControlEp0->SendRequest(request,this);
|
|
321 |
}
|
253
|
322 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_DEVICEINSERTEDL_EXIT, this );
|
0
|
323 |
}
|
|
324 |
|
|
325 |
TUint8 CUT_PBASE_T_USBDI_0496::Index(TUint8 aTransferId)
|
|
326 |
{
|
253
|
327 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_INDEX_ENTRY, this );
|
0
|
328 |
switch(aTransferId)
|
|
329 |
{
|
|
330 |
case KBulkTransferInId0:
|
|
331 |
return 0;
|
|
332 |
case KBulkTransferInId1:
|
|
333 |
return 1;
|
|
334 |
default:
|
|
335 |
_LIT(lit, "TRANSFER ID OUT OF RANGE");
|
|
336 |
User::Panic(lit, KErrArgument);
|
253
|
337 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_INDEX_EXIT, this );
|
0
|
338 |
return 0; //should never get here
|
|
339 |
}
|
|
340 |
}
|
|
341 |
|
|
342 |
TInt CUT_PBASE_T_USBDI_0496::ValidatePreviousAndPerformNextTransfers(TInt aTransferId)
|
|
343 |
/**
|
|
344 |
@param aTransferId - specifies trasnfer to use
|
|
345 |
@return zero UNLESS no more trasnfers have been queued for the specified ID in which case return the transfer ID
|
|
346 |
Note: This return value allows the caller to respond easily if no more transfers are required for the specified
|
|
347 |
transfer ID.
|
|
348 |
*/
|
|
349 |
{
|
253
|
350 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_ENTRY, this );
|
0
|
351 |
|
|
352 |
TUint8 index = Index(aTransferId);
|
253
|
353 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS, "\n");
|
|
354 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP01, "Transfer[%d]", index);
|
0
|
355 |
|
|
356 |
|
|
357 |
if(iNumBytesExpected[index] != 0)
|
|
358 |
{
|
|
359 |
TPtrC8 data1(iInTransfer[index]->DataPolled());
|
|
360 |
if(ValidateData(data1, iValidateBufferPtr.Mid(iValidationStringStartPointTransfer[index], iNumBytesExpected[index])) == EFalse)
|
|
361 |
{
|
253
|
362 |
OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP02, "=====VALIDATION FAILURE: Point of Validation String Entry %u, Newly Read Bytes %u=====",iValidationStringStartPointTransfer[index], iNumBytesExpected[index]);
|
0
|
363 |
iIsValid = EFalse;
|
|
364 |
}
|
|
365 |
iNumBytesExpected[index] = 0; //reset
|
|
366 |
}
|
|
367 |
if(iNumBytesRequestedSoFar >= KTotalBytesToTransfer)
|
|
368 |
//if we are near the end the other transfer will mop up remaining bytes...
|
|
369 |
{
|
253
|
370 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_DUP03, "****ALL DONE for Transfer[%d]****", index);
|
|
371 |
OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT, this, aTransferId );
|
0
|
372 |
return aTransferId; //tell caller that all transfers are complete for this transfer ID
|
|
373 |
}
|
|
374 |
|
|
375 |
iValidationStringStartPointTransfer[index] = iNumBytesRequestedSoFar%(KLiteralEnglish5().Length()); //PRIOR TO THIS TRANSFER
|
|
376 |
TUint bytesLeftToRead = KTotalBytesToTransfer - iNumBytesRequestedSoFar;
|
|
377 |
iNumBytesExpected[index] = bytesLeftToRead < KHostNumReadBytes ? bytesLeftToRead : KHostNumReadBytes;
|
|
378 |
iNumBytesRequestedSoFar += iNumBytesExpected[index];
|
|
379 |
iInTransfer[index]->TransferIn(KHostNumReadBytes); //rely on ZLP to complete the last 'TransferIn'
|
|
380 |
iExpectedNextTransferNumber = 1 - iExpectedNextTransferNumber;
|
|
381 |
|
253
|
382 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0496_VALIDATEPREVIOUSANDPERFORMNEXTTRANSFERS_EXIT_DUP01, this );
|
0
|
383 |
return 0; //tell caller there are still transfers to complete for the requested transfer ID
|
|
384 |
}
|
|
385 |
|
|
386 |
} //end namespace
|