author | mikaruus |
Tue, 19 Oct 2010 13:16:20 +0300 | |
changeset 9 | 8486d82aef45 |
parent 8 | 6295dc2169f3 |
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 CMODEMATSESSION_H |
|
21 |
#define CMODEMATSESSION_H |
|
22 |
||
23 |
#include <e32svr.h> |
|
24 |
||
25 |
class CModemAtSrv; |
|
26 |
class RModemAtController; |
|
27 |
||
28 |
// CLASS DECLARATION |
|
29 |
||
30 |
/** |
|
31 |
* CModemAtSession receives and completes client's requests. CModemAtSession forwards |
|
32 |
* requests to the CModemAtSrv. |
|
33 |
*/ |
|
34 |
||
35 |
NONSHARABLE_CLASS( CModemAtSession ) : public CSession2 |
|
36 |
{ |
|
37 |
||
38 |
public: |
|
39 |
||
40 |
/** |
|
41 |
* Two-phased constructor. |
|
42 |
* @param aServer |
|
43 |
* @return Instance of self |
|
44 |
*/ |
|
45 |
static CModemAtSession* NewL( CModemAtSrv& aServer, const TVersion& aVersion ); |
|
46 |
||
47 |
/** |
|
48 |
* Destructor. |
|
49 |
*/ |
|
50 |
~CModemAtSession(); |
|
51 |
||
52 |
/** |
|
53 |
* Called by CModemAtHandler, when Unsolicitated data ind is received |
|
54 |
*/ |
|
55 |
void UnsolicitedData( const TDesC8& aData ); |
|
56 |
||
57 |
/** |
|
58 |
* Called by CModemAtHandler, when signal ind is received |
|
9 | 59 |
* @param aCompleteCode |
0 | 60 |
*/ |
9 | 61 |
void SignalIndReceived( const TInt aCompleteCode ); |
0 | 62 |
|
63 |
/** |
|
9 | 64 |
* Returns DteId of current session |
65 |
* @return DteID |
|
66 |
*/ |
|
67 |
TUint8 GetDteId(); |
|
68 |
||
69 |
/** |
|
70 |
* Sets DteID for this session |
|
71 |
* @param aDteId DteId |
|
0 | 72 |
*/ |
9 | 73 |
void SetDteId( const TUint8 aDteId ); |
74 |
||
75 |
/** |
|
76 |
* Returns name of current session |
|
77 |
* @return Session name |
|
78 |
*/ |
|
0 | 79 |
TDesC8& GetName(); |
80 |
||
81 |
/** |
|
9 | 82 |
* Returns plugin type (common/atext) |
83 |
* @return Plugintype |
|
84 |
*/ |
|
0 | 85 |
TATPluginInterface GetPluginType(); |
86 |
||
87 |
/** |
|
9 | 88 |
* Modem-Connected-callback. Called when modem is connected. |
89 |
* @param aDteId DteId |
|
90 |
* @param aErr Error code |
|
91 |
* @return void |
|
0 | 92 |
*/ |
93 |
void ModemConnected( const TInt aErr ); |
|
94 |
||
95 |
/** |
|
96 |
* CommandModeChanged. Called when pipe handle indicates that mode is changed. |
|
97 |
* @param aMode TCommandMode aMode |
|
9 | 98 |
* @return void |
0 | 99 |
*/ |
100 |
void CommandModeChanged( TCommandMode aMode ) ; |
|
101 |
||
102 |
/** |
|
103 |
* IsUnsolicitedDataReqActive |
|
104 |
* @return ETrue if request is active, otherwise EFalse |
|
105 |
*/ |
|
106 |
TBool IsUnsolicitedDataReqActive(); |
|
107 |
||
108 |
/** |
|
109 |
* IsSignalIndReqActive |
|
110 |
* @return ETrue if request is active, otherwise EFalse |
|
111 |
*/ |
|
112 |
TBool IsSignalIndReqActive(); |
|
113 |
||
114 |
/** |
|
115 |
* IsCommandModeReqActive |
|
116 |
* @return ETrue if request is active, otherwise EFalse |
|
117 |
*/ |
|
118 |
TBool IsCommandModeReqActive(); |
|
119 |
||
120 |
/** |
|
121 |
* IsConnectReqActive |
|
122 |
* @return ETrue if request is active, otherwise EFalse |
|
123 |
*/ |
|
124 |
TBool IsConnectReqActive(); |
|
125 |
||
9 | 126 |
/** |
127 |
* sets handler for this session |
|
128 |
* @param aHandler pointer to handler, which handles messages |
|
129 |
* for this session |
|
130 |
* @return void |
|
131 |
*/ |
|
132 |
void SetHandler( CModemAtHandler* aHandler ); |
|
133 |
||
134 |
/** |
|
135 |
* gets handler for this session |
|
136 |
* @return pointer to handler, which handles messages for this session |
|
137 |
*/ |
|
138 |
CModemAtHandler* GetHandler(); |
|
139 |
||
0 | 140 |
private: |
141 |
||
142 |
// from base class CSession2 |
|
143 |
void ServiceL( const RMessage2& aMessage ); |
|
144 |
void DoServiceL( const RMessage2& aMessage ); |
|
145 |
||
146 |
/** |
|
147 |
* Checks if there is existing request and completes it. |
|
148 |
* @param aMessage Message to be checked. |
|
149 |
* @return ETrue if there was request already pending. |
|
150 |
*/ |
|
151 |
TBool CheckAndCompleteExistingRequest( const RMessage2& aMessage ); |
|
152 |
||
153 |
||
154 |
private: |
|
155 |
||
156 |
/** |
|
157 |
* Default C++ constructor. |
|
158 |
* @param aServer Reference to the CModemAtsrv |
|
159 |
* @param aVersion Version of client |
|
160 |
* @param aHandler Reference to the CModemAtHandler |
|
161 |
*/ |
|
162 |
CModemAtSession( CModemAtSrv& aServer, const TVersion& aVersion ); |
|
163 |
||
164 |
// data |
|
165 |
CModemAtSrv& iServer; |
|
166 |
RMessage2 iConnectReq; |
|
167 |
RMessage2 iSignalIndReq; |
|
168 |
RMessage2 iUnsolicitedDataReq; |
|
169 |
RMessage2 iCommandModeReq; |
|
170 |
||
171 |
TVersion iVersion; |
|
9 | 172 |
TUint8 iDteId; |
0 | 173 |
HBufC8* iClientName; |
174 |
TATPluginInterface iPluginType; |
|
175 |
TPtr8 iClientNamePtr; |
|
9 | 176 |
TBuf8<KMaxBufferLength> iTemporaryUnsolicitedData; |
177 |
CModemAtHandler* iHandler; |
|
0 | 178 |
}; |
179 |
||
180 |
#endif // CMODEMATSESSION_H |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
181 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
182 |