author | mikaruus <mika.a.ruuskanen@nokia.com> |
Thu, 14 Jan 2010 10:44:58 +0200 | |
changeset 5 | 8ccc39f9d787 |
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 |
||
20 |
#ifndef DISAKERNELCHANNEL_H |
|
21 |
#define DISAKERNELCHANNEL_H |
|
22 |
||
23 |
#include <e32def.h> // For TInt, TAny |
|
24 |
#include <e32cmn.h> // For TDesC8, |
|
25 |
#include <dfcs.h> // For TDfc |
|
26 |
#include "internalapi.h" // For MIAD2ChannelApi, MChannel2IADApi |
|
27 |
||
28 |
class DExtensionAPI; |
|
29 |
class DQueue; |
|
30 |
||
31 |
NONSHARABLE_CLASS( DISAKernelChannel ) : public MIAD2ChannelApi |
|
32 |
{ |
|
33 |
||
34 |
public: |
|
35 |
DISAKernelChannel(); |
|
36 |
~DISAKernelChannel(); |
|
37 |
||
38 |
// Handles request according to enumeration fromm DIsaKernelApi |
|
39 |
// TInt HandleRequest( const TUint16 aRequest, TAny* aParams ); |
|
40 |
TInt HandleRequest( TThreadMessage& aMsg ); |
|
41 |
||
42 |
// From MIAD2ChannelApi |
|
43 |
||
44 |
/* |
|
45 |
* @param aStatus, connection status |
|
46 |
* @return void |
|
47 |
*/ |
|
48 |
void NotifyConnectionStatus( TIADConnectionStatus aStatus ); |
|
49 |
||
50 |
void ReceiveMsg( const TDesC8& aMessage ); |
|
51 |
||
52 |
// Register pep associated to this channel to listen data message |
|
53 |
// deliveries. |
|
54 |
void RegisterPep( MDataMessageStatus& aPep ); |
|
55 |
||
56 |
// When data message is written to user thread call |
|
57 |
// MDataMesssageStatus::DataMessageDelivered. It's responsibility is to |
|
58 |
// tell PEP that one data message e.g.a credit is used. PEP's should also |
|
59 |
// keep count of data messages added to channel to be abel to control the |
|
60 |
// legacy flowcontrol |
|
61 |
void ReceiveDataMsg( const TDesC8& aDataMessage ); |
|
62 |
||
63 |
void NotifyFlowCtrl( TIADFlowControlStatus aStatus ); |
|
64 |
||
65 |
void CompleteChannelRequest( TInt aRequest, TInt aStatusToComplete ); |
|
66 |
||
67 |
inline TUint8 GetChannelNumber(){ return iChannelNumber; }; |
|
68 |
// MIAD2ChannelApi end |
|
69 |
||
70 |
private: |
|
71 |
||
72 |
void Close( const TUint16 aChannelId ); |
|
73 |
||
74 |
static void MsgQDfc( TAny* aPtr ); |
|
75 |
||
76 |
void HandleThreadMsg( TThreadMessage& aMsg ); |
|
77 |
||
78 |
void HandleDfcRequest( TThreadMessage& aMsg ); |
|
79 |
||
80 |
TInt HandleSyncRequest( TThreadMessage& aMsg ); |
|
81 |
||
82 |
void DoCancel( TInt aRequest, TInt aMask ); |
|
83 |
||
84 |
// TODO: unique?? |
|
85 |
void ResetQueues(); |
|
86 |
||
87 |
static void EmptyRxDfc( TAny* aPtr ); |
|
88 |
||
89 |
static void EmptyDataRxDfc( TAny* aPtr ); |
|
90 |
||
91 |
// Checking context. |
|
92 |
void CheckDfc(); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
93 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
94 |
//From objectapi |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
95 |
void Receive( const TDesC8& aMessage ); |
0 | 96 |
|
97 |
private: |
|
98 |
||
99 |
class TIADKernelAsyncRequest |
|
100 |
{ |
|
101 |
public: |
|
102 |
TDfc* iDfcFunction; |
|
103 |
TInt* iRequestStatus; |
|
104 |
}; |
|
105 |
||
106 |
TUint16 iChannelNumber; |
|
107 |
// owned |
|
108 |
DQueue* iRx; |
|
109 |
DQueue* iDataRx; |
|
110 |
TDes8** iPtrPtrToRxBuf; |
|
111 |
TDes8** iPtrPtrToDataRxBuf; |
|
112 |
TDfc* iEmptyRxDfc; |
|
113 |
TDfc* iEmptyDataRxDfc; |
|
114 |
// not owned, just using |
|
115 |
MDataMessageStatus* iPep; |
|
116 |
MChannel2IADApi* iExtensionApi; |
|
117 |
TIADKernelAsyncRequest iRequests[ EIADAsyncLast ]; // TODO: the amount of kernel request. |
|
118 |
TMessageQue iKernelChMsgQue; |
|
119 |
||
120 |
}; |
|
121 |
||
122 |
||
123 |
||
124 |
#endif /* DISAKERNELCHANNEL_H */ |