sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test/usb/t_usb_device/include/activerw.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __ACTIVERW_H__ sl@0: #define __ACTIVERW_H__ sl@0: sl@0: sl@0: class CActiveTimer; sl@0: sl@0: class CActiveRW : public CActive sl@0: { sl@0: public: sl@0: static CActiveRW* NewL(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting); sl@0: ~CActiveRW(); sl@0: void SendData(); sl@0: TUint ReadData(); sl@0: void Stop(); sl@0: void SetTestParams(TestParamPtr aTpPtr); sl@0: void SetTransferMode(TXferMode aMode); sl@0: TInt WriteToDisk(TChar aDriveLetter); sl@0: TInt ReadFromDisk(TChar aDriveLetter, TInt aMaxFileSize); sl@0: void TestComplete(TBool aResult); sl@0: void Suspend(TXferType aType); sl@0: void Resume(); sl@0: void ResumeAltSetting(TUint aAltSetting); sl@0: void SendWaitSetting(); sl@0: void StartOrSuspend(); sl@0: sl@0: private: sl@0: CActiveRW(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting); sl@0: void ConstructL(); sl@0: virtual void RunL(); sl@0: virtual void DoCancel(); sl@0: TBool CompareBuffers(); sl@0: void WriteBufferToDisk(TDes8& aBuffer, TInt aLen); sl@0: void ReadBufferFromDisk(TDes8& aBuffer, TInt aLen); sl@0: void ProcessWriteXfer(); sl@0: void ProcessReadXfer(); sl@0: void CActiveRW::Yield(); sl@0: sl@0: private: sl@0: #ifdef USB_SC sl@0: TEndpointBuffer iSCWriteBuf; sl@0: TEndpointBuffer iSCReadBuf; sl@0: TAny * iSCReadData; sl@0: TBool iReadZlp; sl@0: #else sl@0: TPtr8 iWriteBuf; sl@0: TPtr8 iReadBuf; sl@0: #endif sl@0: CConsoleBase* iConsole; sl@0: RDEVCLIENT* iPort; sl@0: CActiveTimer* iTimeoutTimer; sl@0: TUint iBufSz; sl@0: TUint iMaxPktSz; sl@0: TUint iReadSize; sl@0: TUint iReadOffset; sl@0: TXferType iCurrentXfer; sl@0: TXferMode iXferMode; sl@0: TBool iDoStop; sl@0: TUint32 iPktNum; sl@0: TBool iDiskAccessEnabled; sl@0: RFs iFs; sl@0: RFile iFile; sl@0: TFileName iFileName; sl@0: TInt iFileOffset; sl@0: TInt16 iRepeat; sl@0: TestParamType iTestParams; sl@0: TBool iComplete; sl@0: TBool iResult; sl@0: TUint16 iIndex; sl@0: TBool iLastSetting; sl@0: }; sl@0: sl@0: #endif // __ACTIVERW_H__