First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0480_H
2 #define __TEST_CASE_PBASE_T_USBDI_0480_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-0480.h
26 #include "basetestcase.h"
27 #include "testcasefactory.h"
29 #include "controltransferrequests.h"
30 #include "modelleddevices.h"
31 #include "hosttransfers.h"
35 #include <d32usbtransfers.h>
37 namespace NUnitTesting_USBDI
43 @SYMTestCaseID PBASE-T_USBDI-0480
44 @SYMTestCaseDesc Validation of USB control transfers to/from connected device
47 @SYMREQ 7053 [USBD : Control transfers]
48 7071 [USBD : Querying packet sizes for transfers]
51 @SYMTestActions 1. Open interfaces on connected device
52 2. Send control transfers to endpoint0
53 - Empty control transfers
54 - Device and Interface directed (with/without payload)
55 @SYMTestExpectedResults 3. Client USB device providing appropriate response
56 @SYMTestStatus Implemented
60 class CUT_PBASE_T_USBDI_0480 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
63 static CUT_PBASE_T_USBDI_0480* NewL(TBool aHostRole);
64 ~CUT_PBASE_T_USBDI_0480();
66 public: // From MUsbBusObserver
67 void DeviceInsertedL(TUint aDeviceHandle);
68 void DeviceRemovedL(TUint aDeviceHandle);
69 void BusErrorL(TInt aError);
70 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
71 TInt aCompletionCode);
73 public: // From MCommandObserver
74 void Ep0TransferCompleteL(TInt aCompletionCode);
77 CUT_PBASE_T_USBDI_0480(TBool aHostRole);
79 void ExecuteHostTestCaseL();
80 void ExecuteDeviceTestCaseL();
82 void DeviceDoCancel();
93 EDataPutInterfaceXfer,
94 EDataGetInterfaceXfer,
100 CEp0Transfer* iControlEp0;
101 RUsbInterface iUsbInterface0;
102 RUsbInterface iUsbInterface1;
103 TCaseSteps iCaseStep;
107 RUsbDeviceA* iTestDevice;
111 The functor for this test case for the factory
113 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0480,TBool> iFunctor;