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