author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 11:08:29 +0300 | |
changeset 247 | d8d70de2bd36 |
parent 0 | a41df078684a |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1 |
// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 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(); |
|
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
42 |
inline RDEVCLIENT* Ldd(); |
0 | 43 |
|
44 |
private: |
|
45 |
CActiveRW(CConsoleBase* aConsole, RDEVCLIENT* aPort, RFs aFs, TUint16 aIndex, TBool aLastSetting); |
|
46 |
void ConstructL(); |
|
47 |
virtual void RunL(); |
|
48 |
virtual void DoCancel(); |
|
49 |
TBool CompareBuffers(); |
|
50 |
void WriteBufferToDisk(TDes8& aBuffer, TInt aLen); |
|
51 |
void ReadBufferFromDisk(TDes8& aBuffer, TInt aLen); |
|
52 |
void ProcessWriteXfer(); |
|
53 |
void ProcessReadXfer(); |
|
54 |
void CActiveRW::Yield(); |
|
55 |
||
56 |
private: |
|
57 |
#ifdef USB_SC |
|
58 |
TEndpointBuffer iSCWriteBuf; |
|
59 |
TEndpointBuffer iSCReadBuf; |
|
60 |
TAny * iSCReadData; |
|
61 |
TBool iReadZlp; |
|
62 |
#else |
|
63 |
TPtr8 iWriteBuf; |
|
64 |
TPtr8 iReadBuf; |
|
65 |
#endif |
|
66 |
CConsoleBase* iConsole; |
|
67 |
RDEVCLIENT* iPort; |
|
68 |
CActiveTimer* iTimeoutTimer; |
|
69 |
TUint iBufSz; |
|
70 |
TUint iMaxPktSz; |
|
71 |
TUint iReadSize; |
|
72 |
TUint iReadOffset; |
|
73 |
TXferType iCurrentXfer; |
|
74 |
TXferMode iXferMode; |
|
75 |
TBool iDoStop; |
|
76 |
TUint32 iPktNum; |
|
77 |
TBool iDiskAccessEnabled; |
|
78 |
RFs iFs; |
|
79 |
RFile iFile; |
|
80 |
TFileName iFileName; |
|
81 |
TInt iFileOffset; |
|
82 |
TInt16 iRepeat; |
|
83 |
TestParamType iTestParams; |
|
84 |
TBool iComplete; |
|
85 |
TBool iResult; |
|
86 |
TUint16 iIndex; |
|
87 |
TBool iLastSetting; |
|
88 |
}; |
|
89 |
||
247
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
90 |
inline RDEVCLIENT* CActiveRW::Ldd() |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
91 |
{ |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
92 |
return iPort; |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
93 |
} |
d8d70de2bd36
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
|
0 | 95 |
#endif // __ACTIVERW_H__ |