First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0482_H
2 #define __TEST_CASE_PBASE_T_USBDI_0482_H
5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
7 * This component and the accompanying materials are made available
8 * under the terms of the License "Eclipse Public License v1.0"
9 * which accompanies this distribution, and is available
10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
12 * Initial Contributors:
13 * Nokia Corporation - initial contribution.
18 * @file PBASE-T_USBDI-0482.h
27 #include "basetestcase.h"
28 #include "testcasefactory.h"
32 #include "hosttransfers.h"
33 #include "modelleddevices.h"
35 namespace NUnitTesting_USBDI
41 @SYMTestCaseID PBASE-T_USBDI-0482
42 @SYMTestCaseDesc Isochronous transfers supporting audio data rate
45 @SYMREQ 7051 [USBD : Support for audio data rate]
46 7056 [USBD : Isochronous transfers]
50 @SYMTestExpectedResults
51 @SYMTestStatus Implemented
55 class CUT_PBASE_T_USBDI_0482 : public CBaseTestCase, public MUsbBusObserver, public MTransferObserver, public MCommandObserver
58 static CUT_PBASE_T_USBDI_0482* NewL(TBool aHostRole);
59 ~CUT_PBASE_T_USBDI_0482();
62 // From MUsbBusObserver
63 void DeviceInsertedL(TUint aDeviceHandle);
64 void DeviceRemovedL(TUint aDeviceHandle);
65 void BusErrorL(TInt aError);
66 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState, TInt aCompletionCode);
67 // From MCommandObserver
68 void Ep0TransferCompleteL(TInt aCompletionCode);
70 public: // From MTransferObserver
71 void TransferCompleteL(TInt aTransferId,TInt aCompletionCode);
75 CUT_PBASE_T_USBDI_0482(TBool aHostRole);
77 void ExecuteHostTestCaseL();
78 void ExecuteDeviceTestCaseL();
80 void DeviceDoCancel();
83 TInt FindOUTIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor);
84 TInt FindINIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor);
85 TBool ReplayRecordedData();
98 CEp0Transfer* iControlEp0;
99 RUsbInterface iUsbInterface0;
100 RUsbInterface iUsbInterface1;
101 RUsbInterface iUsbInterface2;
104 TInt iEndpointAddressIn;
105 TInt iEndpointAddressOut;
106 RBuf8 iOutTransferBuf;
107 CIsochTransfer* iIsochInTransfer;
109 RPointerArray<CIsochTransfer> iOutTransfers;
110 RBuf8 iDataPolledBuf;
112 static TInt iExpectedTransferId;
116 The functor for this test case for the factory
118 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0482,TBool> iFunctor;