sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#if (!defined __T_RBUS_DEV_COMM_DATA_H__)
|
sl@0
|
20 |
#define __T_RBUS_DEV_COMM_DATA_H__
|
sl@0
|
21 |
|
sl@0
|
22 |
// User Includes
|
sl@0
|
23 |
#include "T_RBusLogicalChannelData.h"
|
sl@0
|
24 |
#include "T_ActiveCallbackIO.h"
|
sl@0
|
25 |
|
sl@0
|
26 |
// EPOC includes
|
sl@0
|
27 |
#include <d32comm.h>
|
sl@0
|
28 |
|
sl@0
|
29 |
/**
|
sl@0
|
30 |
* Test Active Notification class
|
sl@0
|
31 |
*
|
sl@0
|
32 |
*/
|
sl@0
|
33 |
class CT_RBusDevCommData : public CT_RBusLogicalChannelData
|
sl@0
|
34 |
{
|
sl@0
|
35 |
public:
|
sl@0
|
36 |
static CT_RBusDevCommData* NewL();
|
sl@0
|
37 |
~CT_RBusDevCommData();
|
sl@0
|
38 |
|
sl@0
|
39 |
virtual TAny* GetObject();
|
sl@0
|
40 |
virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
41 |
|
sl@0
|
42 |
protected:
|
sl@0
|
43 |
CT_RBusDevCommData();
|
sl@0
|
44 |
void ConstructL();
|
sl@0
|
45 |
|
sl@0
|
46 |
// CT_RHandleBaseData implementation
|
sl@0
|
47 |
virtual RHandleBase* GetHandleBase();
|
sl@0
|
48 |
|
sl@0
|
49 |
// CT_RBusLogicalChannelData implementation
|
sl@0
|
50 |
virtual RBusLogicalChannel* GetBusLogicalChannel();
|
sl@0
|
51 |
|
sl@0
|
52 |
// MActiveCallback implementation
|
sl@0
|
53 |
virtual void RunL(CActive* aActive, TInt aIndex);
|
sl@0
|
54 |
virtual void DoCancel(CActive* aActive, TInt aIndex);
|
sl@0
|
55 |
|
sl@0
|
56 |
private:
|
sl@0
|
57 |
void DestroyData();
|
sl@0
|
58 |
|
sl@0
|
59 |
TInt DoCmdConstructor();
|
sl@0
|
60 |
void DoCmdDestructor();
|
sl@0
|
61 |
void DoCmdBreak(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
62 |
void DoCmdBreakCancel();
|
sl@0
|
63 |
void DoCmdCapsL(const TDesC& aSection);
|
sl@0
|
64 |
void DoCmdConfigL(const TDesC& aSection);
|
sl@0
|
65 |
void DoCmdMinTurnaroundTime(const TDesC& aSection);
|
sl@0
|
66 |
void DoCmdNotifyReceiveDataAvailable(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
67 |
void DoCmdNotifyReceiveDataAvailableCancel();
|
sl@0
|
68 |
void DoCmdNotifySignalChange(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
69 |
void DoCmdNotifySignalChangeCancel();
|
sl@0
|
70 |
TInt DoCmdOpen(const TDesC& aSection);
|
sl@0
|
71 |
TInt DoCmdQueryReceiveBuffer(const TDesC& aSection);
|
sl@0
|
72 |
void DoCmdReadL(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
73 |
void DoCmdReadCancel();
|
sl@0
|
74 |
void DoCmdReadOneOrMoreL(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
75 |
void DoCmdReceiveBufferLength(const TDesC& aSection);
|
sl@0
|
76 |
void DoCmdResetBuffers();
|
sl@0
|
77 |
TInt DoCmdSetConfigL(const TDesC& aSection);
|
sl@0
|
78 |
TInt DoCmdSetMinTurnaroundTime(const TDesC& aSection);
|
sl@0
|
79 |
TInt DoCmdSetReceiveBufferLength(const TDesC& aSection);
|
sl@0
|
80 |
void DoCmdSetSignals(const TDesC& aSection);
|
sl@0
|
81 |
void DoCmdSignals(const TDesC& aSection);
|
sl@0
|
82 |
void DoCmdVersionRequired(const TDesC& aSection);
|
sl@0
|
83 |
void DoCmdWriteL(const TDesC& aSection, const TInt aAsyncErrorIndex);
|
sl@0
|
84 |
void DoCmdWriteCancel();
|
sl@0
|
85 |
|
sl@0
|
86 |
// Helpers
|
sl@0
|
87 |
void PrepareReadExpectedBufferLengthL(CT_ActiveCallbackIO& aCallback, const TDesC& aSection);
|
sl@0
|
88 |
|
sl@0
|
89 |
private:
|
sl@0
|
90 |
RBusDevComm* iBusDevComm;
|
sl@0
|
91 |
HBufC8* iBufferRead;
|
sl@0
|
92 |
TPtr8 iBufferReadPtr;
|
sl@0
|
93 |
TPtr8 iBufferReadOneOrMorePtr;
|
sl@0
|
94 |
TInt iReadOneOrMoreLeft;
|
sl@0
|
95 |
TBool iHasReadExpected;
|
sl@0
|
96 |
TInt iBufferLength;
|
sl@0
|
97 |
TUint iMinTurnaroundTime;
|
sl@0
|
98 |
TInt iReceiveBufferLength;
|
sl@0
|
99 |
TUint iSignals;
|
sl@0
|
100 |
TUint iNotifySignals;
|
sl@0
|
101 |
TBool iHasNotifySignalsExpected;
|
sl@0
|
102 |
TUint iNotifySignalsExpected;
|
sl@0
|
103 |
CActiveCallbackBase* iCallbackBreak;
|
sl@0
|
104 |
CActiveCallbackBase* iCallbackNotifyReceiveDataAvailable;
|
sl@0
|
105 |
CActiveCallbackBase* iCallbackNotifySignalChange;
|
sl@0
|
106 |
CT_ActiveCallbackIO* iCallbackRead;
|
sl@0
|
107 |
CT_ActiveCallbackIO* iCallbackReadOneOrMore;
|
sl@0
|
108 |
CT_ActiveCallbackIO* iCallbackWrite;
|
sl@0
|
109 |
|
sl@0
|
110 |
static const TEnumEntryTable iEnumTableSignals[];
|
sl@0
|
111 |
};
|
sl@0
|
112 |
|
sl@0
|
113 |
#endif /* __T_RBUS_DEV_COMM_DATA_H__ */
|