First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0487_H
2 #define __TEST_CASE_PBASE_T_USBDI_0487_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-0487.h
26 #include "basetestcase.h"
27 #include "testcasefactory.h"
28 #include "modelleddevices.h"
33 #include "hosttransfers.h"
34 #include "controltransferrequests.h"
36 namespace NUnitTesting_USBDI
42 @SYMTestCaseID PBASE-T_USBDI-0487
43 @SYMTestCaseDesc Validation of interrupt transfers
46 @SYMREQ 7054 [USBD : Interrupt transfers]
49 @SYMTestActions 1. Open interfaces on connected device
50 2. Select alternate interface that has interrupt in endpoint
51 3. Open pipe to interrupt in endpoint and queue interrupt transfer
52 4. Send request to device to send data payload through interrupt in endpoint
53 5. Receive data payload sent through interrupt transfer
54 @SYMTestExpectedResults Correct loop-back data received
55 @SYMTestStatus Implemented
59 class CUT_PBASE_T_USBDI_0487 : public CBaseTestCase, public MUsbBusObserver, public MTransferObserver, public MCommandObserver
62 static CUT_PBASE_T_USBDI_0487* NewL(TBool aHostRole);
63 ~CUT_PBASE_T_USBDI_0487();
65 public: // From MUsbBusObserver
66 void DeviceInsertedL(TUint aDeviceHandle);
67 void DeviceRemovedL(TUint aDeviceHandle);
68 void BusErrorL(TInt aError);
69 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
70 TInt aCompletionCode);
72 public: // From MTransferObserver
73 void TransferCompleteL(TInt aTransferId,TInt aCompletionCode);
75 public: // From MCommandObserver
76 void Ep0TransferCompleteL(TInt aCompletionCode);
79 CUT_PBASE_T_USBDI_0487(TBool aHostRole);
81 void ExecuteHostTestCaseL();
82 void ExecuteDeviceTestCaseL();
84 void DeviceDoCancel();
97 CEp0Transfer* iControlEp0;
99 RUsbInterface iUsbInterface0;
100 RUsbInterface iUsbInterface1;
103 CInterruptTransfer* iTransferIn;
104 CInterruptTransfer* iTransferIn2;
105 CInterruptTransfer* iTransferIn3;
107 // The current test case step
110 // The test device for this test case
111 RUsbDeviceA* iTestDevice;
115 The functor for this test case for the factory
117 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0487,TBool> iFunctor;