os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-0482.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 #ifndef __TEST_CASE_PBASE_T_USBDI_0482_H
     2 #define __TEST_CASE_PBASE_T_USBDI_0482_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-0482.h
    19 * @internalComponent
    20 * 
    21 *
    22 */
    23 
    24 
    25 
    26  
    27 #include "basetestcase.h"
    28 #include "testcasefactory.h"
    29 #include "FDFActor.h"
    30 #include <d32usbc.h>
    31 #include <e32debug.h>
    32 #include "hosttransfers.h"
    33 #include "modelleddevices.h"
    34 
    35 namespace NUnitTesting_USBDI
    36 	{
    37 
    38 /**
    39 
    40 	
    41 	@SYMTestCaseID				PBASE-T_USBDI-0482
    42 	@SYMTestCaseDesc			Isochronous transfers supporting audio data rate
    43 	@SYMFssID 
    44 	@SYMPREQ					1782
    45 	@SYMREQ						7051 [USBD : Support for audio data rate]
    46 								7056 [USBD : Isochronous transfers]
    47 	@SYMTestType				UT
    48 	@SYMTestPriority			1 
    49 	@SYMTestActions 			
    50 	@SYMTestExpectedResults 	
    51 	@SYMTestStatus				Implemented
    52 	
    53 
    54 */
    55 class CUT_PBASE_T_USBDI_0482 : public CBaseTestCase, public MUsbBusObserver, public MTransferObserver, public MCommandObserver
    56 	{
    57 public:
    58 	static CUT_PBASE_T_USBDI_0482* NewL(TBool aHostRole);
    59 	~CUT_PBASE_T_USBDI_0482(); 
    60 
    61 public: 
    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);
    69 
    70 public: // From MTransferObserver
    71 	void TransferCompleteL(TInt aTransferId,TInt aCompletionCode);	
    72 	
    73 
    74 private:
    75 	CUT_PBASE_T_USBDI_0482(TBool aHostRole);
    76 	void ConstructL();
    77 	void ExecuteHostTestCaseL();
    78 	void ExecuteDeviceTestCaseL();
    79 	void HostDoCancel();
    80 	void DeviceDoCancel();
    81 	void HostRunL();
    82 	void DeviceRunL();
    83 	TInt FindOUTIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor);
    84 	TInt FindINIsochronousEndpoint(TUsbGenericDescriptor*& aDescriptor);
    85 	TBool ReplayRecordedData();
    86 	
    87 private:
    88 	
    89 	enum TCaseStep
    90 		{
    91 		EInProgress,		
    92 		EFailed,
    93 		EWaitEndOfMusicTrack,		
    94 		EReplayRecordedData		
    95 		};
    96 		
    97 	CActorFDF* iActorFDF;
    98 	CEp0Transfer* iControlEp0;	
    99 	RUsbInterface iUsbInterface0;
   100 	RUsbInterface iUsbInterface1;
   101 	RUsbInterface iUsbInterface2;
   102 	RUsbPipe iPipeOut;
   103 	RUsbPipe iPipeIn;
   104 	TInt iEndpointAddressIn;
   105 	TInt iEndpointAddressOut;
   106 	RBuf8 iOutTransferBuf;
   107 	CIsochTransfer* iIsochInTransfer;
   108 	TCaseStep iCaseStep;
   109 	RPointerArray<CIsochTransfer> iOutTransfers;
   110 	RBuf8 iDataPolledBuf;
   111 
   112 	static TInt iExpectedTransferId;
   113 									
   114 private:
   115 	/**
   116 	The functor for this test case for the factory
   117 	*/
   118 	const static TFunctorTestCase<CUT_PBASE_T_USBDI_0482,TBool> iFunctor;
   119 	};
   120 
   121 	}
   122 
   123 
   124 #endif