0
|
1 |
/*
|
9
|
2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
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 |
|
|
20 |
#ifndef BCATOISC_H
|
|
21 |
#define BCATOISC_H
|
9
|
22 |
|
0
|
23 |
#include <networking/bca.h>
|
|
24 |
#include <iscapi.h>
|
|
25 |
#include <e32std.h>
|
|
26 |
#include <e32base.h>
|
|
27 |
#include <e32def.h>
|
|
28 |
|
9
|
29 |
#include <tisi.h>
|
|
30 |
const TUint8 KMaxChannelNbr = 11;
|
|
31 |
const TUint8 KNameLen = 4;
|
0
|
32 |
|
|
33 |
/**
|
|
34 |
* BCATOISC Panic code.
|
|
35 |
* @internalComponent.
|
|
36 |
*/
|
|
37 |
|
|
38 |
enum TBcaToIscPanic
|
|
39 |
{
|
|
40 |
|
|
41 |
/** Monitor already existrs, we have a memory leak */
|
|
42 |
EMonitorAlreadyExists,
|
|
43 |
|
|
44 |
};
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
/** This namespace includes the BCA component names.*/
|
|
49 |
namespace BasebandChannelAdaptation
|
|
50 |
{
|
|
51 |
|
|
52 |
class CBcaToIsc;
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Monitors the ISCAPI flow control
|
|
56 |
*/
|
|
57 |
NONSHARABLE_CLASS(CNotifyFlowControlMonitor): public CActive
|
|
58 |
{
|
|
59 |
|
|
60 |
public:
|
|
61 |
|
|
62 |
CNotifyFlowControlMonitor(RIscApi& aIscApi);
|
|
63 |
void NotifyFlowControlStatus();
|
|
64 |
void RequestFlowcontrolChange( TRequestStatus& aClientStatus );
|
9
|
65 |
void CompleteFlowcontrolChangeWithCancel();
|
0
|
66 |
void RunL();
|
|
67 |
void DoCancel();
|
|
68 |
TInt GetFlowControlState();
|
|
69 |
~CNotifyFlowControlMonitor();
|
|
70 |
|
|
71 |
private:
|
|
72 |
|
|
73 |
RIscApi& iIscApi;
|
|
74 |
TInt iFlowControlValue;
|
|
75 |
TRequestStatus* iWriteStatus;
|
|
76 |
|
|
77 |
};
|
|
78 |
|
|
79 |
|
|
80 |
NONSHARABLE_CLASS(CNotifyWriteStatusMonitor): public CActive
|
|
81 |
{
|
|
82 |
|
|
83 |
public:
|
|
84 |
|
|
85 |
CNotifyWriteStatusMonitor(CBcaToIsc& aUser, RIscApi& aIscApi);
|
|
86 |
void Write( TRequestStatus& aStatus, const TDesC8& aBuf );
|
9
|
87 |
void SendAndComplete(TInt error);
|
0
|
88 |
void RunL();
|
|
89 |
void DoCancel();
|
|
90 |
~CNotifyWriteStatusMonitor();
|
|
91 |
|
|
92 |
private:
|
|
93 |
|
|
94 |
CBcaToIsc& iUser;
|
|
95 |
RIscApi& iIscApi;
|
|
96 |
TRequestStatus* iClientStatus;
|
|
97 |
const TDesC8* iBuf;
|
|
98 |
// TPtr8* iBuf;
|
|
99 |
|
|
100 |
};
|
|
101 |
|
|
102 |
/**
|
|
103 |
* The interface between NIF and Isc Bearer Transport.
|
|
104 |
*/
|
9
|
105 |
NONSHARABLE_CLASS(CBcaToIsc):
|
|
106 |
public CActive,
|
|
107 |
public MBca // BCA is accessed via this interface by clients.
|
0
|
108 |
{
|
9
|
109 |
|
0
|
110 |
public:
|
|
111 |
|
|
112 |
CBcaToIsc();
|
|
113 |
virtual ~CBcaToIsc();
|
|
114 |
virtual void Release();
|
|
115 |
|
|
116 |
void ConstructL();
|
|
117 |
|
|
118 |
virtual void Open(TRequestStatus& aStatus, const TDesC& aChannelId);
|
|
119 |
|
|
120 |
virtual void Shutdown(TRequestStatus& aStatus);
|
|
121 |
virtual void Close();
|
|
122 |
|
|
123 |
virtual void Read(TRequestStatus& aStatus, TDes8& aBuf);
|
|
124 |
virtual void Write(TRequestStatus& aStatus, const TDesC8& aBuf);
|
|
125 |
|
|
126 |
virtual void CancelRead();
|
|
127 |
virtual void CancelWrite();
|
|
128 |
|
|
129 |
virtual void Ioctl(TRequestStatus& aStatus, TUint aOptLevel, TUint aOptName, TDes8& aOpt);
|
|
130 |
virtual void CancelIoctl();
|
9
|
131 |
|
|
132 |
TInt SendNameAddReq( TUint16& aObjId, TUint16& aClientObjId );
|
|
133 |
TInt SendNameRemoveReq();
|
|
134 |
TInt SendPepCtrlResp(
|
|
135 |
TUint8 aTrId,
|
|
136 |
TUint8 aReceiverDev,
|
|
137 |
TUint8 aReceiverObj,
|
|
138 |
TUint8 aPipeHandle,
|
|
139 |
TUint8 aPepCtrlId,
|
|
140 |
TUint8 aPepType,
|
|
141 |
TUint8 aResult );
|
|
142 |
void HandleReceivedMsg( const TIsiReceiveC& aIsiMsg );
|
|
143 |
void HandleNameServiceMsg( const TIsiReceiveC& aIsiMsg );
|
|
144 |
void HandlePipeMsg( const TIsiReceiveC& aIsiMsg );
|
|
145 |
void HandlePepCtrlReq( const TIsiReceiveC& aIsiMsg );
|
0
|
146 |
|
|
147 |
// Ownership
|
|
148 |
CNotifyWriteStatusMonitor* iWriteStatusMonitor;
|
|
149 |
CNotifyFlowControlMonitor* iFlowControlMonitor;
|
9
|
150 |
|
|
151 |
protected:
|
|
152 |
|
|
153 |
// from CActive
|
|
154 |
void RunL();
|
|
155 |
void DoCancel();
|
0
|
156 |
|
|
157 |
private:
|
|
158 |
|
|
159 |
RIscApi iIscApi;
|
|
160 |
// no ownership
|
|
161 |
TRequestStatus* iClientShutdownStatus;
|
9
|
162 |
TRequestStatus* iClientOpenStatus;
|
|
163 |
|
|
164 |
HBufC8* iReceivedMessageBuffer;
|
|
165 |
TPtr8 iMessageBufferPtr;
|
|
166 |
TBuf8<KNameLen> iName;
|
|
167 |
TBuf16<KMaxChannelNbr> iChannelList;
|
|
168 |
|
0
|
169 |
TUint16 iReadLength;
|
|
170 |
TUint16 iChannelNumber;
|
|
171 |
};
|
|
172 |
|
|
173 |
} // namespace BasebandChannelAdaptation
|
|
174 |
|
|
175 |
#endif //BCATOISC_H
|