kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-0487.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 #ifndef __TEST_CASE_PBASE_T_USBDI_0487_H
       
     2 #define __TEST_CASE_PBASE_T_USBDI_0487_H
       
     3 
       
     4 /*
       
     5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     6 * All rights reserved.
       
     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".
       
    11 *
       
    12 * Initial Contributors:
       
    13 * Nokia Corporation - initial contribution.
       
    14 *
       
    15 * Contributors:
       
    16 *
       
    17 * Description:
       
    18 * @file PBASE-T_USBDI-0487.h
       
    19 * @internalComponent
       
    20 * 
       
    21 *
       
    22 */
       
    23 
       
    24 
       
    25  
       
    26 #include "basetestcase.h"
       
    27 #include "testcasefactory.h"
       
    28 #include "modelleddevices.h"
       
    29 #include "FDFActor.h"
       
    30 #include <d32usbc.h>
       
    31 #include <e32debug.h>
       
    32 #include <d32usbdi.h>
       
    33 #include "hosttransfers.h"
       
    34 #include "controltransferrequests.h"
       
    35 
       
    36 namespace NUnitTesting_USBDI
       
    37 	{
       
    38 
       
    39 /**
       
    40 
       
    41 	
       
    42 	@SYMTestCaseID				PBASE-T_USBDI-0487
       
    43 	@SYMTestCaseDesc			Validation of interrupt transfers
       
    44 	@SYMFssID 
       
    45 	@SYMPREQ					1782
       
    46 	@SYMREQ						7054 [USBD : Interrupt transfers]
       
    47 	@SYMTestType				UT
       
    48 	@SYMTestPriority			1 
       
    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
       
    56 	
       
    57 
       
    58 */
       
    59 class CUT_PBASE_T_USBDI_0487 : public CBaseTestCase, public MUsbBusObserver, public MTransferObserver, public MCommandObserver
       
    60 	{
       
    61 public:
       
    62 	static CUT_PBASE_T_USBDI_0487* NewL(TBool aHostRole);
       
    63 	~CUT_PBASE_T_USBDI_0487(); 
       
    64 
       
    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);
       
    71 	
       
    72 public: // From MTransferObserver
       
    73 	void TransferCompleteL(TInt aTransferId,TInt aCompletionCode);
       
    74 
       
    75 public: // From MCommandObserver
       
    76 	void Ep0TransferCompleteL(TInt aCompletionCode);
       
    77 	
       
    78 private:
       
    79 	CUT_PBASE_T_USBDI_0487(TBool aHostRole);
       
    80 	void ConstructL();
       
    81 	void ExecuteHostTestCaseL();
       
    82 	void ExecuteDeviceTestCaseL();
       
    83 	void HostDoCancel();
       
    84 	void DeviceDoCancel();
       
    85 	void HostRunL();
       
    86 	void DeviceRunL();
       
    87 
       
    88 private:
       
    89 	enum TCaseStep 
       
    90 		{
       
    91 		EInProgress,
       
    92 		EFailed,
       
    93 		EPassed
       
    94 		};
       
    95 		
       
    96 	CActorFDF* iActorFDF;
       
    97 	CEp0Transfer* iControlEp0;
       
    98 	
       
    99 	RUsbInterface iUsbInterface0;
       
   100 	RUsbInterface iUsbInterface1;
       
   101 	RUsbPipe iInPipe;
       
   102 	RUsbPipe iOutPipe;
       
   103 	CInterruptTransfer* iTransferIn;
       
   104 	CInterruptTransfer* iTransferIn2;
       
   105 	CInterruptTransfer* iTransferIn3;
       
   106 	
       
   107 	// The current test case step
       
   108 	TCaseStep iCaseStep;
       
   109 	
       
   110 	// The test device for this test case
       
   111 	RUsbDeviceA* iTestDevice;
       
   112 	
       
   113 private:
       
   114 	/**
       
   115 	The functor for this test case for the factory
       
   116 	*/
       
   117 	const static TFunctorTestCase<CUT_PBASE_T_USBDI_0487,TBool> iFunctor;
       
   118 	};
       
   119 	
       
   120 	}
       
   121 
       
   122 
       
   123 #endif