author | mikaruus <mika.a.ruuskanen@nokia.com> |
Wed, 21 Apr 2010 14:29:55 +0300 | |
changeset 8 | 6295dc2169f3 |
parent 5 | 8ccc39f9d787 |
child 9 | 8486d82aef45 |
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 CMODEMATSRV_H |
|
21 |
#define CMODEMATSRV_H |
|
22 |
||
23 |
#include <e32svr.h> |
|
24 |
#include "cmodemathandler.h" //KMaxDteIdCount |
|
25 |
#include "modemattrace.h" |
|
26 |
||
27 |
const TUint8 EAtCmd = 0; |
|
28 |
const TUint8 EGetNvramStatus = 1; |
|
29 |
||
30 |
/* |
|
31 |
* Reference: i_at_modem_fp_3.1.doc (3.5.2) |
|
32 |
* If the unsolicited data needs to be sent to all of the connected DTE sessions, |
|
33 |
* AT Modem server would send the unsolicited data indication to the client with |
|
34 |
* the dte id as 0xFF. The 0xFF value for the DTE id is reserved for the |
|
35 |
* unsolicited data indication. |
|
36 |
*/ |
|
37 |
const TUint8 KUnsolicitedDataDteId = 0xff; |
|
38 |
||
39 |
const TInt KATModemCommandArgumentIndex = 0; |
|
40 |
const TInt KATModemResponseArgumentIndex = 1; |
|
41 |
const TInt KATModemUnsolicitedDataIndex = 0; |
|
42 |
||
43 |
_LIT8( KEmptyString, ""); |
|
44 |
||
45 |
class CModemAtSession; |
|
46 |
class CAtMessage; |
|
47 |
||
48 |
/** |
|
49 |
* CModemAtSrv server core class. CModemAtsrc creates/deletes sessions. Dte-ids are allocated |
|
50 |
* by CmodemAtSrv. |
|
51 |
*/ |
|
52 |
NONSHARABLE_CLASS( CModemAtSrv ) : public CPolicyServer |
|
53 |
{ |
|
54 |
||
55 |
public: |
|
56 |
||
57 |
/** |
|
58 |
* Two-phased constructor. |
|
59 |
*/ |
|
60 |
static CModemAtSrv* NewLC(); |
|
61 |
||
62 |
/** |
|
63 |
* Destructor. |
|
64 |
*/ |
|
65 |
~CModemAtSrv(); |
|
66 |
||
67 |
/** |
|
68 |
* When session is closed, this function is called. |
|
69 |
* @param aSession Reference to the session |
|
70 |
*/ |
|
71 |
void ClientClosed( CModemAtSession* aSession ); |
|
72 |
||
73 |
/** |
|
74 |
* Session count |
|
75 |
* @return Number of sessions open |
|
76 |
*/ |
|
77 |
TInt SessionCount(); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
78 |
|
0 | 79 |
/** |
80 |
* Connect session to the modem |
|
81 |
* @param CModemAtSession* aSession Pointer to the session |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
82 |
* @param TATPluginInterface aPluginType Atext or common plugin |
0 | 83 |
* @return Connection status: KErrNone, KErrAlreadyExists |
84 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
85 |
TInt ConnectToModem( CModemAtSession* aSession, TATPluginInterface aPluginType); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
86 |
|
0 | 87 |
/** |
88 |
* HandleSignalInd |
|
89 |
* @param aDteId Device Terminal ID |
|
90 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
91 |
void HandleSignalInd( const TUint8 aDteId ); |
0 | 92 |
/** |
93 |
* HandleUnsolicitedData |
|
94 |
* @param aDteId Device Terminal ID |
|
95 |
* @param aData Descriptor data |
|
96 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
97 |
void HandleUnsolicitedData( const TUint8 aDteId, const TDesC8& aData ); |
0 | 98 |
/** |
99 |
* HandleIntermediateDataInd |
|
100 |
* @param aDteId Device Terminal ID |
|
101 |
* @param aPluginType Plugin type |
|
102 |
* @param aResponse Response buffer |
|
103 |
* @param aCommand Command buffer |
|
104 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
105 |
void HandleIntermediateDataInd( const TUint8 aDteId, const TATPluginInterface aPluginType, const TDesC8& aResponse, const TUint8 aCommand ); |
0 | 106 |
|
107 |
/** |
|
108 |
* HandleATResponse |
|
109 |
* @param aDteId Device Terminal ID |
|
110 |
* @param aResponse Response buffer |
|
111 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
112 |
void HandleATResponse( const TUint8 aDteId, const TDesC8& aResponse, const TUint8 aCommand ); |
0 | 113 |
|
114 |
/** |
|
115 |
* HandleCommandModeChange |
|
116 |
* @param aMode Command mode 0 or data mode 1 |
|
117 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
118 |
void HandleCommandModeChange( TCommandMode aMode ); |
0 | 119 |
|
120 |
/** |
|
121 |
* AddToSendFifo |
|
122 |
* @param aPluginType Plugin type |
|
123 |
* @param aMessage RMessage2 container class |
|
124 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
125 |
void AddToSendFifo( const TATPluginInterface aPluginType, CAtMessage* aMessage ); |
0 | 126 |
|
127 |
/** |
|
128 |
* RemoveFirstFromSendFifo |
|
129 |
*/ |
|
130 |
void RemoveFirstFromSendFifo(); |
|
131 |
||
132 |
/** |
|
133 |
* SendNextFromFifo |
|
134 |
*/ |
|
135 |
void SendNextFromFifo(); |
|
136 |
||
137 |
/** |
|
138 |
* CancelFifoRequests |
|
139 |
* @param aSession Session class pointer |
|
140 |
*/ |
|
141 |
void CancelFifoRequests( const CModemAtSession* aSession ); |
|
142 |
||
143 |
/** |
|
144 |
* RemovePipe |
|
145 |
*/ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
146 |
void RemovePipe(); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
147 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
148 |
/** |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
149 |
* Sets DteID for this session |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
150 |
* @param aDteId DteId |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
151 |
* @param aConnectionError error |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
152 |
*/ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
153 |
void SetDteIdAndConnect( const TUint8 aDteId, const TInt aConnectionError ); |
0 | 154 |
|
155 |
private: |
|
156 |
||
157 |
/** |
|
158 |
* Creates a new session to client |
|
159 |
* |
|
160 |
* @param aVersion the version |
|
161 |
* @param aMessage not used |
|
162 |
* @return The new created session |
|
163 |
*/ |
|
164 |
CSession2* NewSessionL( const TVersion& aVersion, |
|
165 |
const RMessage2& aMessage ) const; |
|
166 |
||
167 |
/** |
|
168 |
* Constructor |
|
169 |
* |
|
170 |
* @param aPriority This AO's priority |
|
171 |
*/ |
|
172 |
CModemAtSrv( TInt aPriority ); |
|
173 |
||
174 |
/** |
|
175 |
* Two-Phase constructor |
|
176 |
*/ |
|
177 |
void ConstructL(); |
|
178 |
||
179 |
||
180 |
private: // data |
|
181 |
||
182 |
RPointerArray<CModemAtSession> iSessions; //Sessions from R-interface |
|
183 |
RPointerArray<CAtMessage> iAtMessageArray; |
|
184 |
CModemAtHandler* iHandler; |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
185 |
TUint8 iDteId; |
0 | 186 |
}; |
187 |
||
188 |
#endif // CMODEMATSRV_H |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
189 |