author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 02 Sep 2010 21:54:16 +0300 | |
changeset 259 | 57b9594f5772 |
parent 0 | a41df078684a |
child 257 | 3e88ff8f41d5 |
child 271 | dc268b18d709 |
permissions | -rw-r--r-- |
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
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-0500.cpp |
|
15 |
// @internalComponent |
|
16 |
// |
|
17 |
// |
|
18 |
||
19 |
#include "PBASE-T_USBDI-0500.h" |
|
20 |
#include "testpolicy.h" |
|
21 |
#include "modelleddevices.h" |
|
22 |
#include "testliterals.h" |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
23 |
#include "OstTraceDefinitions.h" |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
24 |
#ifdef OST_TRACE_COMPILER_IN_USE |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
25 |
#include "PBASE-T_USBDI-0500Traces.h" |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
#endif |
0 | 27 |
|
28 |
||
29 |
||
30 |
||
31 |
namespace NUnitTesting_USBDI |
|
32 |
{ |
|
33 |
const TInt KBulkMaxINTransferSize = 600; |
|
34 |
const TInt KDeviceNumWriteBytesPreHalt = 256; |
|
35 |
const TUint KHostNumReadBytesPreHalt1 = 512; |
|
36 |
const TUint KHostNumReadBytesPreHalt2 = 512; |
|
37 |
const TUint KHostNumReadBytesPostHalt1 = 256; |
|
38 |
const TUint KHostNumReadBytesPostHalt2 = 257; |
|
39 |
const TInt KDeviceNumWriteBytesPostHalt = 512; |
|
40 |
||
41 |
||
42 |
//Make these single bit values ... |
|
43 |
// ... so that their completion can be easily recorded in a bit mask! |
|
44 |
const TInt KBulkTransferInId0 = 1<<0; |
|
45 |
const TInt KBulkTransferInId1 = 1<<4; |
|
46 |
||
47 |
const TInt KUnexpectedTransferID = -101; |
|
48 |
const TInt KUndefinedStep = -102; |
|
49 |
||
50 |
||
51 |
_LIT(KTestCaseId,"PBASE-T_USBDI-0500"); |
|
52 |
const TFunctorTestCase<CUT_PBASE_T_USBDI_0500,TBool> CUT_PBASE_T_USBDI_0500::iFunctor(KTestCaseId); |
|
53 |
||
54 |
CUT_PBASE_T_USBDI_0500* CUT_PBASE_T_USBDI_0500::NewL(TBool aHostRole) |
|
55 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_NEWL_ENTRY, aHostRole ); |
0 | 57 |
CUT_PBASE_T_USBDI_0500* self = new (ELeave) CUT_PBASE_T_USBDI_0500(aHostRole); |
58 |
CleanupStack::PushL(self); |
|
59 |
self->ConstructL(); |
|
60 |
CleanupStack::Pop(self); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_NEWL_EXIT, ( TUint )( self ) ); |
0 | 62 |
return self; |
63 |
} |
|
64 |
||
65 |
||
66 |
CUT_PBASE_T_USBDI_0500::CUT_PBASE_T_USBDI_0500(TBool aHostRole) |
|
67 |
: CBaseBulkTestCase(KTestCaseId,aHostRole), |
|
68 |
iCaseStep(EInProgress) |
|
69 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
70 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT, this ); |
0 | 72 |
} |
73 |
||
74 |
||
75 |
void CUT_PBASE_T_USBDI_0500::ConstructL() |
|
76 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
77 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_CONSTRUCTL_ENTRY, this ); |
0 | 78 |
BaseBulkConstructL(); |
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CONSTRUCTL_EXIT, this ); |
0 | 80 |
} |
81 |
||
82 |
||
83 |
CUT_PBASE_T_USBDI_0500::~CUT_PBASE_T_USBDI_0500() |
|
84 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_ENTRY_DUP01, this ); |
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_CUT_PBASE_T_USBDI_0500_EXIT_DUP01, this ); |
0 | 87 |
} |
88 |
||
89 |
||
90 |
void CUT_PBASE_T_USBDI_0500::Ep0TransferCompleteL(TInt aCompletionCode) |
|
91 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
92 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_ENTRY, this ); |
0 | 93 |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL, "Ep0TransferCompleteL with aCompletionCode = %d",aCompletionCode); |
0 | 95 |
|
96 |
if(aCompletionCode != KErrNone) |
|
97 |
{ |
|
98 |
if(iCaseStep == EFailed) |
|
99 |
{// ignore error, nad catch the TestFailed method called further down. |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
100 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP01, "***Failure sending FAIL message to client on endpoint 0***"); |
0 | 101 |
} |
102 |
else |
|
103 |
{ |
|
104 |
TBuf<256> msg; |
|
105 |
msg.Format(_L("<Error %d> Transfer to control endpoint 0 was not successful"),aCompletionCode); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
106 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP02, msg); |
0 | 107 |
iCaseStep = EFailed; |
108 |
TTestCaseFailed request(aCompletionCode,msg); |
|
109 |
iControlEp0->SendRequest(request,this); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT, this ); |
0 | 111 |
return; |
112 |
} |
|
113 |
} |
|
114 |
||
115 |
switch(iCaseStep) |
|
116 |
{ |
|
117 |
// Test case passed |
|
118 |
case EPassed: |
|
119 |
TestPassed(); |
|
120 |
break; |
|
121 |
||
122 |
// Test case failed |
|
123 |
case EFailed: |
|
124 |
TestFailed(KErrCompletion); |
|
125 |
break; |
|
126 |
||
127 |
case ETransferInHalt: |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
128 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP03, "Try to receive data (pre halt)"); |
0 | 129 |
iInTransfer[0]->TransferIn(KHostNumReadBytesPreHalt1); |
130 |
iInTransfer[1]->TransferIn(KHostNumReadBytesPreHalt2); |
|
131 |
break; |
|
132 |
||
133 |
case ETransferIn: |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
134 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP04, "Try to receive data"); |
0 | 135 |
iInTransfer[0]->TransferIn(KHostNumReadBytesPostHalt1); |
136 |
iInTransfer[1]->TransferIn(KHostNumReadBytesPostHalt2); |
|
137 |
break; |
|
138 |
||
139 |
default: |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
140 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_DUP05, "<Error> Unknown test step"); |
0 | 141 |
TestFailed(KErrUnknown); |
142 |
break; |
|
143 |
} |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
144 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_EP0TRANSFERCOMPLETEL_EXIT_DUP01, this ); |
0 | 145 |
} |
146 |
||
147 |
void CUT_PBASE_T_USBDI_0500::TransferCompleteL(TInt aTransferId,TInt aCompletionCode) |
|
148 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
149 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_ENTRY, this ); |
0 | 150 |
Cancel(); |
151 |
||
152 |
TInt err(KErrNone); |
|
153 |
TBuf<256> msg; |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
154 |
OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL, "Transfer completed (id=%d), aCompletionCode = %d",aTransferId, aCompletionCode); |
0 | 155 |
|
156 |
switch(iCaseStep) |
|
157 |
{ |
|
158 |
case ETransferInHalt: |
|
159 |
{ |
|
160 |
if(aCompletionCode != KErrUsbStalled) |
|
161 |
{ |
|
162 |
iInTransfer[0]->Cancel(); |
|
163 |
iInTransfer[1]->Cancel(); |
|
164 |
err = KErrCorrupt; |
|
165 |
msg.Format(_L("<Error %d> The transfer completed with no errors but the endpoint should have halted"),aCompletionCode); |
|
166 |
break; //switch(iCaseStep) |
|
167 |
} |
|
168 |
||
169 |
switch(aTransferId) |
|
170 |
{ |
|
171 |
case KBulkTransferInId0: |
|
172 |
case KBulkTransferInId1: |
|
173 |
iTransferComplete |= aTransferId; |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
174 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP01, "Transfer %d completed", aTransferId); |
0 | 175 |
break; //switch(aTransferId) |
176 |
||
177 |
default: |
|
178 |
iTransferComplete = 0; //reset |
|
179 |
err = KUnexpectedTransferID; |
|
180 |
msg.Format(_L("<Error %d> Unexpected transfer ID, wanted %d or %d, got %d"), |
|
181 |
err, KBulkTransferInId0, KBulkTransferInId1, aTransferId); |
|
182 |
break; //switch(aTransferId) |
|
183 |
} |
|
184 |
||
185 |
if(err==KErrNone && iTransferComplete == (KBulkTransferInId0 | KBulkTransferInId1)) |
|
186 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
187 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP02, "Clear halt and try to send data again. Transfers Completed %d", iTransferComplete); |
0 | 188 |
iTransferComplete = 0; //reset |
189 |
// Acknowledge the stall and clear |
|
190 |
err = iTestPipeInterface1BulkIn.ClearRemoteStall(); |
|
191 |
if(err != KErrNone) |
|
192 |
{ |
|
193 |
msg.Format(_L("<Error %d> The remote stall cannot be cleared"),err); |
|
194 |
break; //switch(iCaseStep) |
|
195 |
} |
|
196 |
iCaseStep = ETransferIn; |
|
197 |
TEndpointPatternSynchronousWriteRequest request(1,1, KLiteralEnglish8().Mid(0,KDeviceNumWriteBytesPostHalt), KDeviceNumWriteBytesPostHalt);// EP1 because 1st writter EP |
|
198 |
iControlEp0->SendRequest(request,this); |
|
199 |
} |
|
200 |
} |
|
201 |
break; //switch(iCaseStep) |
|
202 |
||
203 |
case ETransferIn: |
|
204 |
{ |
|
205 |
if(aCompletionCode != KErrNone) |
|
206 |
{ |
|
207 |
iInTransfer[0]->Cancel(); |
|
208 |
iInTransfer[1]->Cancel(); |
|
209 |
err = KErrCorrupt; |
|
210 |
||
211 |
msg.Format(_L("<Error %d> No data sent on bulk IN request"),aCompletionCode); |
|
212 |
break; //switch(iCaseStep) |
|
213 |
} |
|
214 |
||
215 |
switch(aTransferId) |
|
216 |
{ |
|
217 |
case KBulkTransferInId0: |
|
218 |
case KBulkTransferInId1: |
|
219 |
iTransferComplete |= aTransferId; |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
220 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP03, "Transfer %d completed", aTransferId); |
0 | 221 |
break; //switch(aTransferId) |
222 |
||
223 |
default: |
|
224 |
iTransferComplete = 0; //reset |
|
225 |
err = KUnexpectedTransferID; |
|
226 |
msg.Format(_L("<Error %d> Unexpected transfer ID, wanted %d or %d, got %d"), |
|
227 |
err, KBulkTransferInId0, KBulkTransferInId1, aTransferId); |
|
228 |
break; //switch(aTransferId) |
|
229 |
} |
|
230 |
||
231 |
if(err==KErrNone && iTransferComplete == (KBulkTransferInId0 | KBulkTransferInId1)) |
|
232 |
{ |
|
233 |
// ok, compare data rcvd now |
|
234 |
iTransferComplete = 0; //reset |
|
235 |
TPtrC8 data1(iInTransfer[0]->DataPolled()); |
|
236 |
TPtrC8 data2(iInTransfer[1]->DataPolled()); |
|
237 |
//Validate first transfer for number of bytes requested. |
|
238 |
if(ValidateData(data1, KLiteralEnglish8(), KHostNumReadBytesPostHalt1) == EFalse) |
|
239 |
{ |
|
240 |
err = KErrCompletion; //indicates data validation failure |
|
241 |
break; //switch(iCaseStep) |
|
242 |
} |
|
243 |
||
244 |
//Validate second transfer for the remainder of bytes that the device should have written. |
|
245 |
//NB The number of bytes requested is more than this remainder to accommodate the ZLP. |
|
246 |
if(ValidateData(data2, KLiteralEnglish8(), KHostNumReadBytesPostHalt1, KDeviceNumWriteBytesPostHalt-KHostNumReadBytesPostHalt1) == EFalse) |
|
247 |
{ |
|
248 |
err = KErrCompletion; //indicates data validation failure |
|
249 |
break; //switch(iCaseStep) |
|
250 |
} |
|
251 |
||
252 |
// Comparison is a match |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP04, "Comparison for IN transfer is a match"); |
0 | 254 |
iCaseStep = EPassed; |
255 |
TTestCasePassed request; |
|
256 |
iControlEp0->SendRequest(request,this); |
|
257 |
} |
|
258 |
} |
|
259 |
break; //switch(iCaseStep) |
|
260 |
||
261 |
default: |
|
262 |
err = KUndefinedStep; |
|
263 |
msg.Format(_L("<Error %d> Undefined case step %d reached"),KUndefinedStep, iCaseStep); |
|
264 |
break; //switch(iCaseStep) |
|
265 |
} |
|
266 |
||
267 |
if(err == KErrCompletion) |
|
268 |
//indicates data validation failure |
|
269 |
{ |
|
270 |
msg.Format(_L("<Error %d> Bulk transfer IN data received does not match Bulk Transfer OUT data"), err); |
|
271 |
} |
|
272 |
||
273 |
if(err!=KErrNone) |
|
274 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
275 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_DUP05, msg); |
0 | 276 |
iCaseStep = EFailed; |
277 |
TTestCaseFailed request(err,msg); |
|
278 |
return iControlEp0->SendRequest(request,this); |
|
279 |
} |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
280 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_TRANSFERCOMPLETEL_EXIT, this ); |
0 | 281 |
} |
282 |
||
283 |
void CUT_PBASE_T_USBDI_0500::DeviceInsertedL(TUint aDeviceHandle) |
|
284 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
285 |
OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_ENTRY, this ); |
0 | 286 |
|
287 |
Cancel(); |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
288 |
OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL, "this - %08x", this); |
0 | 289 |
|
290 |
TBuf<256> msg; |
|
291 |
TInt err = KErrNone; |
|
292 |
if(BaseBulkDeviceInsertedL(aDeviceHandle, EFalse) == EDeviceConfigurationError) |
|
293 |
// Prepare for response from control transfer to client |
|
294 |
{ |
|
295 |
err = KErrGeneral; |
|
296 |
msg.Format(_L("Base class DeviceInsertedL failed")); |
|
297 |
} |
|
298 |
else |
|
299 |
{ |
|
300 |
iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxINTransferSize,*this,KBulkTransferInId0); |
|
301 |
iInTransfer[1] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,KBulkMaxINTransferSize,*this,KBulkTransferInId1); |
|
302 |
||
303 |
// Initialise the descriptors for transfer |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
304 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP01, "Initialising the transfer descriptors"); |
0 | 305 |
err = iUsbInterface1.InitialiseTransferDescriptors(); |
306 |
if(err != KErrNone) |
|
307 |
{ |
|
308 |
msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err); |
|
309 |
} |
|
310 |
} |
|
311 |
if(err != KErrNone) |
|
312 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
313 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP02, msg); |
0 | 314 |
iCaseStep = EFailed; |
315 |
TTestCaseFailed request(err,msg); |
|
316 |
iControlEp0->SendRequest(request,this); |
|
317 |
} |
|
318 |
else |
|
319 |
{ |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
320 |
OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_DUP03, "Asking client for 'Write' and 'Halt'"); |
0 | 321 |
iCaseStep = ETransferInHalt; |
322 |
TEndpointPatternSynchronousWriteAndHaltRequest request(1,1,KLiteralFrench4(),KDeviceNumWriteBytesPreHalt);// EP1 means endpoint index 1 not the actual endpoint number |
|
323 |
iControlEp0->SendRequest(request,this); |
|
324 |
} |
|
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
325 |
OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0500_DEVICEINSERTEDL_EXIT, this ); |
0 | 326 |
} |
327 |
||
328 |
} //end namespace |