author | mikaruus <mika.a.ruuskanen@nokia.com> |
Wed, 17 Feb 2010 13:58:55 +0200 | |
changeset 7 | fa67e03b87df |
parent 0 | 63b37f68c1ce |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef CUSBPNISARECEIVER_H |
|
20 |
#define CUSBPNISARECEIVER_H |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include <e32base.h> |
|
24 |
||
25 |
#include "musbpnbufferlistener.h" |
|
26 |
||
27 |
// CONSTANTS |
|
28 |
// MACROS |
|
29 |
// DATA TYPES |
|
30 |
// FUNCTION PROTOTYPES |
|
31 |
// FORWARD DECLARATIONS |
|
32 |
class MUsbPnBufferListener; |
|
33 |
class CUsbPnUsbSender; |
|
34 |
class CUsbPnPacket; |
|
35 |
class RIscApi; |
|
36 |
class RDevUsbcClient; |
|
37 |
||
38 |
// CLASS DECLARATION |
|
39 |
||
40 |
/** |
|
41 |
* Message sender for ISA direction. |
|
42 |
*/ |
|
43 |
class CUsbPnIsaReceiver : public CActive, public MUsbPnBufferListener |
|
44 |
{ |
|
45 |
public: // Constructors and destructor |
|
46 |
||
47 |
/** |
|
48 |
* Two-phased constructor. |
|
49 |
*/ |
|
50 |
static CUsbPnIsaReceiver* NewL( RIscApi& aIscApi, RDevUsbcClient& aLdd ); |
|
51 |
||
52 |
/** |
|
53 |
* Destructor. |
|
54 |
*/ |
|
55 |
~CUsbPnIsaReceiver(); |
|
56 |
||
57 |
||
58 |
public: // Functions from base classes |
|
59 |
||
60 |
/** |
|
61 |
* From MUsbPnBufferListener. Called by CUsbPnInterface when initialised |
|
62 |
* or by sender when reactivating receive. |
|
63 |
* @param TBool aDiscard. Flag for determining if data can be transmitted to USB. |
|
64 |
*/ |
|
65 |
void Receive( TBool aDiscard ); |
|
66 |
||
67 |
/** |
|
68 |
* Handles flag that identify if Phonet connection is open to PC |
|
69 |
* @param TBool aForwardFlag. Flag for determining if data can be transmitted to USB. |
|
70 |
*/ |
|
71 |
void SetForwardFlag( TBool aForward ); |
|
72 |
||
73 |
||
74 |
protected: // Functions from base classes |
|
75 |
||
76 |
/** |
|
77 |
* From CActive |
|
78 |
*/ |
|
79 |
void DoCancel( ); |
|
80 |
||
81 |
/** |
|
82 |
* From CActive |
|
83 |
*/ |
|
84 |
void RunL( ); |
|
85 |
||
86 |
/** |
|
87 |
* From CActive |
|
88 |
*/ |
|
89 |
TInt RunError( TInt ); |
|
90 |
||
91 |
||
92 |
private: |
|
93 |
||
94 |
/** |
|
95 |
* C++ default constructor. |
|
96 |
*/ |
|
97 |
CUsbPnIsaReceiver( RIscApi& ); |
|
98 |
||
99 |
/** |
|
100 |
* By default Symbian 2nd phase constructor is private. |
|
101 |
*/ |
|
102 |
void ConstructL( RDevUsbcClient& ); |
|
103 |
||
104 |
/** |
|
105 |
* Construct message as needed by receiver. |
|
106 |
*/ |
|
107 |
void ConstructMessage(); |
|
108 |
||
7
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
109 |
/** |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
110 |
* Set active for receiving next packet from ISC API |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
111 |
*/ |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
112 |
void ReceivingNextPacket(); |
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
113 |
|
fa67e03b87df
New release based on our 2010wk08 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
114 |
|
0 | 115 |
|
116 |
private: // Data |
|
117 |
||
118 |
// Ownership. Pointer for sending received data to USB |
|
119 |
CUsbPnUsbSender* iUsbSender; |
|
120 |
||
121 |
// Reference to ISCAPI handle for receiving data |
|
122 |
RIscApi& iIscApi; |
|
123 |
||
124 |
//Not owned. Packet to receive to |
|
125 |
CUsbPnPacket* iPacket; |
|
126 |
||
127 |
// Modifiable pointer to buffer. |
|
128 |
TPtr8 iRecvPtr; |
|
129 |
||
130 |
// ISCAPI tells if buffer is too short |
|
131 |
TUint16 iNeededLength; |
|
132 |
||
133 |
// Flag for discarding when USB is not active |
|
134 |
TBool iForwardFlag; |
|
135 |
||
136 |
}; |
|
137 |
||
138 |
#endif // CUSBPNISARECEIVER_H |
|
139 |
||
140 |
// End of File |