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 |
|
|
109 |
|
|
110 |
private: // Data
|
|
111 |
|
|
112 |
// Ownership. Pointer for sending received data to USB
|
|
113 |
CUsbPnUsbSender* iUsbSender;
|
|
114 |
|
|
115 |
// Reference to ISCAPI handle for receiving data
|
|
116 |
RIscApi& iIscApi;
|
|
117 |
|
|
118 |
//Not owned. Packet to receive to
|
|
119 |
CUsbPnPacket* iPacket;
|
|
120 |
|
|
121 |
// Modifiable pointer to buffer.
|
|
122 |
TPtr8 iRecvPtr;
|
|
123 |
|
|
124 |
// ISCAPI tells if buffer is too short
|
|
125 |
TUint16 iNeededLength;
|
|
126 |
|
|
127 |
// Flag for discarding when USB is not active
|
|
128 |
TBool iForwardFlag;
|
|
129 |
|
|
130 |
};
|
|
131 |
|
|
132 |
#endif // CUSBPNISARECEIVER_H
|
|
133 |
|
|
134 |
// End of File
|