os/kernelhwsrv/kerneltest/e32test/usb/t_usb_device/include/activerw.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32test/usb/t_usb_device/include/activerw.h
    15 // 
    16 //
    17 
    18 #ifndef __ACTIVERW_H__
    19 #define __ACTIVERW_H__
    20 
    21 
    22 class CActiveTimer;
    23 
    24 class CActiveRW : public CActive
    25 	{
    26 public:
    27 	static CActiveRW* NewL(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting);
    28 	~CActiveRW();
    29 	void SendData();
    30 	TUint ReadData();
    31 	void Stop();
    32 	void SetTestParams(TestParamPtr aTpPtr);
    33 	void SetTransferMode(TXferMode aMode);
    34 	TInt WriteToDisk(TChar aDriveLetter);
    35 	TInt ReadFromDisk(TChar aDriveLetter, TInt aMaxFileSize);
    36 	void TestComplete(TBool aResult);
    37 	void Suspend(TXferType aType);
    38 	void Resume();
    39 	void ResumeAltSetting(TUint aAltSetting);
    40 	void SendWaitSetting();
    41 	void StartOrSuspend();
    42 			
    43 private:
    44 	CActiveRW(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting);
    45 	void ConstructL();
    46 	virtual void RunL();
    47 	virtual void DoCancel();
    48 	TBool CompareBuffers();
    49 	void WriteBufferToDisk(TDes8& aBuffer, TInt aLen);
    50 	void ReadBufferFromDisk(TDes8& aBuffer, TInt aLen);
    51 	void ProcessWriteXfer();
    52 	void ProcessReadXfer();
    53 	void CActiveRW::Yield();
    54 
    55 private:
    56 	#ifdef USB_SC
    57 	TEndpointBuffer iSCWriteBuf;
    58 	TEndpointBuffer iSCReadBuf;
    59 	TAny * iSCReadData;
    60 	TBool iReadZlp;
    61 	#else
    62 	TPtr8 iWriteBuf;
    63 	TPtr8 iReadBuf;
    64 	#endif
    65 	CConsoleBase* iConsole;
    66 	RDEVCLIENT* iPort;
    67 	CActiveTimer* iTimeoutTimer;
    68 	TUint iBufSz;
    69 	TUint iMaxPktSz;
    70 	TUint iReadSize;
    71 	TUint iReadOffset;
    72 	TXferType iCurrentXfer;
    73 	TXferMode iXferMode;
    74 	TBool iDoStop;
    75 	TUint32 iPktNum;
    76 	TBool iDiskAccessEnabled;
    77 	RFs iFs;
    78 	RFile iFile;
    79 	TFileName iFileName;
    80 	TInt iFileOffset;
    81 	TInt16 iRepeat;
    82 	TestParamType iTestParams;
    83 	TBool iComplete;
    84 	TBool iResult;
    85 	TUint16 iIndex;
    86 	TBool iLastSetting;
    87 	};
    88 
    89 #endif	// __ACTIVERW_H__