os/kernelhwsrv/kerneltest/e32test/usb/t_usb_device/include/activerw.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usb/t_usb_device/include/activerw.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,89 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test/usb/t_usb_device/include/activerw.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __ACTIVERW_H__
    1.22 +#define __ACTIVERW_H__
    1.23 +
    1.24 +
    1.25 +class CActiveTimer;
    1.26 +
    1.27 +class CActiveRW : public CActive
    1.28 +	{
    1.29 +public:
    1.30 +	static CActiveRW* NewL(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting);
    1.31 +	~CActiveRW();
    1.32 +	void SendData();
    1.33 +	TUint ReadData();
    1.34 +	void Stop();
    1.35 +	void SetTestParams(TestParamPtr aTpPtr);
    1.36 +	void SetTransferMode(TXferMode aMode);
    1.37 +	TInt WriteToDisk(TChar aDriveLetter);
    1.38 +	TInt ReadFromDisk(TChar aDriveLetter, TInt aMaxFileSize);
    1.39 +	void TestComplete(TBool aResult);
    1.40 +	void Suspend(TXferType aType);
    1.41 +	void Resume();
    1.42 +	void ResumeAltSetting(TUint aAltSetting);
    1.43 +	void SendWaitSetting();
    1.44 +	void StartOrSuspend();
    1.45 +			
    1.46 +private:
    1.47 +	CActiveRW(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting);
    1.48 +	void ConstructL();
    1.49 +	virtual void RunL();
    1.50 +	virtual void DoCancel();
    1.51 +	TBool CompareBuffers();
    1.52 +	void WriteBufferToDisk(TDes8& aBuffer, TInt aLen);
    1.53 +	void ReadBufferFromDisk(TDes8& aBuffer, TInt aLen);
    1.54 +	void ProcessWriteXfer();
    1.55 +	void ProcessReadXfer();
    1.56 +	void CActiveRW::Yield();
    1.57 +
    1.58 +private:
    1.59 +	#ifdef USB_SC
    1.60 +	TEndpointBuffer iSCWriteBuf;
    1.61 +	TEndpointBuffer iSCReadBuf;
    1.62 +	TAny * iSCReadData;
    1.63 +	TBool iReadZlp;
    1.64 +	#else
    1.65 +	TPtr8 iWriteBuf;
    1.66 +	TPtr8 iReadBuf;
    1.67 +	#endif
    1.68 +	CConsoleBase* iConsole;
    1.69 +	RDEVCLIENT* iPort;
    1.70 +	CActiveTimer* iTimeoutTimer;
    1.71 +	TUint iBufSz;
    1.72 +	TUint iMaxPktSz;
    1.73 +	TUint iReadSize;
    1.74 +	TUint iReadOffset;
    1.75 +	TXferType iCurrentXfer;
    1.76 +	TXferMode iXferMode;
    1.77 +	TBool iDoStop;
    1.78 +	TUint32 iPktNum;
    1.79 +	TBool iDiskAccessEnabled;
    1.80 +	RFs iFs;
    1.81 +	RFile iFile;
    1.82 +	TFileName iFileName;
    1.83 +	TInt iFileOffset;
    1.84 +	TInt16 iRepeat;
    1.85 +	TestParamType iTestParams;
    1.86 +	TBool iComplete;
    1.87 +	TBool iResult;
    1.88 +	TUint16 iIndex;
    1.89 +	TBool iLastSetting;
    1.90 +	};
    1.91 +
    1.92 +#endif	// __ACTIVERW_H__