author | mikaruus <mika.a.ruuskanen@nokia.com> |
Thu, 14 Jan 2010 10:44:58 +0200 | |
changeset 5 | 8ccc39f9d787 |
parent 0 | 63b37f68c1ce |
child 7 | fa67e03b87df |
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 |
* |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
14 |
* Description: |
0 | 15 |
* |
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef CUSBPNISASENDER_H |
|
20 |
#define CUSBPNISASENDER_H |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include "musbpncontrolobserver.h" |
|
24 |
||
25 |
#include <e32base.h> // For CActive |
|
26 |
||
27 |
// CONSTANTS |
|
28 |
// MACROS |
|
29 |
// DATA TYPES |
|
30 |
// FUNCTION PROTOTYPES |
|
31 |
// FORWARD DECLARATIONS |
|
32 |
class MUsbPnBufferListener; |
|
33 |
class CUsbPnPacket; |
|
34 |
class RIscApi; |
|
35 |
||
36 |
// CLASS DECLARATION |
|
37 |
||
38 |
/** |
|
39 |
* Data sender to ISA direction. |
|
40 |
*/ |
|
41 |
class CUsbPnIsaSender : public CActive, public MUsbPnControlObserver |
|
42 |
{ |
|
43 |
public: // Constructors and destructor |
|
44 |
||
45 |
/** |
|
46 |
* Two-phased constructor. |
|
47 |
*/ |
|
48 |
static CUsbPnIsaSender* NewL( MUsbPnBufferListener&, RIscApi& ); |
|
49 |
||
50 |
/** |
|
51 |
* Destructor. |
|
52 |
*/ |
|
53 |
~CUsbPnIsaSender(); |
|
54 |
||
55 |
||
56 |
public: // Functions from base classes |
|
57 |
||
58 |
/** |
|
59 |
* From MUsbPnControlObserver. Returns usable circular packet if any. |
|
60 |
* @return CUsbPnPacket&. Packet for receiver. |
|
61 |
*/ |
|
62 |
CUsbPnPacket& PacketL(); |
|
63 |
||
64 |
/** |
|
65 |
* From MUsbPnControlObserver. Adds packet to send queue. |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
66 |
* @param aPacket |
0 | 67 |
*/ |
68 |
void Send( CUsbPnPacket& aPacket ); |
|
69 |
||
70 |
||
71 |
protected: // Functions from base classes |
|
72 |
||
73 |
/** |
|
74 |
* From CActive |
|
75 |
*/ |
|
76 |
void DoCancel( ); |
|
77 |
||
78 |
/** |
|
79 |
* From CActive |
|
80 |
*/ |
|
81 |
void RunL( ); |
|
82 |
||
83 |
/** |
|
84 |
* From CActive |
|
85 |
*/ |
|
86 |
TInt RunError( TInt ); |
|
87 |
||
88 |
||
89 |
private: |
|
90 |
||
91 |
/** |
|
92 |
* C++ default constructor. |
|
93 |
*/ |
|
94 |
CUsbPnIsaSender( MUsbPnBufferListener&, RIscApi& ); |
|
95 |
||
96 |
/** |
|
97 |
* By default Symbian 2nd phase constructor is private. |
|
98 |
*/ |
|
99 |
void ConstructL(); |
|
100 |
||
101 |
/** |
|
102 |
* Creates packet object. |
|
103 |
*/ |
|
104 |
void AddPacketBufferL( TInt ); |
|
105 |
||
106 |
/** |
|
107 |
* Sends packet if it is next in line and not already sending. |
|
108 |
*/ |
|
109 |
void TryToSendPacket( CUsbPnPacket& ); |
|
110 |
||
111 |
||
112 |
private: // Data |
|
113 |
||
114 |
// Reference to receiver for continuing receive |
|
115 |
MUsbPnBufferListener& iBufferListener; |
|
116 |
||
117 |
// Reference to ISCAPI handle |
|
118 |
RIscApi& iIscApi; |
|
119 |
||
120 |
// Number of packets in queue |
|
121 |
TUint iPacketCount; |
|
122 |
||
123 |
// Ownership. Newest packet -marker of circular buffer. Packets added to this 'end' of pool. |
|
124 |
CUsbPnPacket* iPacket; |
|
125 |
||
126 |
// Pointer to oldest packet -marker of circular buffer. Packets written from this 'end' of pool. |
|
127 |
CUsbPnPacket* iCurrentPacket; |
|
128 |
||
129 |
||
130 |
}; |
|
131 |
||
132 |
#endif // CUSBPNISASENDER_H |
|
133 |
||
134 |
// End of File |