|
1 /* |
|
2 * Copyright (c) 2007-2008 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 CMMPIPECONTROL_H |
|
21 #define CMMPIPECONTROL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <iscnokiadefinitions.h> |
|
25 #include "cmmphonetsender.h" |
|
26 #include "cmmphonetreceiver.h" // for mmmmessagereceiver |
|
27 #include "nokiatsy_internal_variation.h" |
|
28 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
29 #include "pn_const_for_uicc.h" |
|
30 #else /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
31 #include <pn_const.h> |
|
32 #endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
33 #include <pipeisi.h> |
|
34 #include <pipe_sharedisi.h> |
|
35 #include <ctsy/serviceapi/mmtsy_defaults.h> |
|
36 #include "nokiatsy_internal_variation.h" |
|
37 |
|
38 // CONSTANTS |
|
39 const TUint8 KFirstPepType = PN_PEP_TYPE_COMMON; // First PEP type |
|
40 const TUint8 KSecondPepType = PN_PEP_TYPE_GPRS; // Second PEP type |
|
41 const TUint8 KSecondPepDevice = 0x00; // Device Id of second PEP |
|
42 const TUint8 KSecondPepObject = 0x33; // Object Id of second PEP |
|
43 const TUint8 KUnknownTransID = 0x00; |
|
44 |
|
45 const TUint8 KInvalidPipeHandle = 0xFF; |
|
46 |
|
47 // Maximum number of simultaneous PipeHandle supported by this phone. |
|
48 const TInt KMmMaxNumberOfPipeHandles = KMmMaxNumberOfContexts; |
|
49 |
|
50 const TUint8 KFirstPepDevice = PN_DEV_HOST; // Device Id of first PEP |
|
51 |
|
52 #ifdef DUMMY_NIF_PEP_FOR_PACKET_DATA_TESTING_DOS |
|
53 |
|
54 // Channel ID's |
|
55 // Proxy Id's are taken from IscNokiaDefinitions.h file |
|
56 const TUint8 KMmPacketContextProxy1_DOS = EIscNokiaMmTsy; |
|
57 const TUint8 KMmPacketContextProxy2_DOS = EIscNokiaMmTsy; |
|
58 const TUint8 KMmPacketContextProxy3_DOS = EIscNokiaMmTsy; |
|
59 const TUint8 KMmPacketContextProxy4_DOS = EIscNokiaMmTsy; |
|
60 const TUint8 KMmPacketContextProxy5_DOS = EIscNokiaMmTsy; |
|
61 const TUint8 KMmPacketContextProxy6_DOS = EIscNokiaMmTsy; |
|
62 const TUint8 KMmPacketContextProxy7_DOS = EIscNokiaMmTsy; |
|
63 const TUint8 KMmPacketContextProxy8_DOS = EIscNokiaMmTsy; |
|
64 const TUint8 KMmPacketContextProxy9_DOS = EIscNokiaMmTsy; |
|
65 const TUint8 KMmPacketContextProxy10_DOS = EIscNokiaMmTsy; |
|
66 const TUint8 KMmPacketContextProxy11_DOS = EIscNokiaMmTsy; |
|
67 |
|
68 #else |
|
69 |
|
70 const TUint8 KMmPacketContextProxy1_DOS = EIscNokiaNifPep0; |
|
71 const TUint8 KMmPacketContextProxy2_DOS = EIscNokiaNifPep1; |
|
72 const TUint8 KMmPacketContextProxy3_DOS = EIscNokiaNifPep2; |
|
73 const TUint8 KMmPacketContextProxy4_DOS = EIscNokiaNifPep3; |
|
74 const TUint8 KMmPacketContextProxy5_DOS = EIscNokiaNifPep4; |
|
75 const TUint8 KMmPacketContextProxy6_DOS = EIscNokiaNifPep5; |
|
76 const TUint8 KMmPacketContextProxy7_DOS = EIscNokiaNifPep6; |
|
77 const TUint8 KMmPacketContextProxy8_DOS = EIscNokiaNifPep7; |
|
78 const TUint8 KMmPacketContextProxy9_DOS = EIscNokiaNifPep8; |
|
79 const TUint8 KMmPacketContextProxy10_DOS = EIscNokiaNifPep9; |
|
80 const TUint8 KMmPacketContextProxy11_DOS = EIscNokiaNifPep10; |
|
81 |
|
82 #endif // DUMMY_NIF_PEP_FOR_PACKET_DATA_TESTING_DOS |
|
83 |
|
84 // Dummy transaction id |
|
85 const TInt KDummyTrId = 0x0F; |
|
86 |
|
87 // Last byte index |
|
88 const TInt KLastByteIndex = 3; |
|
89 |
|
90 // MACROS |
|
91 // None |
|
92 |
|
93 // DATA TYPES |
|
94 // None |
|
95 |
|
96 // FUNCTION PROTOTYPES |
|
97 // None |
|
98 |
|
99 // FORWARD DECLARATIONS |
|
100 class TIsiReceiveC; |
|
101 class CMmDataPackage; |
|
102 class CMmPacketContextMessHandler; |
|
103 class CMmPacketContextMesshandlerList; |
|
104 |
|
105 // CLASS DECLARATION |
|
106 // CMmPipeControl is used to create and send GSM-specific pipe control |
|
107 // ISI messages to PhoNet via PhoNetSender. It also receives |
|
108 // GSM-specific pipe control ISI messages from Phonet via PhoNetReceiver. |
|
109 class CMmPipeControl : public CBase, |
|
110 public MMmMessageReceiver |
|
111 { |
|
112 public: // Constructors and destructor. |
|
113 |
|
114 /** |
|
115 * NewL method is used to create a new instance of class. |
|
116 * @param CMmPhoNetSender*: pointer to phonet sender |
|
117 * @param CMmPhoNetReceiver*: pointer to phonet receiver |
|
118 * @param CMmPacketContextMessHandler*: pointer to context message handler |
|
119 * @param CMmPacketContextMesshandlerList*: pointer to context list |
|
120 * @return CMmPipeControl*: pointer to the message handler |
|
121 */ |
|
122 static CMmPipeControl* NewL( |
|
123 CMmPhoNetSender* aPhoNetSender, |
|
124 CMmPhoNetReceiver* aPhoNetReceiver, |
|
125 CMmPacketContextMessHandler* aMmPacketContextMessHandler, |
|
126 CMmPacketContextMesshandlerList* aMmPacketContextMesshandlerList ); |
|
127 |
|
128 /** |
|
129 * Destructor. |
|
130 */ |
|
131 ~CMmPipeControl(); |
|
132 |
|
133 public: // New classes |
|
134 |
|
135 // TPipeOperationInfo |
|
136 class TPipeOperationInfo |
|
137 { |
|
138 public: |
|
139 TUint8 iPipeHandle; |
|
140 TUint8 iTransId; |
|
141 }; |
|
142 |
|
143 public: // Functions from base classes |
|
144 |
|
145 /** |
|
146 * Isimsg received by PhonetReceiver. |
|
147 * @param TIsiReceiveC, reference to the received message. |
|
148 */ |
|
149 void ReceiveMessageL( const TIsiReceiveC& aIsiMessage ); |
|
150 |
|
151 public: // New functions |
|
152 |
|
153 /** |
|
154 * Creates PnsPipeCreateReq ISI message and sends it to Phonet. |
|
155 * @param aTransId: transaction Id |
|
156 * @param aPipeState: pipe state |
|
157 * @param aFirstPepObject: First PEP object Id |
|
158 * @return error value: Symbian error code |
|
159 */ |
|
160 TInt PnsPipeCreateReq( |
|
161 const TUint8 aTransId, |
|
162 const TUint8 aPipeState, |
|
163 const TUint8 aFirstPepObject ) const; |
|
164 |
|
165 /** |
|
166 * Creates PnsPipeEnableReq ISI message and sends it to Phonet. |
|
167 * @param aPackage: data package |
|
168 * @return error value: Symbian error code |
|
169 */ |
|
170 TInt PnsPipeEnableReq( const CMmDataPackage& aPackage ) const; |
|
171 |
|
172 /** |
|
173 * Creates PnsPipeResetReq ISI message and sends it to Phonet. |
|
174 * @param aTransId: transaction Id |
|
175 * @param aPipeHandle: pipe handle |
|
176 * @param aStateAfterReset: pipe state after reset |
|
177 * @return error value: Symbian error code |
|
178 */ |
|
179 TInt PnsPipeResetReq( |
|
180 const TUint8 aTransId, |
|
181 const TUint8 aPipeHandle, |
|
182 const TUint8 aStateAfterReset ); |
|
183 |
|
184 /** |
|
185 * Creates PnsPipeRemoveReq ISI message and sends it to Phonet. |
|
186 * @param aTransId: transaction Id |
|
187 * @param aPipeHandle: pipe handle |
|
188 * @return error value: Symbian error code |
|
189 */ |
|
190 TInt PnsPipeRemoveReq( |
|
191 const TUint8 aTransId, |
|
192 const TUint8 aPipeHandle ); |
|
193 |
|
194 public: // Functions from base classes |
|
195 // None |
|
196 |
|
197 protected: // New functions |
|
198 // None |
|
199 |
|
200 protected: // Functions from base classes |
|
201 // None |
|
202 |
|
203 private: // New functions |
|
204 |
|
205 /** |
|
206 * C++ default constructor. |
|
207 */ |
|
208 CMmPipeControl(); |
|
209 |
|
210 /** |
|
211 * By default EPOC constructor is private. |
|
212 */ |
|
213 void ConstructL(); |
|
214 |
|
215 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
216 /** |
|
217 * Creates PnsNameQueryReq ISI message and sends it to Phonet. |
|
218 * @return error value: Symbian error code |
|
219 */ |
|
220 TInt PnsNameQueryReq() const; |
|
221 #endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
222 |
|
223 /** |
|
224 * PnsPipeCreate response. |
|
225 * @param aIsiMessage, reference to the received message. |
|
226 */ |
|
227 void PnsPipeCreateResp( const TIsiReceiveC &aIsiMessage ); |
|
228 |
|
229 /** |
|
230 * PnsPipeEnable response. |
|
231 * @param aIsiMessage, reference to the received message. |
|
232 */ |
|
233 void PnsPipeEnableResp( const TIsiReceiveC& aIsiMessage ); |
|
234 |
|
235 /** |
|
236 * PnsPipeReset response. |
|
237 * @param aIsiMessage, reference to the received message. |
|
238 */ |
|
239 void PnsPipeResetResp( const TIsiReceiveC& aIsiMessage ); |
|
240 |
|
241 /** |
|
242 * PnsPipeRemove response. |
|
243 * @param aIsiMessage, reference to the received message. |
|
244 */ |
|
245 void PnsPipeRemoveResp( const TIsiReceiveC& aIsiMessage ); |
|
246 |
|
247 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
248 /** |
|
249 * PnsNameQuery response. |
|
250 * @param aIsiMessage, reference to the received message. |
|
251 */ |
|
252 void PnsNameQueryResp( const TIsiReceiveC& aIsiMessage ); |
|
253 #endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
254 |
|
255 /** |
|
256 * Initialize lists. |
|
257 */ |
|
258 void InitLists(); |
|
259 |
|
260 /** |
|
261 * Set Pipe Handle. |
|
262 * @param aPipeHandle: pipe handle |
|
263 */ |
|
264 void SetPipeHandle( const TUint8 aPipeHandle ); |
|
265 |
|
266 /** |
|
267 * Set Transaction Id. |
|
268 * @param aPipeHandle: pipe handle |
|
269 * @param aTransId: transaction Id |
|
270 */ |
|
271 void SetTransactionId( |
|
272 const TUint8 aPipeHandle, |
|
273 const TUint8 aTransId ); |
|
274 |
|
275 /** |
|
276 * Return Transaction Id. |
|
277 * @param aPipeHandle: pipe handle |
|
278 * @return TUint8, Transaction Id |
|
279 */ |
|
280 TUint8 TransactionId( const TUint8 aPipeHandle ) const; |
|
281 |
|
282 /** |
|
283 * Reset Pipe Handle. |
|
284 * @param aPipeHandle: pipe handle |
|
285 */ |
|
286 void ResetPipeHandle( const TUint8 aPipeHandle ); |
|
287 |
|
288 /** |
|
289 * If PipeHandle found returns True otherwise returns False. |
|
290 * @param aPipeHandle: pipe handle |
|
291 */ |
|
292 TBool IsOperationCalled( const TUint8 aPipeHandle ) const; |
|
293 |
|
294 #ifdef DUMMY_NIF_PEP_FOR_PACKET_DATA_TESTING_DOS |
|
295 /** |
|
296 * PnsPepConnect request. |
|
297 * @param aIsiMessage, reference to the received message. |
|
298 */ |
|
299 void PnsPepConnectReq( const TIsiReceiveC& aIsiMessage ); |
|
300 |
|
301 /** |
|
302 * PnsPepDisconnect request. |
|
303 * @param aIsiMessage, reference to the received message. |
|
304 */ |
|
305 void PnsPepDisconnectReq( const TIsiReceiveC& aIsiMessage ); |
|
306 |
|
307 /** |
|
308 * PnsPepReset request. |
|
309 * @param aIsiMessage, reference to the received message. |
|
310 */ |
|
311 void PnsPepResetReq( const TIsiReceiveC& aIsiMessage ); |
|
312 |
|
313 /** |
|
314 * PnsPepEnable request. |
|
315 * @param aIsiMessage, reference to the received message. |
|
316 */ |
|
317 void PnsPepEnableReq( const TIsiReceiveC& aIsiMessage ); |
|
318 |
|
319 /** |
|
320 * PnsPepConnect response. |
|
321 * @param aTransId: transaction Id |
|
322 * @param aPipeHandle: pipe handle |
|
323 */ |
|
324 void PnsPepConnectResp( |
|
325 const TUint8 aTransId, |
|
326 const TUint8 aPipeHandle ); |
|
327 |
|
328 /** |
|
329 * PnsPepDisconnect response. |
|
330 * @param aTransId: transaction Id |
|
331 * @param aPipeHandle: pipe handle |
|
332 */ |
|
333 void PnsPepDisconnectResp( |
|
334 const TUint8 aTransId, |
|
335 const TUint8 aPipeHandle ); |
|
336 |
|
337 /** |
|
338 * PnsPepReset response. |
|
339 * @param aTransId: transaction Id |
|
340 * @param aPipeHandle: pipe handle |
|
341 */ |
|
342 void PnsPepResetResp( |
|
343 const TUint8 aTransId, |
|
344 const TUint8 aPipeHandle ); |
|
345 |
|
346 /** |
|
347 * PnsPepEnable response. |
|
348 * @param aTransId: transaction Id |
|
349 * @param aPipeHandle: pipe handle |
|
350 */ |
|
351 void PnsPepEnableResp( |
|
352 const TUint8 aTransId, |
|
353 const TUint8 aPipeHandle ); |
|
354 #endif // DUMMY_NIF_PEP_FOR_PACKET_DATA_TESTING_DOS |
|
355 |
|
356 private: // Functions from base classes |
|
357 // None |
|
358 |
|
359 protected: // Data |
|
360 // None |
|
361 |
|
362 private: // Data |
|
363 |
|
364 // A pointer to the context messhandler. |
|
365 CMmPacketContextMessHandler* iContextMessHandler; |
|
366 |
|
367 // Pointer to contextlist |
|
368 CMmPacketContextMesshandlerList* iContextList; |
|
369 |
|
370 // A pointer to the PhonetSender. |
|
371 CMmPhoNetSender* iPhoNetSender; |
|
372 |
|
373 // Pipe Operation Array contains TPipeOperation elements. |
|
374 TPipeOperationInfo iPipeOperationArray[KMmMaxNumberOfPipeHandles]; |
|
375 |
|
376 // Device Id of second PEP. |
|
377 TUint8 iSecondPepDeviceId; |
|
378 |
|
379 // Object Id of second PEP. |
|
380 TUint8 iSecondPepObjectId; |
|
381 |
|
382 public: // Friend classes |
|
383 // None |
|
384 |
|
385 protected: // Friend classes |
|
386 // None |
|
387 |
|
388 private: // Friend classes |
|
389 // None |
|
390 |
|
391 }; |
|
392 |
|
393 #endif // CMMPIPECONTROL_H |
|
394 |
|
395 // End of File |