author | mikaruus <mika.a.ruuskanen@nokia.com> |
Thu, 14 Jan 2010 10:44:58 +0200 | |
changeset 5 | 8ccc39f9d787 |
parent 0 | 63b37f68c1ce |
child 7 | fa67e03b87df |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 2007-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 |
* |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
14 |
* Description: |
0 | 15 |
* |
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include "cmmnetmesshandler.h" |
|
22 |
#include "cmmnetoperatornamehandler.h" |
|
23 |
#include "toperatornames.h" |
|
24 |
#include "cmmphonetsender.h" |
|
25 |
#include "cmmstaticutility.h" |
|
26 |
#include "cmmmessagerouter.h" |
|
27 |
#include "cmmpacketmesshandlercontextlist.h" |
|
28 |
#include "cmmpacketservicemesshandler.h" |
|
29 |
#include "tsylogger.h" // Logging |
|
30 |
#include "cmmuiccmesshandler.h" |
|
31 |
||
32 |
#include <ctsy/serviceapi/mmgsmwcdmautils.h> // For mapping utilities |
|
33 |
#include <ctsy/pluginapi/cmmdatapackage.h> |
|
34 |
#include <ctsy/serviceapi/mmtsy_defaults.h> // KMmTsyNITZCaps needed |
|
35 |
#include <etelmm.h> |
|
36 |
#include <ctsy/serviceapi/gsmerror.h> |
|
37 |
#include <net_modemisi.h> |
|
38 |
#include <infoisi.h> |
|
39 |
#include <tisi.h> |
|
40 |
#include <gpdsisi.h> |
|
41 |
//#include <permisi.h> To be done in CPS |
|
42 |
#include <uiccisi.h> |
|
43 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
44 |
#include "OstTraceDefinitions.h" |
0 | 45 |
#ifdef OST_TRACE_COMPILER_IN_USE |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
46 |
#include "cmmnetmesshandlerTraces.h" |
0 | 47 |
#endif |
48 |
||
49 |
// EXTERNAL DATA STRUCTURES |
|
50 |
//None |
|
51 |
||
52 |
// EXTERNAL FUNCTION PROTOTYPES |
|
53 |
//None |
|
54 |
||
55 |
// CONSTANTS |
|
56 |
// Hard-coded transaction id for ISA messages |
|
57 |
const TUint8 KNetTransId = 4; |
|
58 |
// const TUint8 KNbImsSubBlocks = 3; Compiler warning removal |
|
59 |
||
60 |
// Default value for registered in another network in GSM |
|
61 |
const TUint8 KDefaultRegInAnotherNwGsm = 0; |
|
62 |
||
63 |
// Operator code for (MCC MNC): 262 07 |
|
64 |
_LIT8( KO2NetworkId, "\x62\xF2\x70" ); |
|
65 |
// HPLMN read from SIM (MCC MNC): 262 08 |
|
66 |
_LIT8( KO2Hplmn, "\x62\xF2\x80" ); |
|
67 |
||
68 |
#ifdef OST_TRACE_COMPILER_IN_USE |
|
69 |
const TUint8 KBufferForOSTTracing = 100; |
|
70 |
#endif |
|
71 |
#ifdef TF_LOGGING_ENABLED |
|
72 |
const TUint8 KBufferForTFLogging = 130; |
|
73 |
#endif |
|
74 |
||
75 |
// MACROS |
|
76 |
//None |
|
77 |
||
78 |
// LOCAL CONSTANTS AND MACROS |
|
79 |
//None |
|
80 |
||
81 |
// MODULE DATA STRUCTURES |
|
82 |
// limit values for mapping RSSI percentage to number of signal strength bars |
|
83 |
const TUint8 netRssiLimitsTable[KMaxSignalStrengthBars] = |
|
84 |
{ |
|
85 |
1, 16, 33, 49, 66, 83, 99 |
|
86 |
}; |
|
87 |
||
88 |
// LOCAL FUNCTION PROTOTYPES |
|
89 |
//None |
|
90 |
||
91 |
// FORWARD DECLARATIONS |
|
92 |
//None |
|
93 |
||
94 |
// ============================= LOCAL FUNCTIONS =============================== |
|
95 |
||
96 |
// ----------------------------------------------------------------------------- |
|
97 |
// TFLOG_PRINT_ISIMESSAGE |
|
98 |
// local function for printing queued Net message contents |
|
99 |
// ----------------------------------------------------------------------------- |
|
100 |
// |
|
101 |
#if defined (TF_LOGGING_ENABLED) || defined (OST_TRACE_COMPILER_IN_USE) |
|
102 |
static void TFLOG_PRINT_ISIMESSAGE( const TDesC8& aBuf ) |
|
103 |
{ |
|
104 |
_LIT( KTraceSpace, " " ); |
|
105 |
||
106 |
// Get the length of the ISI message. |
|
107 |
TInt length = aBuf.Length(); |
|
108 |
||
109 |
#ifdef TF_LOGGING_ENABLED |
|
110 |
TBuf<KBufferForTFLogging> msg; |
|
111 |
_LIT( KTraceQueuedMessage, "TSY:Queued NET message: [ " ); |
|
112 |
_LIT( KTraceBracketClose, "]" ); |
|
113 |
||
114 |
msg.Append( KTraceQueuedMessage ); |
|
115 |
||
116 |
if ( 250 < length ) |
|
117 |
{ |
|
118 |
// Print only 250 first bytes. |
|
119 |
length = 250; |
|
120 |
} |
|
121 |
||
122 |
for ( TInt i = 0; i < length; i++ ) |
|
123 |
{ |
|
124 |
msg.AppendNumFixedWidthUC( aBuf[i], EHex, 2 ); |
|
125 |
msg.Append( KTraceSpace ); |
|
126 |
if ( KLogSizeOfBuffer-10 < msg.Length() ) |
|
127 |
{ |
|
128 |
if ( i == ( length - 1 ) ) |
|
129 |
{ |
|
130 |
// Last number, append "]" character. |
|
131 |
msg.Append( KTraceBracketClose ); |
|
132 |
} |
|
133 |
||
134 |
TFLOGTEXT( msg ); |
|
135 |
msg.SetLength( 0 ); |
|
136 |
} |
|
137 |
} |
|
138 |
||
139 |
if ( 0 < msg.Length() ) |
|
140 |
{ |
|
141 |
// Buffer contains data. Print also last line. |
|
142 |
msg.Append( KTraceBracketClose ); |
|
143 |
TFLOGTEXT( msg ); |
|
144 |
} |
|
145 |
#endif // TF_LOGGING_ENABLED |
|
146 |
||
147 |
// Ost tracing. |
|
148 |
#ifdef OST_TRACE_COMPILER_IN_USE |
|
149 |
TBuf8<KBufferForOSTTracing> trace_msg; |
|
150 |
TUint8 counter = 1; |
|
151 |
TBool firstTime = ETrue; |
|
152 |
||
153 |
for ( TInt i = 0; i < length; i++ ) |
|
154 |
{ |
|
155 |
trace_msg.AppendNumFixedWidthUC( aBuf[i], EHex, 2 ); |
|
156 |
trace_msg.Append( KTraceSpace ); |
|
157 |
||
158 |
if ( ( counter > 24 ) || // 25 bytes / line. |
|
159 |
( ( i + 1 ) == length ) ) // All bytes collected. |
|
160 |
{ |
|
161 |
if ( ( firstTime ) && |
|
162 |
( ( i + 1 ) == length ) ) // All bytes collected and traced. |
|
163 |
{ |
|
164 |
firstTime = EFalse; |
|
165 |
OstTraceExt1( TRACE_NORMAL, DUP6__TFLOG_PRINT_ISIMESSAGE, "TSY:Queued NET message: [ %s]", trace_msg ); |
|
166 |
trace_msg.SetLength( 0 ); |
|
167 |
} |
|
168 |
else if ( firstTime ) // 1st line of the trace. |
|
169 |
{ |
|
170 |
firstTime = EFalse; |
|
171 |
OstTraceExt1( TRACE_NORMAL, DUP7__TFLOG_PRINT_ISIMESSAGE, "TSY:Queued NET message: [ %s", trace_msg ); |
|
172 |
trace_msg.SetLength( 0 ); |
|
173 |
} |
|
174 |
else if ( ( i + 1 ) == length ) // The last line. |
|
175 |
{ |
|
176 |
OstTraceExt1( TRACE_NORMAL, DUP8__TFLOG_PRINT_ISIMESSAGE, "TSY:Queued NET message: %s]", trace_msg ); |
|
177 |
trace_msg.SetLength( 0 ); |
|
178 |
} |
|
179 |
else // just print bytes. |
|
180 |
{ |
|
181 |
OstTraceExt1( TRACE_NORMAL, DUP9__TFLOG_PRINT_ISIMESSAGE, "TSY:Queued NET message: %s", trace_msg ); |
|
182 |
trace_msg.SetLength( 0 ); |
|
183 |
} |
|
184 |
counter = 0; |
|
185 |
} |
|
186 |
counter++; |
|
187 |
} |
|
188 |
#endif // OST_TRACE_COMPILER_IN_USE |
|
189 |
} |
|
190 |
||
191 |
#else // TF_LOGGING_ENABLED || OST_TRACE_COMPILER_IN_USE |
|
192 |
||
193 |
#define TFLOG_PRINT_ISIMESSAGE(x) |
|
194 |
||
195 |
#endif // TF_LOGGING_ENABLED || OST_TRACE_COMPILER_IN_USE |
|
196 |
||
197 |
// ----------------------------------------------------------------------------- |
|
198 |
// CalculateNetworkInformationSbStartOffset |
|
199 |
// Calculates starting subblocks offset for NET_MODEM_REG_STATUS_IND, |
|
200 |
// NET_SET_RESP and NET_MODEM_REG_STATUS_GET_RESP |
|
201 |
// @param aIsiMessage ISI-message to process |
|
202 |
// @param aSbStartOffset subblock start offset to initialize |
|
203 |
// @return TInt KErrNone or KErrNotSupported |
|
204 |
// ----------------------------------------------------------------------------- |
|
205 |
// |
|
206 |
static TInt CalculateNetworkInformationSbStartOffset( |
|
207 |
const TIsiReceiveC& aIsiMessage, |
|
208 |
TUint& aSbStartOffset |
|
209 |
) |
|
210 |
{ |
|
211 |
TInt ret( KErrNone ); |
|
212 |
||
213 |
TFLOGSTRING("TSY: CalculateNetworkInformationSbStartOffset"); |
|
214 |
OstTrace0( TRACE_NORMAL, _CALCULATENETWORKINFORMATIONSBSTARTOFFSET, "CalculateNetworkInformationSbStartOffset" ); |
|
215 |
||
216 |
TUint8 messageId = aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ); |
|
217 |
if ( NET_MODEM_REG_STATUS_IND == messageId ) |
|
218 |
{ |
|
219 |
TFLOGSTRING("TSY: CalculateNetworkInformationSbStartOffset; NET_REG_STATUS_IND"); |
|
220 |
OstTrace0( TRACE_NORMAL, DUP1__CALCULATENETWORKINFORMATIONSBSTARTOFFSET, "CalculateNetworkInformationSbStartOffset; NET_REG_STATUS_IND" ); |
|
221 |
aSbStartOffset = SIZE_NET_MODEM_REG_STATUS_IND; |
|
222 |
} |
|
223 |
else if ( NET_MODEM_REG_STATUS_GET_RESP == messageId ) |
|
224 |
{ |
|
225 |
TFLOGSTRING("TSY: CalculateNetworkInformationSbStartOffset; NET_REG_STATUS_GET_RESP"); |
|
226 |
OstTrace0( TRACE_NORMAL, DUP2__CALCULATENETWORKINFORMATIONSBSTARTOFFSET, "CalculateNetworkInformationSbStartOffset; NET_REG_STATUS_GET_RESP" ); |
|
227 |
aSbStartOffset = SIZE_NET_MODEM_REG_STATUS_GET_RESP; |
|
228 |
} |
|
229 |
else if ( NET_SET_RESP == messageId ) |
|
230 |
{ |
|
231 |
TFLOGSTRING("TSY: CalculateNetworkInformationSbStartOffset; NET_SET_RESP"); |
|
232 |
OstTrace0( TRACE_NORMAL, DUP3__CALCULATENETWORKINFORMATIONSBSTARTOFFSET, "CalculateNetworkInformationSbStartOffset; NET_SET_RESP" ); |
|
233 |
aSbStartOffset = SIZE_NET_SET_RESP; |
|
234 |
} |
|
235 |
else |
|
236 |
{ |
|
237 |
TFLOGSTRING2("TSY: CalculateNetworkInformationSbStartOffset;unknown messageId=%x", messageId); |
|
238 |
OstTrace1( TRACE_NORMAL, DUP4__CALCULATENETWORKINFORMATIONSBSTARTOFFSET, "CalculateNetworkInformationSbStartOffset;unknown messageId=%x", messageId ); |
|
239 |
ret = KErrNotSupported; |
|
240 |
} |
|
241 |
||
242 |
return ret; |
|
243 |
} |
|
244 |
||
245 |
// ============================ MEMBER FUNCTIONS =============================== |
|
246 |
||
247 |
// ----------------------------------------------------------------------------- |
|
248 |
// CMmNetMessHandler::CMmNetMessHandler |
|
249 |
// C++ default constructor |
|
250 |
// ----------------------------------------------------------------------------- |
|
251 |
// |
|
252 |
CMmNetMessHandler::CMmNetMessHandler() |
|
253 |
{ |
|
254 |
TFLOGSTRING("TSY: CMmNetMessHandler::CMmNetMessHandler() - Start"); |
|
255 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_CMMNETMESSHANDLER, "CMmNetMessHandler::CMmNetMessHandler" ); |
|
256 |
} |
|
257 |
||
258 |
// ----------------------------------------------------------------------------- |
|
259 |
// CMmNetMessHandler::NewL |
|
260 |
// Two-phased constructor. |
|
261 |
// ----------------------------------------------------------------------------- |
|
262 |
// |
|
263 |
CMmNetMessHandler* CMmNetMessHandler::NewL |
|
264 |
( |
|
265 |
CMmPhoNetSender* aPhoNetSender, // Pointer to the phonet sender |
|
266 |
CMmPhoNetReceiver* aPhoNetReceiver, // Pointer to the phonet receiver |
|
267 |
CMmMessageRouter* aMessageRouter, // Pointer to the message router |
|
268 |
CMmUiccMessHandler* aUiccMessHandler |
|
269 |
) |
|
270 |
{ |
|
271 |
TFLOGSTRING("TSY: CMmNetMessHandler::NewL"); |
|
272 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NEWL, "CMmNetMessHandler::NewL" ); |
|
273 |
||
274 |
CMmNetMessHandler* netMessHandler = new ( ELeave ) CMmNetMessHandler(); |
|
275 |
||
276 |
CleanupStack::PushL( netMessHandler ); |
|
277 |
||
278 |
netMessHandler->iPhoNetSender = aPhoNetSender; |
|
279 |
netMessHandler->iMessageRouter = aMessageRouter; |
|
280 |
netMessHandler->iMmUiccMessHandler = aUiccMessHandler; |
|
281 |
netMessHandler->ConstructL(); |
|
282 |
||
283 |
// NETWORK |
|
284 |
aPhoNetReceiver->RegisterL( |
|
285 |
netMessHandler, |
|
286 |
PN_MODEM_NETWORK ); |
|
287 |
// GPDS |
|
288 |
aPhoNetReceiver->RegisterL( |
|
289 |
netMessHandler, |
|
290 |
PN_GPDS, |
|
291 |
GPDS_RADIO_ACTIVITY_IND ); |
|
292 |
aPhoNetReceiver->RegisterL( |
|
293 |
netMessHandler, |
|
294 |
PN_GPDS, |
|
295 |
GPDS_CONTEXT_DEACTIVATE_IND ); |
|
296 |
// INFO |
|
297 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
298 |
aPhoNetReceiver->RegisterL( |
|
299 |
netMessHandler, |
|
300 |
PN_INFO, |
|
301 |
INFO_PP_READ_RESP ); |
|
302 |
#else /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
303 |
/* To be replaced with INFO_PP_DATA_READ_RESP |
|
304 |
aPhoNetReceiver->RegisterL( |
|
305 |
netMessHandler, |
|
306 |
PN_MODEM_INFO, |
|
307 |
INFO_PP_READ_RESP ); |
|
308 |
*/ |
|
309 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
310 |
||
311 |
// PERMANENT_DATA |
|
312 |
/*aPhoNetReceiver->RegisterL( |
|
313 |
netMessHandler, |
|
314 |
PN_PERMANENT_DATA, |
|
315 |
PERM_PM_RECORD_WRITE_RESP ); |
|
316 |
aPhoNetReceiver->RegisterL( |
|
317 |
netMessHandler, |
|
318 |
PN_PERMANENT_DATA, |
|
319 |
PERM_PM_RECORD_READ_RESP ); To be done in CPS */ |
|
320 |
||
321 |
CleanupStack::Pop( netMessHandler ); |
|
322 |
||
323 |
return netMessHandler; |
|
324 |
} |
|
325 |
||
326 |
// ----------------------------------------------------------------------------- |
|
327 |
// CMmNetMessHandler::ConstructL |
|
328 |
// Symbian 2nd phase constructor. Initialises internal attributes. |
|
329 |
// ----------------------------------------------------------------------------- |
|
330 |
// |
|
331 |
void CMmNetMessHandler::ConstructL() |
|
332 |
{ |
|
333 |
TFLOGSTRING("TSY: CMmNetMessHandler::ConstructL()"); |
|
334 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_CONSTRUCTL, "CMmNetMessHandler::ConstructL" ); |
|
335 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
336 |
iNetOperatorNameHandler = CMmNetOperatorNameHandler::NewL( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
337 |
this, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
338 |
iMmUiccMessHandler ); |
0 | 339 |
|
340 |
// Delay timer for completion of Packet transfer state |
|
341 |
iDelayTimer = CDelayTimer::NewL( this ); |
|
342 |
||
343 |
// Selection method is at this point unknown |
|
344 |
iSelectionMethod = NET_SELECT_MODE_UNKNOWN; |
|
345 |
||
346 |
// No cancel request has been issued yet |
|
347 |
iSelectNetworkCancelIssued = EFalse; |
|
348 |
iSearchNetworkCancelIssued = EFalse; |
|
349 |
||
350 |
// Initialize to EFalse |
|
351 |
iImsPinVerifyRequired = EFalse; |
|
352 |
iIsimUsed = EFalse; |
|
353 |
iMNClength = 0; |
|
354 |
||
355 |
iNetworkMode = RMobilePhone::ENetworkModeUnknown; |
|
356 |
iNetworkAccess = RMobilePhone::ENetworkAccessUnknown; |
|
357 |
iCell_DCH = EFalse; |
|
358 |
iPacketTransfer = EFalse; |
|
359 |
||
360 |
iNetMessageHandlingOngoing = EFalse; |
|
361 |
||
362 |
// Request network signal strength (RSSI) |
|
363 |
NetRssiGetReq(); |
|
364 |
} |
|
365 |
||
366 |
// ----------------------------------------------------------------------------- |
|
367 |
// CMmNetMessHandler::~CMmNetMessHandler |
|
368 |
// Destructor |
|
369 |
// ----------------------------------------------------------------------------- |
|
370 |
// |
|
371 |
CMmNetMessHandler::~CMmNetMessHandler() |
|
372 |
{ |
|
373 |
TFLOGSTRING("TSY: CMmNetMessHandler::~CMmNetMessHandler() - End"); |
|
374 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_CMMNETMESSHANDLER, "CMmNetMessHandler::~CMmNetMessHandler" ); |
|
375 |
||
376 |
delete iNetOperatorNameHandler; |
|
377 |
||
378 |
for ( TInt i = 0; i < iNetMessageQueue.Count(); i++ ) |
|
379 |
{ |
|
380 |
delete iNetMessageQueue[i]; |
|
381 |
} |
|
382 |
||
383 |
iNetMessageQueue.Close(); |
|
384 |
||
385 |
// Delete delay timer |
|
386 |
if ( iDelayTimer ) |
|
387 |
{ |
|
388 |
delete iDelayTimer; |
|
389 |
} |
|
390 |
} |
|
391 |
||
392 |
// ----------------------------------------------------------------------------- |
|
393 |
// CMmNetMessHandler::ProcessUiccMsg |
|
394 |
// Handles data received from UICC server |
|
395 |
// ----------------------------------------------------------------------------- |
|
396 |
// |
|
397 |
TInt CMmNetMessHandler::ProcessUiccMsg( |
|
398 |
TInt aTraId, |
|
399 |
TInt aStatus, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
400 |
TUint8 /*aDetails*/, |
0 | 401 |
const TDesC8& aFileData ) |
402 |
{ |
|
403 |
TFLOGSTRING3("TSY: CMmNetMessHandler::ProcessUiccMsg, transaction ID: %d, status: %d", aTraId, aStatus ); |
|
404 |
OstTraceExt2( TRACE_NORMAL, CMMNETMESSHANDLER_PROCESSUICCMSG, "CMmNetMessHandler::ProcessUiccMsg;aTraId=%d;aStatus=%d", aTraId, aStatus ); |
|
405 |
||
406 |
TInt ret( KErrNone ); |
|
407 |
||
408 |
switch( aTraId ) |
|
409 |
{ |
|
410 |
case ETrIdReadCipheringIndicatorStatus: |
|
411 |
{ |
|
412 |
UiccReadCiResp( aStatus, aFileData ); |
|
413 |
break; |
|
414 |
} |
|
415 |
case ETrIdReadCsDataEhplmn: |
|
416 |
{ |
|
417 |
UiccCsReadEhpmlnResp( aStatus, aFileData ); |
|
418 |
break; |
|
419 |
} |
|
420 |
case ETrIdReadCsDataHplmn: |
|
421 |
{ |
|
422 |
UiccCsReadHpmlnResp( aStatus, aFileData ); |
|
423 |
break; |
|
424 |
} |
|
425 |
default: |
|
426 |
{ |
|
427 |
TFLOGSTRING("TSY: CMmNetMessHandler::ProcessUiccMsg - unknown transaction ID" ); |
|
428 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_PROCESSUICCMSG, "CMmNetMessHandler::ProcessUiccMsg - - unknown transaction ID" ); |
|
429 |
break; |
|
430 |
} |
|
431 |
} |
|
432 |
return ret; |
|
433 |
} |
|
434 |
||
435 |
// ----------------------------------------------------------------------------- |
|
436 |
// CMmNetMessHandler::ExtFuncL |
|
437 |
// Dispatches Etel requests to DOS level handlers |
|
438 |
// ----------------------------------------------------------------------------- |
|
439 |
// |
|
440 |
TInt CMmNetMessHandler::ExtFuncL |
|
441 |
( |
|
442 |
TInt aIpc, // Ipc number |
|
443 |
const CMmDataPackage* aDataPackage // Packed data |
|
444 |
) |
|
445 |
{ |
|
446 |
TFLOGSTRING2("TSY: CMmNetMessHandler::ExtFuncL - Ipc: %d", aIpc); |
|
447 |
OstTrace1( TRACE_NORMAL, CMMNETMESSHANDLER_EXTFUNCL, "CMmNetMessHandler::ExtFuncL;aIpc=%d", aIpc ); |
|
448 |
||
449 |
//*************************************************************// |
|
450 |
// NOTE: |
|
451 |
// |
|
452 |
// LICENSEE SPECIFIC MESSAGE HANDLER IMPLEMENTATION STARTS HERE |
|
453 |
// |
|
454 |
//*************************************************************// |
|
455 |
||
456 |
TInt ret( KErrNone ); |
|
457 |
||
458 |
TUint8 transId( KNetTransId ); |
|
459 |
||
460 |
switch ( aIpc ) |
|
461 |
{ |
|
462 |
case EMobilePhoneSetNetworkSelectionSetting: |
|
463 |
{ |
|
464 |
// Unpack the parameters for this case |
|
465 |
RMobilePhone::TMobilePhoneNetworkSelectionV1* networkSetting( NULL ); |
|
466 |
aDataPackage->UnPackData( &networkSetting ); |
|
467 |
||
468 |
// Forward the request to specific method |
|
469 |
NetNetworkSelectModeSetReq( transId, *networkSetting ); |
|
470 |
break; |
|
471 |
} |
|
472 |
case EMobilePhoneSelectNetwork: |
|
473 |
{ |
|
474 |
// Unpack parameters |
|
475 |
TBool* isManual( NULL ); |
|
476 |
RMobilePhone::TMobilePhoneNetworkManualSelection* manualSelection( NULL ); |
|
477 |
aDataPackage->UnPackData( &isManual, &manualSelection ); |
|
478 |
||
479 |
// Forward the request to the specific method |
|
480 |
NetSetReq( transId, |
|
481 |
*isManual, |
|
482 |
manualSelection->iNetwork.Left( 4 ), // Operator code |
|
483 |
manualSelection->iCountry.Left( 3 ) ); // Country code |
|
484 |
break; |
|
485 |
} |
|
486 |
case EMobilePhoneSelectNetworkCancel: |
|
487 |
{ |
|
488 |
NetSetCancelReq( transId ); |
|
489 |
break; |
|
490 |
} |
|
491 |
case EMobilePhoneGetDetectedNetworksV2Phase1: |
|
492 |
{ |
|
493 |
NetModemAvailableGetReq( transId ); |
|
494 |
break; |
|
495 |
} |
|
496 |
case EMobilePhoneGetDetectedNetworksCancel: |
|
497 |
{ |
|
498 |
NetAvailableCancelReq( transId ); |
|
499 |
break; |
|
500 |
} |
|
501 |
case EMobilePhoneGetNetworkRegistrationStatus: |
|
502 |
{ |
|
503 |
// We need to get the network mode before we get the registration |
|
504 |
// status as this second message doesn't inform in which mode |
|
505 |
// the network is working. |
|
506 |
// The net server only serves one request at a time, so there won't |
|
507 |
// be any race condition and mode will be available always in first |
|
508 |
// place. |
|
509 |
NetRatReq( transId ); |
|
510 |
NetModemRegStatusGetReq( transId ); |
|
511 |
break; |
|
512 |
} |
|
513 |
case EMobilePhoneGetHomeNetwork: |
|
514 |
{ |
|
515 |
UiccCsReadReq(); |
|
516 |
break; |
|
517 |
} |
|
518 |
case EMobilePhoneGetCipheringIndicatorStatus: |
|
519 |
{ |
|
520 |
UiccReadCiReq(); |
|
521 |
break; |
|
522 |
} |
|
523 |
default: |
|
524 |
{ |
|
525 |
TFLOGSTRING2("TSY: CMmNetMessHandler::ExtFuncL - Unknown IPC: %d", aIpc); |
|
526 |
OstTrace1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_EXTFUNCL, "CMmNetMessHandler::ExtFuncL;Unknown IPC=%d", aIpc ); |
|
527 |
ret = KErrNotSupported; |
|
528 |
break; |
|
529 |
} |
|
530 |
} |
|
531 |
return ret; |
|
532 |
} |
|
533 |
||
534 |
// ----------------------------------------------------------------------------- |
|
535 |
// CMmNetMessHandler::ReceiveMessageL |
|
536 |
// Called when an ISI message has been received. |
|
537 |
// ----------------------------------------------------------------------------- |
|
538 |
// |
|
539 |
void CMmNetMessHandler::ReceiveMessageL |
|
540 |
( |
|
541 |
const TIsiReceiveC& aIsiMessage // ISI-message received |
|
542 |
) |
|
543 |
{ |
|
544 |
TFLOGSTRING("TSY: CMmNetMessHandler::ReceiveMessageL"); |
|
545 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_RECEIVEMESSAGEL, "CMmNetMessHandler::ReceiveMessageL" ); |
|
546 |
||
547 |
// Resource and message id |
|
548 |
TInt resource( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) ); |
|
549 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
550 |
||
551 |
TFLOGSTRING3("TSY: CMmNetMessHandler::ReceiveMessageL - MessageId:%d. Resource: %d", messageId, resource); |
|
552 |
OstTraceExt2( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_RECEIVEMESSAGEL, "CMmNetMessHandler::ReceiveMessageL;messageId=%d;resource=%d", messageId, resource ); |
|
553 |
||
554 |
// Transaction id. |
|
555 |
TUint8 transactId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ); |
|
556 |
||
557 |
// NET functionality is implemented in NET server and SIM Server |
|
558 |
switch ( resource ) |
|
559 |
{ |
|
560 |
case PN_MODEM_NETWORK: |
|
561 |
{ |
|
562 |
switch( messageId ) |
|
563 |
{ |
|
564 |
case NET_MODEM_REG_STATUS_IND: |
|
565 |
case NET_MODEM_REG_STATUS_GET_RESP: |
|
566 |
case NET_SET_RESP: |
|
567 |
{ |
|
568 |
QueueNetModemRegStatusMessagesL( aIsiMessage ); |
|
569 |
break; |
|
570 |
} |
|
571 |
case NET_MODEM_AVAILABLE_GET_RESP: |
|
572 |
{ |
|
573 |
NetModemAvailableGetRespL( aIsiMessage ); |
|
574 |
break; |
|
575 |
} |
|
576 |
case NET_AVAILABLE_CANCEL_RESP: |
|
577 |
{ |
|
578 |
NetAvailableCancelResp( aIsiMessage ); |
|
579 |
break; |
|
580 |
} |
|
581 |
case NET_SET_CANCEL_RESP: |
|
582 |
{ |
|
583 |
NetSetCancelResp( aIsiMessage ); |
|
584 |
break; |
|
585 |
} |
|
586 |
case NET_RAT_IND: |
|
587 |
{ |
|
588 |
NetRatInd( aIsiMessage ); |
|
589 |
break; |
|
590 |
} |
|
591 |
case NET_RAT_RESP: |
|
592 |
{ |
|
593 |
NetRatResp( aIsiMessage ); |
|
594 |
break; |
|
595 |
} |
|
596 |
case NET_NETWORK_SELECT_MODE_SET_RESP: |
|
597 |
{ |
|
598 |
NetNetworkSelectModeSetResp( aIsiMessage ); |
|
599 |
break; |
|
600 |
} |
|
601 |
case NET_RSSI_GET_RESP: |
|
602 |
{ |
|
603 |
NetRssiGetResp( aIsiMessage ); |
|
604 |
break; |
|
605 |
} |
|
606 |
case NET_RSSI_IND: |
|
607 |
{ |
|
608 |
NetRssiInd( aIsiMessage ); |
|
609 |
break; |
|
610 |
} |
|
611 |
case NET_TIME_IND: |
|
612 |
{ |
|
613 |
NetTimeInd( aIsiMessage ); |
|
614 |
break; |
|
615 |
} |
|
616 |
case NET_CIPHERING_IND: |
|
617 |
{ |
|
618 |
NetCipheringInd( aIsiMessage ); |
|
619 |
break; |
|
620 |
} |
|
621 |
case NET_RADIO_INFO_IND: |
|
622 |
{ |
|
623 |
NetRadioInfoInd( aIsiMessage ); |
|
624 |
break; |
|
625 |
} |
|
626 |
case NET_NITZ_NAME_IND: |
|
627 |
{ |
|
628 |
iNetOperatorNameHandler->NetNitzNameInd( |
|
629 |
aIsiMessage ); |
|
630 |
break; |
|
631 |
} |
|
632 |
default: |
|
633 |
{ |
|
634 |
// No appropriate handler methods for ISI-message found. |
|
635 |
TFLOGSTRING("TSY: CMmNetMessHandler::ReceiveMessageL - no handler for the NETWORK message id"); |
|
636 |
OstTrace0( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_RECEIVEMESSAGEL, "CMmNetMessHandler::ReceiveMessageL - no handler for the NETWORK message id" ); |
|
637 |
// Server not known |
|
638 |
break; |
|
639 |
} |
|
640 |
} // End switch ( messageId ) |
|
641 |
break; // End case PN_MODEM_NETWORK |
|
642 |
} |
|
643 |
case PN_GPDS: |
|
644 |
{ |
|
645 |
if ( GPDS_RADIO_ACTIVITY_IND == messageId ) |
|
646 |
{ |
|
647 |
GpdsRadioActivityInd( aIsiMessage ); |
|
648 |
} |
|
649 |
else if ( GPDS_CONTEXT_DEACTIVATE_IND == messageId ) |
|
650 |
{ |
|
651 |
GpdsContextDeactivateInd( aIsiMessage ); |
|
652 |
} |
|
653 |
// No else |
|
654 |
break; |
|
655 |
} |
|
656 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
657 |
case PN_INFO: |
|
658 |
#else /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
659 |
case PN_MODEM_INFO: |
|
660 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
661 |
{ |
|
662 |
switch ( messageId ) |
|
663 |
{ |
|
664 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
665 |
// To be replaced with INFO_PP_DATA_READ_RESP |
|
666 |
case INFO_PP_READ_RESP: |
|
667 |
{ |
|
668 |
if ( KNetTransId == transactId ) |
|
669 |
{ |
|
670 |
iNetOperatorNameHandler->InfoPpReadResp( |
|
671 |
aIsiMessage ); |
|
672 |
} |
|
673 |
break; |
|
674 |
} |
|
675 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
676 |
default: |
|
677 |
{ |
|
678 |
// No appropriate handler methods for ISI-message found. |
|
679 |
TFLOGSTRING("TSY: CMmNetMessHandler::ReceiveMessageL - no handler for the INFO message id"); |
|
680 |
OstTrace0( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_RECEIVEMESSAGEL, "CMmNetMessHandler::ReceiveMessageL - no handler for the INFO message id" ); |
|
681 |
break; |
|
682 |
} |
|
683 |
} |
|
684 |
break; |
|
685 |
} |
|
686 |
/*case PN_PERMANENT_DATA: |
|
687 |
{ |
|
688 |
switch ( messageId ) |
|
689 |
{ |
|
690 |
case PERM_PM_RECORD_WRITE_RESP: |
|
691 |
{ |
|
692 |
if ( KNetTransId == transactId ) |
|
693 |
{ |
|
694 |
iNetOperatorNameHandler->PermPmRecordWriteResp( |
|
695 |
aIsiMessage ); |
|
696 |
} |
|
697 |
break; |
|
698 |
} |
|
699 |
case PERM_PM_RECORD_READ_RESP: |
|
700 |
{ |
|
701 |
if ( KNetTransId == transactId ) |
|
702 |
{ |
|
703 |
iNetOperatorNameHandler->PermPmRecordReadResp( |
|
704 |
aIsiMessage ); |
|
705 |
} |
|
706 |
break; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
707 |
} |
0 | 708 |
default: |
709 |
{ |
|
710 |
// No appropriate handler methods for ISI-message found. |
|
711 |
TFLOGSTRING("TSY: CMmNetMessHandler::ReceiveMessageL - no handler for the PERMANENT_DATA message id"); |
|
712 |
OstTrace0( TRACE_NORMAL, DUP5_CMMNETMESSHANDLER_RECEIVEMESSAGEL, "CMmNetMessHandler::ReceiveMessageL - no handler for the PERMANENT_DATA message id" ); |
|
713 |
break; |
|
714 |
} |
|
715 |
} |
|
716 |
break; |
|
717 |
} To be done in CPS */ |
|
718 |
default: |
|
719 |
{ |
|
720 |
TFLOGSTRING("TSY: CMmNetMessHandler::ReceiveMessageL - Switch resource case default"); |
|
721 |
OstTrace0( TRACE_NORMAL, DUP6_CMMNETMESSHANDLER_RECEIVEMESSAGEL, "CMmNetMessHandler::ReceiveMessageL - Switch resource case default" ); |
|
722 |
break; // Server not known |
|
723 |
} |
|
724 |
} // End switch ( resource ) |
|
725 |
} |
|
726 |
||
727 |
// ----------------------------------------------------------------------------- |
|
728 |
// CMmNetMessHandler::NetModemRegStatusInd |
|
729 |
// Breaks a NET_MODEM_REG_STATUS_IND ISI-message. |
|
730 |
// Completes NotifyCurrentNetworkChange, NotifyNetworkRegistrationStatusChange, |
|
731 |
// NotifyNetworkSelectionSettingChange notifications (if required information |
|
732 |
// is gathered) and EMobilePhoneSelectNetwork to SOS Tsy. |
|
733 |
// Handles also ECustomGetOperatorNameIPC and completes it. |
|
734 |
// ----------------------------------------------------------------------------- |
|
735 |
// |
|
736 |
void CMmNetMessHandler::NetModemRegStatusInd |
|
737 |
( |
|
738 |
const TIsiReceiveC& aIsiMessage |
|
739 |
) |
|
740 |
{ |
|
741 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemRegStatusInd"); |
|
742 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETMODEMREGSTATUSIND, "CMmNetMessHandler::NetModemRegStatusInd" ); |
|
743 |
||
744 |
// Assistant for packaging. |
|
745 |
CMmDataPackage dataPackage; |
|
746 |
||
747 |
RMobilePhone::TMobilePhoneNetworkInfoV5 networkInfo; |
|
748 |
RMobilePhone::TMobilePhoneLocationAreaV1 locationArea; |
|
749 |
||
750 |
// Buffer for Operator code, length is 3. |
|
751 |
TBuf8<KBCDLength> operatorCode; |
|
752 |
||
753 |
// Network type initialization. |
|
754 |
TUint8 networkType( NET_GSM_NO_PLMN_AVAIL ); |
|
755 |
||
756 |
// Camped in HPLMN value initialization. |
|
757 |
TBool campedInHplmn( EFalse ); |
|
758 |
||
759 |
TUint sbStartOffSet( 0 ); |
|
760 |
||
761 |
// Network mode received via NET_RAT_IND/NET_RAT_RESP. |
|
762 |
networkInfo.iMode = iNetworkMode; |
|
763 |
// look for subblock offset to get operator info from |
|
764 |
TInt returnValue( FindOperatorInfoSubBlock( |
|
765 |
aIsiMessage, |
|
766 |
sbStartOffSet ) ); |
|
767 |
||
768 |
// If the returnValue is KErrNone then. |
|
769 |
if ( KErrNone == returnValue ) |
|
770 |
{ |
|
771 |
// Get the Location Area Code. |
|
772 |
locationArea.iLocationAreaCode = aIsiMessage.Get16bit( |
|
773 |
sbStartOffSet + NET_MODEM_CURRENT_CELL_INFO_OFFSET_CURRENTLAC ); |
|
774 |
// Get the Cell ID. |
|
775 |
locationArea.iCellId = aIsiMessage.Get32bit( |
|
776 |
sbStartOffSet + |
|
777 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_CURRENTCELLID ); |
|
778 |
// Area information is known. |
|
779 |
locationArea.iAreaKnown = ETrue; |
|
780 |
// Set status to current. |
|
781 |
networkInfo.iStatus = RMobilePhone::ENetworkStatusCurrent; |
|
782 |
// Band info is cdma specific. |
|
783 |
networkInfo.iBandInfo = RMobilePhone::EBandUnknown; |
|
784 |
// Sid is cdma specific, set it to default value. |
|
785 |
networkInfo.iCdmaSID.Zero(); |
|
786 |
// Analog SID is cdma specific, set it to default value. |
|
787 |
networkInfo.iAnalogSID.Zero(); |
|
788 |
// Get the operator code. Size is 3 bytes. |
|
789 |
operatorCode = aIsiMessage.GetData( |
|
790 |
sbStartOffSet + NET_MODEM_CURRENT_CELL_INFO_OFFSET_OPERATORCODE, |
|
791 |
3 ); |
|
792 |
// Map the operator and country code to symbian values |
|
793 |
MapOperatorAndCountryCode( |
|
794 |
operatorCode, |
|
795 |
networkInfo.iNetworkId, |
|
796 |
networkInfo.iCountryCode ); |
|
797 |
||
798 |
// Access technology received via NET_RAT_IND/NET_RAT_RESP. |
|
799 |
networkInfo.iAccess = iNetworkAccess; |
|
800 |
||
801 |
// Network type. |
|
802 |
networkType = aIsiMessage.Get8bit( |
|
803 |
sbStartOffSet + |
|
804 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_NETWORKTYPE ); |
|
805 |
||
806 |
// Camped in HPLMN. |
|
807 |
campedInHplmn = aIsiMessage.Get8bit( |
|
808 |
sbStartOffSet + |
|
809 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_CAMPEDINHPLMN ); |
|
810 |
||
811 |
// HSDPA availability indicator. |
|
812 |
// If TRUE then the cell supports HSDPA. |
|
813 |
networkInfo.iHsdpaAvailableIndicator = aIsiMessage.Get8bit( |
|
814 |
sbStartOffSet + |
|
815 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_HSDPAAVAILABLEINCELL ); |
|
816 |
||
817 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetModemRegStatusInd, HSDPA Available Indicator = %d.", networkInfo.iHsdpaAvailableIndicator); |
|
818 |
OstTraceExt1( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_NETMODEMREGSTATUSIND, "CMmNetMessHandler::NetModemRegStatusInd, HSDPA Available Indicator=%hhu", networkInfo.iHsdpaAvailableIndicator ); |
|
819 |
||
820 |
// This is done for SUB 403-7200: NokiaTSY: HSUPA Cell Indicator for S60 (S60 3.2.2 / S_CPR8.1). |
|
821 |
// This can be removed when actual implementation for HSUPA Cell Indicator is done. |
|
822 |
// CASW_HSXPA_INDICATOR_SUPPORTED flag. |
|
823 |
#if defined ( CASW_HSXPA_INDICATOR_SUPPORTED ) || defined ( INTERNAL_TESTING_CASW_HSXPA_INDICATOR_SUPPORT ) |
|
824 |
||
825 |
TBool hsdpaAvailableIndicator( EFalse ); |
|
826 |
TBool hsupaAvailableIndicator( EFalse ); |
|
827 |
||
828 |
hsdpaAvailableIndicator = aIsiMessage.Get8bit( |
|
829 |
sbStartOffSet + |
|
830 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_HSDPAAVAILABLEINCELL ); |
|
831 |
||
832 |
hsupaAvailableIndicator = aIsiMessage.Get8bit( |
|
833 |
sbStartOffSet + |
|
834 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_HSUPAAVAILABLEINCELL ); |
|
835 |
||
836 |
if ( hsdpaAvailableIndicator || hsupaAvailableIndicator ) |
|
837 |
{ |
|
838 |
networkInfo.iHsdpaAvailableIndicator = ETrue; |
|
839 |
||
840 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetModemRegStatusInd, HSDPA Available Indicator (HSDPA or HSUPA available) = %d.", networkInfo.iHsdpaAvailableIndicator); |
|
841 |
OstTraceExt1( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_NETMODEMREGSTATUSIND, "CMmNetMessHandler::NetModemRegStatusInd, HSDPA Available Indicator (HSDPA or HSUPA available)=%hhu", networkInfo.iHsdpaAvailableIndicator ); |
|
842 |
} |
|
843 |
#endif // defined ( CASW_HSXPA_INDICATOR_SUPPORTED ) || defined ( INTERNAL_TESTING_CASW_HSXPA_INDICATOR_SUPPORT ) |
|
844 |
} |
|
845 |
||
846 |
sbStartOffSet = 0; |
|
847 |
||
848 |
TUint8 registrationStatus( 0 ); |
|
849 |
TInt retValue( ExtractNetworkRegistrationStatus( |
|
850 |
aIsiMessage, |
|
851 |
operatorCode, |
|
852 |
registrationStatus, |
|
853 |
sbStartOffSet ) ); |
|
854 |
||
855 |
if ( KErrNone == retValue ) |
|
856 |
{ |
|
857 |
RMobilePhone::TMobilePhoneRegistrationStatus regStatus; |
|
858 |
||
859 |
// Map the selection mode to symbian values. |
|
860 |
MapNWAndRegStatus( |
|
861 |
registrationStatus, |
|
862 |
regStatus, |
|
863 |
networkInfo.iStatus ); |
|
864 |
||
865 |
// Get network selection mode. Will be handled after CAUSE EXTENSION |
|
866 |
// handling. |
|
867 |
TUint8 networkSelectionMode( aIsiMessage.Get8bit( |
|
868 |
sbStartOffSet + |
|
869 |
NET_MODEM_REG_INFO_COMMON_OFFSET_NETWORKSELECTIONMODE ) ); |
|
870 |
||
871 |
sbStartOffSet = 0; |
|
872 |
// Check whether NET_MODEM_CAUSE_EXTENSION subblock exists and get |
|
873 |
// the GSM specific error code from there. |
|
874 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
875 |
ISI_HEADER_SIZE + SIZE_NET_MODEM_REG_STATUS_IND, |
|
876 |
NET_MODEM_CAUSE_EXTENSION, |
|
877 |
EIsiSubBlockTypeId8Len8, |
|
878 |
sbStartOffSet ) ) |
|
879 |
{ |
|
880 |
// Get the gsm specific error code. |
|
881 |
TUint8 successCode ( aIsiMessage.Get8bit( |
|
882 |
sbStartOffSet + |
|
883 |
NET_MODEM_CAUSE_EXTENSION_OFFSET_REJECTCODE ) ); |
|
884 |
||
885 |
// Map ISA error to Symbian values. |
|
886 |
retValue = CMmStaticUtility::CSCauseToEpocError( |
|
887 |
PN_MODEM_NETWORK, |
|
888 |
KTsyNetCauseGsm, |
|
889 |
successCode ); |
|
890 |
} |
|
891 |
||
892 |
// Pack the data for sending to the manager. |
|
893 |
dataPackage.PackData( ®Status, &networkInfo.iStatus ); |
|
894 |
// Inform the manager that the network selection mode has changed. |
|
895 |
iMessageRouter->Complete( |
|
896 |
EMobilePhoneNotifyNetworkRegistrationStatusChange, |
|
897 |
&dataPackage, |
|
898 |
retValue ); |
|
899 |
||
900 |
// Latest network selection mode saved and it will be used later, |
|
901 |
// when making NET_SET_REQuest. |
|
902 |
iSelectionMethod = networkSelectionMode; |
|
903 |
||
904 |
RMobilePhone::TMobilePhoneNetworkSelectionV1 newSelection; |
|
905 |
||
906 |
// Map the selection mode. |
|
907 |
MapNWSelectionMode( networkSelectionMode, newSelection ); |
|
908 |
||
909 |
// Pack the data for sending to the manager. |
|
910 |
dataPackage.PackData( &newSelection ); |
|
911 |
// Inform the manager that the network selection mode has changed. |
|
912 |
iMessageRouter->Complete( |
|
913 |
EMobilePhoneNotifyNetworkSelectionSettingChange, |
|
914 |
&dataPackage, |
|
915 |
retValue ); |
|
916 |
||
917 |
// Check registration status. If phone is registered some network |
|
918 |
// then get correct operator name to show. |
|
919 |
// |
|
920 |
// Otherwise complete EMobilePhoneNotifyCurrentNetworkChange without |
|
921 |
// operator names. |
|
922 |
if ( ( NET_REG_STATUS_HOME == registrationStatus ) |
|
923 |
|| ( NET_REG_STATUS_ROAM == registrationStatus ) ) |
|
924 |
{ |
|
925 |
// Get correct name to show. |
|
926 |
iNetOperatorNameHandler->GetOperatorName( |
|
927 |
campedInHplmn, |
|
928 |
networkType, |
|
929 |
operatorCode, |
|
930 |
locationArea, |
|
931 |
networkInfo ); |
|
932 |
} |
|
933 |
else |
|
934 |
{ |
|
935 |
// Phone is not registered to any network. |
|
936 |
// Complete EMobilePhoneNotifyCurrentNetworkChange without |
|
937 |
// operator names. |
|
938 |
CompleteMobilePhoneNotifyCurrentNetworkChange( |
|
939 |
locationArea, |
|
940 |
networkInfo ); |
|
941 |
} |
|
942 |
} |
|
943 |
else |
|
944 |
{ |
|
945 |
// No NET_MODEM_REG_INFO_COMMON subblock found, |
|
946 |
// handling of message ends. |
|
947 |
||
948 |
// Continue handling queued messages. |
|
949 |
ContinueHandlingNetModemRegStatusMessages(); |
|
950 |
} |
|
951 |
} |
|
952 |
||
953 |
// ----------------------------------------------------------------------------- |
|
954 |
// CMmNetMessHandler::NetModemRegStatusGetReq |
|
955 |
// Called by ExtFuncL to construct a NET_MODEM_REG_STATUS_GET_REQ ISI |
|
956 |
// message and send it to Phonet. |
|
957 |
// ----------------------------------------------------------------------------- |
|
958 |
// |
|
959 |
TInt CMmNetMessHandler::NetModemRegStatusGetReq |
|
960 |
( |
|
961 |
TUint8 aTransactionId // Transaction id |
|
962 |
) const |
|
963 |
{ |
|
964 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemRegStatusGetReq"); |
|
965 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETMODEMREGSTATUSGETREQ, "CMmNetMessHandler::NetModemRegStatusGetReq" ); |
|
966 |
||
967 |
// Data buffer length is 2 |
|
968 |
TBuf8<2> data; |
|
969 |
data.Append( aTransactionId ); |
|
970 |
data.Append( NET_MODEM_REG_STATUS_GET_REQ ); |
|
971 |
||
972 |
TIsiSend isimsg( iPhoNetSender->SendBufferDes() ); |
|
973 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_MODEM_NETWORK ); |
|
974 |
isimsg.CopyData( ISI_HEADER_SIZE, data ); |
|
975 |
||
976 |
return iPhoNetSender->Send( isimsg.Complete() ); |
|
977 |
} |
|
978 |
||
979 |
// ----------------------------------------------------------------------------- |
|
980 |
// CMmNetMessHandler::NetModemAvailableGetReq |
|
981 |
// Called by ExtFuncL to construct a NET_MODEM_AVAILABLE_GET_REQ ISI message |
|
982 |
// and send it to Phonet. |
|
983 |
// ----------------------------------------------------------------------------- |
|
984 |
// |
|
985 |
TInt CMmNetMessHandler::NetModemAvailableGetReq |
|
986 |
( |
|
987 |
TUint8 aTransactionId // Transaction id |
|
988 |
) const |
|
989 |
{ |
|
990 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemAvailableGetReq"); |
|
991 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETMODEMAVAILABLEGETREQ, "CMmNetMessHandler::NetModemAvailableGetReq" ); |
|
992 |
||
993 |
// Append data for ISI message. Has room for mode, num of subBlocks |
|
994 |
// and NET_MODEM_GSM_BAND_INFO sb. |
|
995 |
TBuf8<2 + SIZE_NET_MODEM_GSM_BAND_INFO> netModemAvailableGetReq; |
|
996 |
netModemAvailableGetReq.Append( NET_MANUAL_SEARCH ); |
|
997 |
||
998 |
// 1 subBlock |
|
999 |
netModemAvailableGetReq.Append( 1 ); |
|
1000 |
||
1001 |
// Data buffer for net gsm band info sb. |
|
1002 |
TBuf8<SIZE_NET_MODEM_GSM_BAND_INFO> netModemGsmBandInfoBuf( 0 ); |
|
1003 |
||
1004 |
TIsiSubBlock netModemGsmBandInfoSb( |
|
1005 |
netModemGsmBandInfoBuf, |
|
1006 |
NET_MODEM_GSM_BAND_INFO, |
|
1007 |
EIsiSubBlockTypeId8Len8 ); |
|
1008 |
||
1009 |
netModemGsmBandInfoBuf.Append( NET_GSM_BAND_ALL_SUPPORTED_BANDS ); |
|
1010 |
||
1011 |
netModemAvailableGetReq.Append( netModemGsmBandInfoSb.CompleteSubBlock() ); |
|
1012 |
||
1013 |
return iPhoNetSender->Send( |
|
1014 |
PN_MODEM_NETWORK, |
|
1015 |
aTransactionId, |
|
1016 |
NET_MODEM_AVAILABLE_GET_REQ, |
|
1017 |
netModemAvailableGetReq ); |
|
1018 |
} |
|
1019 |
||
1020 |
// ----------------------------------------------------------------------------- |
|
1021 |
// CMmNetMessHandler::NetModemAvailableGetRespL |
|
1022 |
// Breaks a NET_MODEM_AVAILABLE_GET_RESP ISI-message. |
|
1023 |
// Creates a CMobilePhoneNetworkListV2 with the information of the ISI and |
|
1024 |
// completes EMobilePhoneGetDetectedNetworksV2Phase1 to SOS layer. |
|
1025 |
// ----------------------------------------------------------------------------- |
|
1026 |
// |
|
1027 |
void CMmNetMessHandler::NetModemAvailableGetRespL |
|
1028 |
( |
|
1029 |
const TIsiReceiveC& aIsiMessage |
|
1030 |
) const |
|
1031 |
{ |
|
1032 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemAvailableGetRespL"); |
|
1033 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETMODEMAVAILABLEGETRESPL, "CMmNetMessHandler::NetModemAvailableGetRespL" ); |
|
1034 |
||
1035 |
// Check the success of the operation. |
|
1036 |
TUint8 successCode( aIsiMessage.Get8bit( |
|
1037 |
ISI_HEADER_SIZE + NET_MODEM_AVAILABLE_GET_RESP_OFFSET_SUCCESSCODE ) ); |
|
1038 |
||
1039 |
TUint8 nbOfSubBlocks( aIsiMessage.Get8bit( |
|
1040 |
ISI_HEADER_SIZE + NET_MODEM_AVAILABLE_GET_RESP_OFFSET_SUBBLOCKCOUNT ) ); |
|
1041 |
||
1042 |
// Check if we have sub blocks in the message. |
|
1043 |
if ( 0 < nbOfSubBlocks && NET_CAUSE_OK == successCode ) |
|
1044 |
{ |
|
1045 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemAvailableGetRespL - Success case"); |
|
1046 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_NETMODEMAVAILABLEGETRESPL, "CMmNetMessHandler::NetModemAvailableGetRespL - Success case" ); |
|
1047 |
||
1048 |
// Handle NET_MODEM_AVAILABLE_GET_RESP ISI-message success case. |
|
1049 |
iNetOperatorNameHandler->HandleManualSearchSuccessCaseL( aIsiMessage ); |
|
1050 |
} |
|
1051 |
else |
|
1052 |
{ |
|
1053 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemAvailableGetRespL - Error case"); |
|
1054 |
OstTrace0( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_NETMODEMAVAILABLEGETRESPL, "CMmNetMessHandler::NetModemAvailableGetRespL - Error case" ); |
|
1055 |
||
1056 |
TInt epocError( KErrGeneral ); |
|
1057 |
||
1058 |
if ( !iSearchNetworkCancelIssued && |
|
1059 |
NET_CAUSE_REQUEST_INTERRUPTED == successCode ) |
|
1060 |
{ |
|
1061 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemAvailableGetRespL - Error case - MT call during network search"); |
|
1062 |
OstTrace0( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_NETMODEMAVAILABLEGETRESPL, "CMmNetMessHandler::NetModemAvailableGetRespL - Error case - MT call during network search" ); |
|
1063 |
// In case of MT call during network search, NET server can |
|
1064 |
// interrupt network search before client has chance to cancel |
|
1065 |
// the search request. Thus in this case we need to convert the |
|
1066 |
// error to more suitable like KErrAbort. |
|
1067 |
epocError = CMmStaticUtility::EpocErrorCode( |
|
1068 |
KErrAbort, |
|
1069 |
KErrGsmNetCauseCallActive ); |
|
1070 |
} |
|
1071 |
else |
|
1072 |
{ |
|
1073 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetModemAvailableGetRespL - Error case - Cancel or Other error"); |
|
1074 |
OstTrace0( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_NETMODEMAVAILABLEGETRESPL, "CMmNetMessHandler::NetModemAvailableGetRespL - Error case - Cancel or Other error" ); |
|
1075 |
// If some other error or cancel is called, then complete |
|
1076 |
// with mapped error code. |
|
1077 |
epocError = CMmStaticUtility::CSCauseToEpocError( |
|
1078 |
PN_MODEM_NETWORK, |
|
1079 |
KTsyNetCauseCommon, |
|
1080 |
successCode ); |
|
1081 |
} |
|
1082 |
||
1083 |
// Complete client request. |
|
1084 |
iMessageRouter->Complete( |
|
1085 |
EMobilePhoneGetDetectedNetworksV2Phase1, |
|
1086 |
epocError ); |
|
1087 |
} |
|
1088 |
} |
|
1089 |
||
1090 |
// ----------------------------------------------------------------------------- |
|
1091 |
// CMmNetMessHandler::NetAvailableCancelReq |
|
1092 |
// Called by ExtFuncL to construct a NET_AVAILABLE_CANCEL_REQ ISI |
|
1093 |
// message and send it to Phonet. Enables the flag iSearchNetworkCancelIssued. |
|
1094 |
// ----------------------------------------------------------------------------- |
|
1095 |
// |
|
1096 |
TInt CMmNetMessHandler::NetAvailableCancelReq |
|
1097 |
( |
|
1098 |
TUint8 aTransactionId // Transaction id |
|
1099 |
) |
|
1100 |
{ |
|
1101 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetAvailableCancelReq"); |
|
1102 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETAVAILABLECANCELREQ, "CMmNetMessHandler::NetAvailableCancelReq" ); |
|
1103 |
||
1104 |
// Set the network search flag to ETrue. |
|
1105 |
iSearchNetworkCancelIssued = ETrue; |
|
1106 |
||
1107 |
// Data buffer length is 2. Has room for transaction id and message id. |
|
1108 |
TBuf8<2> data; |
|
1109 |
data.Append( aTransactionId ); |
|
1110 |
data.Append( NET_AVAILABLE_CANCEL_REQ ); |
|
1111 |
||
1112 |
TIsiSend isimsg( iPhoNetSender->SendBufferDes() ); |
|
1113 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_MODEM_NETWORK ); |
|
1114 |
isimsg.CopyData( ISI_HEADER_SIZE, data ); |
|
1115 |
||
1116 |
return iPhoNetSender->Send( isimsg.Complete() ); |
|
1117 |
} |
|
1118 |
||
1119 |
// ----------------------------------------------------------------------------- |
|
1120 |
// CMmNetMessHandler::NetAvailableCancelResp |
|
1121 |
// Breaks a NET_AVAILABLE_CANCEL_RESP ISI. Completes |
|
1122 |
// EMobilePhoneGetDetectedNetworksCancel to SOS layer. Disables the |
|
1123 |
// iSearchNetworkCancelIssued flag. |
|
1124 |
// ----------------------------------------------------------------------------- |
|
1125 |
// |
|
1126 |
void CMmNetMessHandler::NetAvailableCancelResp |
|
1127 |
( |
|
1128 |
const TIsiReceiveC& aIsiMessage |
|
1129 |
) |
|
1130 |
{ |
|
1131 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetAvailableCancelResp"); |
|
1132 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETAVAILABLECANCELRESP, "CMmNetMessHandler::NetAvailableCancelResp" ); |
|
1133 |
||
1134 |
// Get success code |
|
1135 |
TUint8 successCode( aIsiMessage.Get8bit( |
|
1136 |
ISI_HEADER_SIZE + NET_AVAILABLE_CANCEL_RESP_OFFSET_SUCCESSCODE ) ); |
|
1137 |
||
1138 |
// Convert the error to Epoc Error |
|
1139 |
TInt error( CMmStaticUtility::CSCauseToEpocError( |
|
1140 |
PN_MODEM_NETWORK, |
|
1141 |
KTsyNetCauseCommon, |
|
1142 |
successCode ) ); |
|
1143 |
||
1144 |
iMessageRouter->Complete( |
|
1145 |
EMobilePhoneGetDetectedNetworksCancel, |
|
1146 |
error ); |
|
1147 |
||
1148 |
// The cancel has been completed, |
|
1149 |
// therefore set the cancel issued flag off. |
|
1150 |
iSearchNetworkCancelIssued = EFalse; |
|
1151 |
} |
|
1152 |
||
1153 |
// ----------------------------------------------------------------------------- |
|
1154 |
// CMmNetMessHandler::NetSetReq |
|
1155 |
// Called by ExtFuncL to construct a NET_SET_REQ ISI |
|
1156 |
// message and send it to Phonet. The correct selection mode is choosen |
|
1157 |
// according to previous network selections. The network is selected by MNC/MCC |
|
1158 |
// codes and not by index. |
|
1159 |
// ----------------------------------------------------------------------------- |
|
1160 |
// |
|
1161 |
TInt CMmNetMessHandler::NetSetReq |
|
1162 |
( |
|
1163 |
TUint8 aTransactionId, |
|
1164 |
TBool aIsManual, |
|
1165 |
const TOperatorCode& aMnc, |
|
1166 |
const TCountryCode& aMcc |
|
1167 |
) const |
|
1168 |
{ |
|
1169 |
// NW selection mode: Manual or reselection. Initialise variable. |
|
1170 |
TUint8 networkSelectionMode( NET_SELECT_MODE_NO_SELECTION ); |
|
1171 |
||
1172 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetSetReq -- Manual NW selection(T/F): %d", aIsManual); |
|
1173 |
OstTrace1( TRACE_NORMAL, CMMNETMESSHANDLER_NETSETREQ, "CMmNetMessHandler::NetSetReq;aIsManual=%d", aIsManual ); |
|
1174 |
||
1175 |
TFLOGSTRING3("TSY: CMmNetMessHandler::NetSetReq -- MNC: %S MCC: %S", &aMnc, &aMcc); |
|
1176 |
OstTraceExt2( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_NETSETREQ, "CMmNetMessHandler::NetSetReq;aMnc=%S;aMcc=%S", aMnc, aMcc ); |
|
1177 |
||
1178 |
// If NW selection mode is changed from manual to automatic |
|
1179 |
if ( NET_SELECT_MODE_MANUAL == iSelectionMethod |
|
1180 |
&& !aIsManual ) |
|
1181 |
{ |
|
1182 |
networkSelectionMode = NET_SELECT_MODE_AUTOMATIC; |
|
1183 |
} |
|
1184 |
// If NW selection is set from automatic to automatic |
|
1185 |
else if ( !aIsManual ) |
|
1186 |
{ |
|
1187 |
networkSelectionMode = NET_SELECT_MODE_USER_RESELECTION; |
|
1188 |
} |
|
1189 |
// If NW selection mode is set manual |
|
1190 |
else if ( aIsManual ) |
|
1191 |
{ |
|
1192 |
networkSelectionMode = NET_SELECT_MODE_MANUAL; |
|
1193 |
} |
|
1194 |
||
1195 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetSetReq -- NW Selection Mode: %d", networkSelectionMode); |
|
1196 |
OstTraceExt1( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_NETSETREQ, "CMmNetMessHandler::NetSetReq;networkSelectionMode=%hhu", networkSelectionMode ); |
|
1197 |
||
1198 |
// Append data for ISI message. |
|
1199 |
// Has room for registered in another protocol, num of subBlocks, |
|
1200 |
// net operator info common sb and net gsm operator info sb. |
|
1201 |
TBuf8<2 + SIZE_NET_OPERATOR_INFO_COMMON + SIZE_NET_MODEM_GSM_OPERATOR_INFO> |
|
1202 |
netSetReqData; |
|
1203 |
||
1204 |
// Registered in another protocol |
|
1205 |
// if network mode has just changed, this should be 1. |
|
1206 |
// GSM always 0. |
|
1207 |
netSetReqData.Append( KDefaultRegInAnotherNwGsm ); |
|
1208 |
||
1209 |
// Add number of Subblock |
|
1210 |
if ( NET_SELECT_MODE_USER_RESELECTION != networkSelectionMode ) |
|
1211 |
{ |
|
1212 |
// 2 subBlocks |
|
1213 |
netSetReqData.Append( 2 ); |
|
1214 |
} |
|
1215 |
else |
|
1216 |
{ |
|
1217 |
// 1 subBlock |
|
1218 |
netSetReqData.Append( 1 ); |
|
1219 |
} |
|
1220 |
||
1221 |
if ( NET_SELECT_MODE_USER_RESELECTION != networkSelectionMode ) |
|
1222 |
{ |
|
1223 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetSetReq -- Adding NET_MODEM_GSM_OPERATOR_INFO SubBlock"); |
|
1224 |
OstTrace0( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_NETSETREQ, "CMmNetMessHandler::NetSetReq, Adding NET_MODEM_GSM_OPERATOR_INFO SubBlock" ); |
|
1225 |
// We add NET_MODEM_GSM_OPERATOR_INFO subblock to ISI. |
|
1226 |
// The information about the Band is not send trough MM ETEL Api, thus |
|
1227 |
// the value is set to unknown |
|
1228 |
||
1229 |
// Size is 3 bytes for operator code |
|
1230 |
TBuf8<3> operatorCode; |
|
1231 |
CMmStaticUtility::FormOperatorCode( operatorCode, &aMnc, &aMcc ); |
|
1232 |
||
1233 |
// Data buffer for NET_MODEM_GSM_OPERATOR_INFO sb. |
|
1234 |
TBuf8<SIZE_NET_MODEM_GSM_OPERATOR_INFO> netModemGsmOperatorInfoBuf; |
|
1235 |
TIsiSubBlock netModemGsmOperatorInfoSb( netModemGsmOperatorInfoBuf, |
|
1236 |
NET_MODEM_GSM_OPERATOR_INFO, |
|
1237 |
EIsiSubBlockTypeId8Len8 ); |
|
1238 |
||
1239 |
netModemGsmOperatorInfoBuf.Append( operatorCode ); |
|
1240 |
netModemGsmOperatorInfoBuf.Append( NET_GSM_BAND_INFO_NOT_AVAIL ); |
|
1241 |
||
1242 |
netSetReqData.Append( netModemGsmOperatorInfoSb.CompleteSubBlock() ); |
|
1243 |
} |
|
1244 |
||
1245 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetSetReq -- Adding NET_OPERATOR_INFO_COMMON SubBlock"); |
|
1246 |
OstTrace0( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_NETSETREQ, "CMmNetMessHandler::NetSetReq, Adding NET_OPERATOR_INFO_COMMON SubBlock" ); |
|
1247 |
||
1248 |
// Data buffer for net operator info common sb. |
|
1249 |
TBuf8<SIZE_NET_OPERATOR_INFO_COMMON> operatorInfoCommonBuf; |
|
1250 |
TIsiSubBlock operatorInfoCommonSb( operatorInfoCommonBuf, |
|
1251 |
NET_OPERATOR_INFO_COMMON, |
|
1252 |
EIsiSubBlockTypeId8Len8 ); |
|
1253 |
||
1254 |
operatorInfoCommonBuf.Append( networkSelectionMode ); |
|
1255 |
operatorInfoCommonBuf.Append( NET_INDEX_NOT_USED ); |
|
1256 |
netSetReqData.Append( operatorInfoCommonSb.CompleteSubBlock() ); |
|
1257 |
||
1258 |
return iPhoNetSender->Send( |
|
1259 |
PN_MODEM_NETWORK, |
|
1260 |
aTransactionId, |
|
1261 |
NET_SET_REQ, |
|
1262 |
netSetReqData ); |
|
1263 |
} |
|
1264 |
||
1265 |
// ----------------------------------------------------------------------------- |
|
1266 |
// CMmNetMessHandler::NetSetCancelReq |
|
1267 |
// Called by ExtFuncL to construct a NET_SET_CANCEL_REQ ISI |
|
1268 |
// message and send it to Phonet. Enables the flag iSelectNetworkCancelIssued. |
|
1269 |
// ----------------------------------------------------------------------------- |
|
1270 |
// |
|
1271 |
TInt CMmNetMessHandler::NetSetCancelReq |
|
1272 |
( |
|
1273 |
TUint8 aTransactionId |
|
1274 |
) |
|
1275 |
{ |
|
1276 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetSetCancelReq"); |
|
1277 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETSETCANCELREQ, "CMmNetMessHandler::NetSetCancelReq" ); |
|
1278 |
||
1279 |
// Set the network select flag to ETrue. |
|
1280 |
// This flag is checked in NetSetCancelResp. |
|
1281 |
iSelectNetworkCancelIssued = ETrue; |
|
1282 |
||
1283 |
// Data buffer length is 2. |
|
1284 |
// Has room for transaction id and message id. |
|
1285 |
TBuf8<2> data; |
|
1286 |
data.Append( aTransactionId ); |
|
1287 |
data.Append( NET_SET_CANCEL_REQ ); |
|
1288 |
||
1289 |
TIsiSend isimsg( iPhoNetSender->SendBufferDes() ); |
|
1290 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_MODEM_NETWORK ); |
|
1291 |
isimsg.CopyData( ISI_HEADER_SIZE, data ); |
|
1292 |
||
1293 |
return iPhoNetSender->Send( isimsg.Complete() ); |
|
1294 |
} |
|
1295 |
||
1296 |
// ----------------------------------------------------------------------------- |
|
1297 |
// CMmNetMessHandler::NetSetCancelResp |
|
1298 |
// Breaks a NET_SET_CANCEL_RESP ISI-message and completes |
|
1299 |
// EMobilePhoneSelectNetworkCancel to SOS Layer. Disables the |
|
1300 |
// iSelectNetworkCancelIssued flag. |
|
1301 |
// ----------------------------------------------------------------------------- |
|
1302 |
// |
|
1303 |
void CMmNetMessHandler::NetSetCancelResp |
|
1304 |
( |
|
1305 |
const TIsiReceiveC& aIsiMessage |
|
1306 |
) |
|
1307 |
{ |
|
1308 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetSetCancelResp"); |
|
1309 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETSETCANCELRESP, "CMmNetMessHandler::NetSetCancelResp" ); |
|
1310 |
||
1311 |
// Get success code |
|
1312 |
TUint8 successCode( aIsiMessage.Get8bit( |
|
1313 |
ISI_HEADER_SIZE + NET_SET_CANCEL_RESP_OFFSET_SUCCESSCODE ) ); |
|
1314 |
||
1315 |
// Get correct error code from utility |
|
1316 |
TInt errorCode( CMmStaticUtility::CSCauseToEpocError( |
|
1317 |
PN_MODEM_NETWORK, |
|
1318 |
KTsyNetCauseCommon, |
|
1319 |
successCode ) ); |
|
1320 |
||
1321 |
iMessageRouter->Complete( EMobilePhoneSelectNetworkCancel, errorCode ); |
|
1322 |
||
1323 |
// The cancel has been completed, |
|
1324 |
// therefore set the cancel issued flag off. |
|
1325 |
iSelectNetworkCancelIssued = EFalse; |
|
1326 |
} |
|
1327 |
||
1328 |
// ----------------------------------------------------------------------------- |
|
1329 |
// CMmNetMessHandler::NetRatInd |
|
1330 |
// Breaks a NET_RAT_IND ISI-message. |
|
1331 |
// ----------------------------------------------------------------------------- |
|
1332 |
// |
|
1333 |
void CMmNetMessHandler::NetRatInd |
|
1334 |
( |
|
1335 |
const TIsiReceiveC& aIsiMessage |
|
1336 |
) |
|
1337 |
{ |
|
1338 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRatInd"); |
|
1339 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETRATIND, "CMmNetMessHandler::NetRatInd" ); |
|
1340 |
||
1341 |
// Call NetRatResp to do the common job |
|
1342 |
NetRatResp( aIsiMessage ); |
|
1343 |
} |
|
1344 |
||
1345 |
// ----------------------------------------------------------------------------- |
|
1346 |
// CMmNetMessHandler::NetRatReq |
|
1347 |
// Called by ExtFuncL to construct a NET_RAT_REQ ISI |
|
1348 |
// message and send it to Phonet. |
|
1349 |
// ----------------------------------------------------------------------------- |
|
1350 |
// |
|
1351 |
TInt CMmNetMessHandler::NetRatReq |
|
1352 |
( |
|
1353 |
TUint8 /* aTransactionId */ |
|
1354 |
) const |
|
1355 |
{ |
|
1356 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRatReq"); |
|
1357 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETRATREQ, "CMmNetMessHandler::NetRatReq" ); |
|
1358 |
||
1359 |
// Message data size is 1 |
|
1360 |
TBuf8<1> data; |
|
1361 |
||
1362 |
// we need to know the current RAT |
|
1363 |
data.Append( NET_CURRENT_RAT ); |
|
1364 |
||
1365 |
// Create the message. NOTE: the transId is set to DC because of |
|
1366 |
// packet data is listening for the response to this message with that |
|
1367 |
// transId the CMmNetMessHandler doesn't make transaction ID checking |
|
1368 |
// anymore so this it's value is not relevant. |
|
1369 |
// Message sent via Phonet and return. |
|
1370 |
return iPhoNetSender->Send( PN_MODEM_NETWORK, 0xDC, NET_RAT_REQ, data ); |
|
1371 |
} |
|
1372 |
||
1373 |
// ----------------------------------------------------------------------------- |
|
1374 |
// CMmNetMessHandler::NetRatResp |
|
1375 |
// Breaks a NET_RAT_RESP ISI-message. Fetches the access technnology |
|
1376 |
// and sets the value in iNetworkMode and iNetworkAccess. Fetches the |
|
1377 |
// network mode and completes EMobilePhoneNotifyModeChange to SOS Tsy. |
|
1378 |
// ----------------------------------------------------------------------------- |
|
1379 |
// |
|
1380 |
void CMmNetMessHandler::NetRatResp |
|
1381 |
( |
|
1382 |
const TIsiReceiveC& aIsiMessage |
|
1383 |
) |
|
1384 |
{ |
|
1385 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRatResp"); |
|
1386 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETRATRESP, "CMmNetMessHandler::NetRatResp" ); |
|
1387 |
TUint sbStartOffSet( 0 ); |
|
1388 |
||
1389 |
// NET_RAT_INFO sub block |
|
1390 |
TInt retValue( aIsiMessage.FindSubBlockOffsetById( |
|
1391 |
ISI_HEADER_SIZE + SIZE_NET_RAT_RESP, |
|
1392 |
NET_RAT_INFO, |
|
1393 |
EIsiSubBlockTypeId8Len8, |
|
1394 |
sbStartOffSet ) ); |
|
1395 |
||
1396 |
// Check if NET_RAT_INFO sub block is present |
|
1397 |
if( KErrNone == retValue ) |
|
1398 |
{ |
|
1399 |
// Get ratName |
|
1400 |
TUint8 ratName( aIsiMessage.Get8bit( |
|
1401 |
sbStartOffSet + NET_RAT_INFO_OFFSET_RATNAME ) ); |
|
1402 |
||
1403 |
switch ( ratName ) |
|
1404 |
{ |
|
1405 |
case NET_GSM_RAT: |
|
1406 |
{ |
|
1407 |
iNetworkMode = RMobilePhone::ENetworkModeGsm; |
|
1408 |
iNetworkAccess = RMobilePhone::ENetworkAccessGsm; |
|
1409 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRatResp - network mode GSM"); |
|
1410 |
OstTrace0( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_NETRATRESP, "CMmNetMessHandler::NetRatResp - network mode GSM" ); |
|
1411 |
break; |
|
1412 |
} |
|
1413 |
case NET_UMTS_RAT: |
|
1414 |
{ |
|
1415 |
iNetworkMode = RMobilePhone::ENetworkModeWcdma; |
|
1416 |
iNetworkAccess = RMobilePhone::ENetworkAccessUtran; |
|
1417 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRatResp - network mode UMTS"); |
|
1418 |
OstTrace0( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_NETRATRESP, "CMmNetMessHandler::NetRatResp - network mode UMTS" ); |
|
1419 |
break; |
|
1420 |
} |
|
1421 |
default: |
|
1422 |
{ |
|
1423 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRatResp. default network mode"); |
|
1424 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_NETRATRESP, "CMmNetMessHandler::NetRatResp, default network mode" ); |
|
1425 |
iNetworkMode = RMobilePhone::ENetworkModeUnknown; |
|
1426 |
iNetworkAccess = RMobilePhone::ENetworkAccessUnknown; |
|
1427 |
break; |
|
1428 |
} |
|
1429 |
} |
|
1430 |
||
1431 |
CMmDataPackage dataPackage; |
|
1432 |
dataPackage.PackData( &iNetworkMode ); |
|
1433 |
||
1434 |
iMessageRouter->Complete( |
|
1435 |
EMobilePhoneNotifyModeChange, |
|
1436 |
&dataPackage, |
|
1437 |
KErrNone ); |
|
1438 |
} |
|
1439 |
} |
|
1440 |
||
1441 |
// ----------------------------------------------------------------------------- |
|
1442 |
// CMmNetMessHandler::NetNetworkSelectModeSetReq |
|
1443 |
// Called by ExtFuncL to construct a NET_NETWORK_SELECT_MODE_SET_REQ ISI |
|
1444 |
// message and send it to Phonet. |
|
1445 |
// ----------------------------------------------------------------------------- |
|
1446 |
// |
|
1447 |
TInt CMmNetMessHandler::NetNetworkSelectModeSetReq |
|
1448 |
( |
|
1449 |
// Transaction id |
|
1450 |
TUint8 aTransactionId, |
|
1451 |
// Network selection |
|
1452 |
const RMobilePhone::TMobilePhoneNetworkSelectionV1& aNetworkSelection |
|
1453 |
) const |
|
1454 |
{ |
|
1455 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetNetworkSelectModeSetReq"); |
|
1456 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETNETWORKSELECTMODESETREQ, "CMmNetMessHandler::NetNetworkSelectModeSetReq" ); |
|
1457 |
||
1458 |
TInt ret( KErrNone ); |
|
1459 |
||
1460 |
// Check the selection Mode from the selection structure |
|
1461 |
TUint8 networkSelectionMode( NET_SELECT_MODE_UNKNOWN ); |
|
1462 |
||
1463 |
if ( RMobilePhone::ENetworkSelectionAutomatic == |
|
1464 |
aNetworkSelection.iMethod ) |
|
1465 |
{ |
|
1466 |
networkSelectionMode = NET_SELECT_MODE_AUTOMATIC; |
|
1467 |
} |
|
1468 |
else if ( RMobilePhone::ENetworkSelectionManual == |
|
1469 |
aNetworkSelection.iMethod ) |
|
1470 |
{ |
|
1471 |
networkSelectionMode = NET_SELECT_MODE_MANUAL; |
|
1472 |
} |
|
1473 |
else |
|
1474 |
{ |
|
1475 |
// All other settings are not supported |
|
1476 |
ret = KErrNotSupported; |
|
1477 |
} |
|
1478 |
||
1479 |
// Continue only if mode is correct |
|
1480 |
if ( KErrNone == ret ) |
|
1481 |
{ |
|
1482 |
// Create network select mode set request |
|
1483 |
// Message data size is 1 (network selection mode) |
|
1484 |
TBuf8<1> data; |
|
1485 |
data.Append( networkSelectionMode ); |
|
1486 |
||
1487 |
// Send message via Phonet |
|
1488 |
ret = iPhoNetSender->Send( |
|
1489 |
PN_MODEM_NETWORK, |
|
1490 |
aTransactionId, |
|
1491 |
NET_NETWORK_SELECT_MODE_SET_REQ, |
|
1492 |
data ); |
|
1493 |
} |
|
1494 |
||
1495 |
return ret; |
|
1496 |
} |
|
1497 |
||
1498 |
// ----------------------------------------------------------------------------- |
|
1499 |
// CMmNetMessHandler::NetNetworkSelectModeSetResp |
|
1500 |
// Breaks a NET_NETWORK_SELECT_MODE_SET_RESP ISI-message and completes |
|
1501 |
// EMobilePhoneSetNetworkSelectionSetting to SOS layer |
|
1502 |
// ----------------------------------------------------------------------------- |
|
1503 |
// |
|
1504 |
void CMmNetMessHandler::NetNetworkSelectModeSetResp |
|
1505 |
( |
|
1506 |
const TIsiReceiveC& aIsiMessage |
|
1507 |
) const |
|
1508 |
{ |
|
1509 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetNetworkSelectModeSetResp"); |
|
1510 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETNETWORKSELECTMODESETRESP, "CMmNetMessHandler::NetNetworkSelectModeSetResp" ); |
|
1511 |
||
1512 |
// Get success code |
|
1513 |
TUint8 successCode( aIsiMessage.Get8bit( |
|
1514 |
ISI_HEADER_SIZE + |
|
1515 |
NET_NETWORK_SELECT_MODE_SET_RESP_OFFSET_SUCCESSCODE ) ); |
|
1516 |
||
1517 |
// Convert the error to Epoc Error |
|
1518 |
TInt epocError( CMmStaticUtility::CSCauseToEpocError( |
|
1519 |
PN_MODEM_NETWORK, |
|
1520 |
KTsyNetCauseCommon, |
|
1521 |
successCode ) ); |
|
1522 |
||
1523 |
iMessageRouter->Complete( |
|
1524 |
EMobilePhoneSetNetworkSelectionSetting, |
|
1525 |
epocError ); |
|
1526 |
} |
|
1527 |
||
1528 |
// ----------------------------------------------------------------------------- |
|
1529 |
// CMmNetMessHandler::NetRssiGetReq |
|
1530 |
// Constructs a NET_RSSI_GET_REQ ISI message and sends it to Phonet. |
|
1531 |
// ----------------------------------------------------------------------------- |
|
1532 |
// |
|
1533 |
TInt CMmNetMessHandler::NetRssiGetReq() const |
|
1534 |
{ |
|
1535 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRssiGetReq"); |
|
1536 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETRSSIGETREQ, "CMmNetMessHandler::NetRssiGetReq" ); |
|
1537 |
||
1538 |
// Data buffer length is 2 (message size minus transId, msgId) |
|
1539 |
TBuf8< SIZE_NET_RSSI_GET_REQ - 2 > reqData; |
|
1540 |
reqData.Append( NET_CS_GSM ); // CS type |
|
1541 |
reqData.Append( NET_CURRENT_CELL_RSSI ); // measurement type |
|
1542 |
||
1543 |
return iPhoNetSender->Send( |
|
1544 |
PN_MODEM_NETWORK, |
|
1545 |
KNetTransId, |
|
1546 |
NET_RSSI_GET_REQ, |
|
1547 |
reqData ); |
|
1548 |
} |
|
1549 |
||
1550 |
// ----------------------------------------------------------------------------- |
|
1551 |
// CMmNetMessHandler::NetRssiGetResp |
|
1552 |
// Breaks a NET_RSSI_GET_RESP ISI message and calls HandleRssi. |
|
1553 |
// ----------------------------------------------------------------------------- |
|
1554 |
// |
|
1555 |
void CMmNetMessHandler::NetRssiGetResp |
|
1556 |
( |
|
1557 |
const TIsiReceiveC& aIsiMessage |
|
1558 |
) |
|
1559 |
{ |
|
1560 |
TUint8 successCode( aIsiMessage.Get8bit( |
|
1561 |
ISI_HEADER_SIZE + NET_RSSI_GET_RESP_OFFSET_SUCCESSCODE ) ); |
|
1562 |
||
1563 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRssiGetResp, successcode=%d", successCode); |
|
1564 |
OstTraceExt1( TRACE_NORMAL, CMMNETMESSHANDLER_NETRSSIGETRESP, "CMmNetMessHandler::NetRssiGetResp;successCode=%hhu", successCode ); |
|
1565 |
||
1566 |
if ( NET_CAUSE_OK == successCode ) |
|
1567 |
{ |
|
1568 |
TUint sbOffset( 0 ); |
|
1569 |
||
1570 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1571 |
ISI_HEADER_SIZE + SIZE_NET_RSSI_GET_RESP, |
|
1572 |
NET_RSSI_CURRENT, |
|
1573 |
EIsiSubBlockTypeId8Len8, |
|
1574 |
sbOffset ) ) |
|
1575 |
{ |
|
1576 |
// Note: the unsigned value gathered from the ISI is percentages |
|
1577 |
TUint8 bars( aIsiMessage.Get8bit( |
|
1578 |
sbOffset + NET_RSSI_CURRENT_OFFSET_SIGNALBARS ) ); |
|
1579 |
||
1580 |
// Get RSSI in dBm with inverse sign |
|
1581 |
TUint8 rssiInDbm( aIsiMessage.Get8bit( |
|
1582 |
sbOffset + NET_RSSI_CURRENT_OFFSET_RSSIINDBM ) ); |
|
1583 |
||
1584 |
HandleRssi( bars, rssiInDbm ); |
|
1585 |
} |
|
1586 |
} // No else, ignore missing RSSI data |
|
1587 |
// No else, ignore failed RSSI measurement |
|
1588 |
} |
|
1589 |
||
1590 |
// ----------------------------------------------------------------------------- |
|
1591 |
// CMmNetMessHandler::NetRssiInd |
|
1592 |
// Breaks a NET_RSSI_IND ISI message and calls HandleRssi. |
|
1593 |
// ----------------------------------------------------------------------------- |
|
1594 |
// |
|
1595 |
void CMmNetMessHandler::NetRssiInd |
|
1596 |
( |
|
1597 |
const TIsiReceiveC& aIsiMessage |
|
1598 |
) |
|
1599 |
{ |
|
1600 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRssiInd"); |
|
1601 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETRSSIIND, "CMmNetMessHandler::NetRssiInd" ); |
|
1602 |
||
1603 |
// Note: the unsigned value gathered from the ISI is percentages |
|
1604 |
TUint8 bars( aIsiMessage.Get8bit( |
|
1605 |
ISI_HEADER_SIZE + NET_RSSI_IND_OFFSET_SIGNALSBAR ) ); |
|
1606 |
||
1607 |
// Get RSSI in dBm with inverse sign |
|
1608 |
TUint8 rssiInDbm( aIsiMessage.Get8bit( |
|
1609 |
ISI_HEADER_SIZE + NET_RSSI_IND_OFFSET_RSSIINDBM ) ); |
|
1610 |
||
1611 |
HandleRssi( bars, rssiInDbm ); |
|
1612 |
} |
|
1613 |
||
1614 |
// ----------------------------------------------------------------------------- |
|
1615 |
// CMmNetMessHandler::HandleRssi |
|
1616 |
// Completes EMobilePhoneNotifySignalStrengthChange to SOS layer |
|
1617 |
// ----------------------------------------------------------------------------- |
|
1618 |
// |
|
1619 |
void CMmNetMessHandler::HandleRssi |
|
1620 |
( |
|
1621 |
TUint8 aBarsIsi, // Bar percentage (ISI value) |
|
1622 |
TUint8 aRSSIIsi // RSSI in dBm with inverse sign (ISI value) |
|
1623 |
) const |
|
1624 |
{ |
|
1625 |
TInt8 i; |
|
1626 |
TInt8 signalBars( 0 ); |
|
1627 |
||
1628 |
// Bar percentage (0-100%) is converted to number of signal strength bars |
|
1629 |
for ( i = KMaxSignalStrengthBars; i > 0; i-- ) |
|
1630 |
{ |
|
1631 |
if ( aBarsIsi >= netRssiLimitsTable[i-1] ) |
|
1632 |
{ |
|
1633 |
signalBars = i; |
|
1634 |
break; |
|
1635 |
} |
|
1636 |
} |
|
1637 |
||
1638 |
// Copy RSSI in dBm into 32 bit integer |
|
1639 |
TInt32 rssiInDbm( aRSSIIsi ); |
|
1640 |
||
1641 |
TFLOGSTRING3("TSY: CMmNetMessHandler::HandleRssi -- signalBars=%d rssiInDbm=%d", signalBars, aRSSIIsi); |
|
1642 |
OstTraceExt2( TRACE_NORMAL, CMMNETMESSHANDLER_HANDLERSSI, "CMmNetMessHandler::HandleRssi;signalBars=%hhd;rssiInDbm=%hhu", signalBars, aRSSIIsi ); |
|
1643 |
||
1644 |
CMmDataPackage dataPackage; |
|
1645 |
dataPackage.PackData( &signalBars, &rssiInDbm ); |
|
1646 |
||
1647 |
iMessageRouter->Complete( |
|
1648 |
EMobilePhoneNotifySignalStrengthChange, |
|
1649 |
&dataPackage, |
|
1650 |
KErrNone ); |
|
1651 |
} |
|
1652 |
||
1653 |
// ----------------------------------------------------------------------------- |
|
1654 |
// CMmNetMessHandler::NetTimeInd |
|
1655 |
// Breaks a NET_TIME_IND ISI and completes EMobilePhoneNotifyNITZInfoChange |
|
1656 |
// to SOS layer |
|
1657 |
// ----------------------------------------------------------------------------- |
|
1658 |
// |
|
1659 |
void CMmNetMessHandler::NetTimeInd |
|
1660 |
( |
|
1661 |
const TIsiReceiveC& aIsiMessage |
|
1662 |
) const |
|
1663 |
{ |
|
1664 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetTimeInd"); |
|
1665 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETTIMEIND, "CMmNetMessHandler::NetTimeInd" ); |
|
1666 |
||
1667 |
TUint sbStartOffSet( 0 ); |
|
1668 |
||
1669 |
TInt ret( aIsiMessage.FindSubBlockOffsetById( |
|
1670 |
ISI_HEADER_SIZE + SIZE_NET_TIME_IND, |
|
1671 |
NET_TIME_INFO, |
|
1672 |
EIsiSubBlockTypeId8Len8, |
|
1673 |
sbStartOffSet ) ); |
|
1674 |
||
1675 |
if ( KErrNone == ret ) |
|
1676 |
{ |
|
1677 |
// Get a year |
|
1678 |
TUint8 year( aIsiMessage.Get8bit( |
|
1679 |
sbStartOffSet + NET_TIME_INFO_OFFSET_YEAR ) ); |
|
1680 |
// Get a month |
|
1681 |
TUint8 month( aIsiMessage.Get8bit( |
|
1682 |
sbStartOffSet + NET_TIME_INFO_OFFSET_MONTH ) ); |
|
1683 |
// Get a day |
|
1684 |
TUint8 day( aIsiMessage.Get8bit( |
|
1685 |
sbStartOffSet + NET_TIME_INFO_OFFSET_DAY ) ); |
|
1686 |
// Get a hour |
|
1687 |
TUint8 hour( aIsiMessage.Get8bit( |
|
1688 |
sbStartOffSet + NET_TIME_INFO_OFFSET_HOUR ) ); |
|
1689 |
// Get a minute |
|
1690 |
TUint8 minute( aIsiMessage.Get8bit( |
|
1691 |
sbStartOffSet + NET_TIME_INFO_OFFSET_MINUTE ) ); |
|
1692 |
// Get a second |
|
1693 |
TUint8 second( aIsiMessage.Get8bit( |
|
1694 |
sbStartOffSet + NET_TIME_INFO_OFFSET_SECOND ) ); |
|
1695 |
// Get timezone |
|
1696 |
TUint8 timezone( aIsiMessage.Get8bit( |
|
1697 |
sbStartOffSet + NET_TIME_INFO_OFFSET_TIMEZONE ) ); |
|
1698 |
// Get daylight saving time (DTS) |
|
1699 |
TUint8 dst( aIsiMessage.Get8bit( |
|
1700 |
sbStartOffSet + NET_TIME_INFO_OFFSET_DAYLIGHTSAVINGTIME ) ); |
|
1701 |
||
1702 |
// Symbian OS SDK: Using TDateTime |
|
1703 |
// When setting the day and month, subtract one because the ranges are |
|
1704 |
// offset from zero. |
|
1705 |
month--; |
|
1706 |
day--; |
|
1707 |
// Year value changing to four digits |
|
1708 |
const TInt KNitzYearOffset( 2000 ); // Adjusting the year value received |
|
1709 |
TInt totalYear; // Four digits year |
|
1710 |
||
1711 |
totalYear = KNitzYearOffset + year; |
|
1712 |
||
1713 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetTimeInd year: %d", totalYear ); |
|
1714 |
OstTrace1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_NETTIMEIND, "CMmNetMessHandler::NetTimeInd;NetTimeInd year=%d", totalYear ); |
|
1715 |
||
1716 |
// NITZ information |
|
1717 |
RMobilePhone::TMobilePhoneNITZ timeDate; |
|
1718 |
// Default caps, will be updated below if not valid. |
|
1719 |
timeDate.iNitzFieldsUsed = KMmTsyNITZCaps; |
|
1720 |
||
1721 |
// Use Set method instead of constructor as the constructor |
|
1722 |
// panics if data is incorrect. Set returns KErrGeneral in that case |
|
1723 |
TInt retValue( timeDate.Set( |
|
1724 |
totalYear, |
|
1725 |
( TMonth )month, |
|
1726 |
day, |
|
1727 |
hour, |
|
1728 |
minute, |
|
1729 |
second, |
|
1730 |
0x00 ) ); // A micro second = 00 |
|
1731 |
||
1732 |
// Check result of set |
|
1733 |
if ( KErrNone != retValue ) |
|
1734 |
{ |
|
1735 |
// Set default values |
|
1736 |
timeDate.Set( 0x00, ( TMonth ) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ); |
|
1737 |
timeDate.iNitzFieldsUsed &= ~( RMobilePhone::KCapsTimeAvailable ); |
|
1738 |
} |
|
1739 |
// If DST is valid, set it |
|
1740 |
if ( NET_DST_INFO_NOT_AVAIL != dst ) |
|
1741 |
{ |
|
1742 |
timeDate.iDST = dst; |
|
1743 |
} |
|
1744 |
// If not, reset DST and remove it from caps |
|
1745 |
else |
|
1746 |
{ |
|
1747 |
timeDate.iDST = 0x00; |
|
1748 |
timeDate.iNitzFieldsUsed &= ~( RMobilePhone::KCapsDSTAvailable ); |
|
1749 |
} |
|
1750 |
||
1751 |
// If Time Zone is valid, set it. |
|
1752 |
// If the time zone is invalid or time zone is unknown, |
|
1753 |
// all bits are set to 1 (including B6). |
|
1754 |
if ( 0xFF != timezone ) |
|
1755 |
{ |
|
1756 |
timeDate.iTimeZone = timezone; |
|
1757 |
} |
|
1758 |
// If not, reset Time Zone and remove it from caps |
|
1759 |
else |
|
1760 |
{ |
|
1761 |
timeDate.iTimeZone = 0x00; |
|
1762 |
timeDate.iNitzFieldsUsed &= |
|
1763 |
~( RMobilePhone::KCapsTimezoneAvailable ); |
|
1764 |
} |
|
1765 |
||
1766 |
CMmDataPackage dataPackage; |
|
1767 |
dataPackage.PackData( &timeDate ); |
|
1768 |
||
1769 |
iMessageRouter->Complete( |
|
1770 |
EMobilePhoneNotifyNITZInfoChange, |
|
1771 |
&dataPackage, |
|
1772 |
retValue ); |
|
1773 |
} |
|
1774 |
} |
|
1775 |
||
1776 |
// ----------------------------------------------------------------------------- |
|
1777 |
// CMmNetMessHandler::MapNWAndRegStatus |
|
1778 |
// Maps an ISA network registration status into a TMobilePhoneRegistrationStatus |
|
1779 |
// and a TMobilePhoneNetworkStatus symbian types |
|
1780 |
// ----------------------------------------------------------------------------- |
|
1781 |
// |
|
1782 |
void CMmNetMessHandler::MapNWAndRegStatus |
|
1783 |
( |
|
1784 |
TUint8 aISARegistrationStatus, // Isa network registration status |
|
1785 |
RMobilePhone::TMobilePhoneRegistrationStatus& aRegStatus, // Registration status |
|
1786 |
RMobilePhone::TMobilePhoneNetworkStatus& aNWStatus // Network status |
|
1787 |
) |
|
1788 |
{ |
|
1789 |
TFLOGSTRING2("TSY: CMmNetMessHandler::MapNWAndRegStatus. ISARegistrationStatus:%d", aISARegistrationStatus); |
|
1790 |
OstTrace1( TRACE_NORMAL, CMMNETMESSHANDLER_MAPNWANDREGSTATUS, "CMmNetMessHandler::MapNWAndRegStatus;aRegStatus=%d", aRegStatus ); |
|
1791 |
||
1792 |
switch ( aISARegistrationStatus ) |
|
1793 |
{ |
|
1794 |
// Registered home |
|
1795 |
case NET_REG_STATUS_HOME: |
|
1796 |
{ |
|
1797 |
aNWStatus = RMobilePhone::ENetworkStatusCurrent; |
|
1798 |
aRegStatus = RMobilePhone::ERegisteredOnHomeNetwork; |
|
1799 |
break; |
|
1800 |
} |
|
1801 |
// Registered roaming |
|
1802 |
case NET_REG_STATUS_ROAM: |
|
1803 |
{ |
|
1804 |
aNWStatus = RMobilePhone::ENetworkStatusCurrent; |
|
1805 |
aRegStatus = RMobilePhone::ERegisteredRoaming; |
|
1806 |
break; |
|
1807 |
} |
|
1808 |
// Not in service |
|
1809 |
case NET_REG_STATUS_NOSERV: |
|
1810 |
case NET_REG_STATUS_NOSERV_SEARCHING: |
|
1811 |
{ |
|
1812 |
aNWStatus = RMobilePhone::ENetworkStatusUnknown; |
|
1813 |
aRegStatus = RMobilePhone::ENotRegisteredSearching; |
|
1814 |
break; |
|
1815 |
} |
|
1816 |
// Not is service and not searching |
|
1817 |
case NET_REG_STATUS_NOSERV_NOTSEARCHING: |
|
1818 |
case NET_REG_STATUS_NSPS: |
|
1819 |
case NET_REG_STATUS_NSPS_NO_COVERAGE: |
|
1820 |
{ |
|
1821 |
aNWStatus = RMobilePhone::ENetworkStatusUnknown; |
|
1822 |
aRegStatus = RMobilePhone::ENotRegisteredNoService; |
|
1823 |
break; |
|
1824 |
} |
|
1825 |
// Not in service and no sim card |
|
1826 |
case NET_REG_STATUS_NOSERV_NOSIM: |
|
1827 |
case NET_REG_STATUS_NOSERV_SIM_REJECTED_BY_NW: |
|
1828 |
{ |
|
1829 |
aNWStatus = RMobilePhone::ENetworkStatusUnknown; |
|
1830 |
aRegStatus = RMobilePhone::ERegistrationDenied; |
|
1831 |
break; |
|
1832 |
} |
|
1833 |
// Power off |
|
1834 |
case NET_REG_STATUS_POWER_OFF: |
|
1835 |
{ |
|
1836 |
aNWStatus = RMobilePhone::ENetworkStatusUnknown; |
|
1837 |
aRegStatus = RMobilePhone::ERegistrationUnknown; |
|
1838 |
break; |
|
1839 |
} |
|
1840 |
// Defaul case |
|
1841 |
default: |
|
1842 |
{ |
|
1843 |
TFLOGSTRING("TSY: CMmNetMessHandler::MapNWAndRegStatus. default registration status"); |
|
1844 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_MAPNWANDREGSTATUS, "CMmNetMessHandler::MapNWAndRegStatus, default registration status" ); |
|
1845 |
aNWStatus = RMobilePhone::ENetworkStatusUnknown; |
|
1846 |
aRegStatus = RMobilePhone::ERegistrationUnknown; |
|
1847 |
break; |
|
1848 |
} |
|
1849 |
} |
|
1850 |
} |
|
1851 |
||
1852 |
// ----------------------------------------------------------------------------- |
|
1853 |
// CMmNetMessHandler::MapNWSelectionMode |
|
1854 |
// Maps a ISA Network Selection mode into a TMobilePhoneNetworkSelectionV1 |
|
1855 |
// Symbian type |
|
1856 |
// ----------------------------------------------------------------------------- |
|
1857 |
// |
|
1858 |
void CMmNetMessHandler::MapNWSelectionMode |
|
1859 |
( |
|
1860 |
TUint8 aISASelectionMode, // Isa network selection mode |
|
1861 |
RMobilePhone::TMobilePhoneNetworkSelectionV1& aSelectionMode // Network selection mode |
|
1862 |
) |
|
1863 |
{ |
|
1864 |
TFLOGSTRING2("TSY: CMmNetMessHandler::MapNWSelectionMode. ISA selectionmode:%d", aISASelectionMode); |
|
1865 |
OstTraceExt1( TRACE_NORMAL, CMMNETMESSHANDLER_MAPNWSELECTIONMODE, "CMmNetMessHandler::MapNWSelectionMode;aISASelectionMode=%hhu", aISASelectionMode ); |
|
1866 |
||
1867 |
if ( NET_SELECT_MODE_AUTOMATIC == aISASelectionMode ) |
|
1868 |
{ |
|
1869 |
aSelectionMode.iMethod = RMobilePhone::ENetworkSelectionAutomatic; |
|
1870 |
} |
|
1871 |
else if ( NET_SELECT_MODE_MANUAL == aISASelectionMode ) |
|
1872 |
{ |
|
1873 |
aSelectionMode.iMethod = RMobilePhone::ENetworkSelectionManual; |
|
1874 |
} |
|
1875 |
else |
|
1876 |
{ |
|
1877 |
aSelectionMode.iMethod = RMobilePhone::ENetworkSelectionUnknown; |
|
1878 |
} |
|
1879 |
||
1880 |
// This is gsm specific function, set the default values for the CDMA |
|
1881 |
// specific parameters |
|
1882 |
aSelectionMode.iBandClass = RMobilePhone::ENetworkBandClassUnknown; |
|
1883 |
aSelectionMode.iOperationMode = RMobilePhone::ENetworkOperationUnknown; |
|
1884 |
} |
|
1885 |
||
1886 |
// ----------------------------------------------------------------------------- |
|
1887 |
// CMmNetMessHandler::MapOperatorAndCountryCode |
|
1888 |
// Maps a ISA operator code into a TMobilePhoneNetworkIdentity symbian type |
|
1889 |
// ----------------------------------------------------------------------------- |
|
1890 |
// |
|
1891 |
TBool CMmNetMessHandler::MapOperatorAndCountryCode |
|
1892 |
( |
|
1893 |
const TDesC8& aIsaOperatorAndCountryCode, |
|
1894 |
RMobilePhone::TMobilePhoneNetworkIdentity& aOperatorCode, |
|
1895 |
RMobilePhone::TMobilePhoneNetworkCountryCode& aCountryCode, |
|
1896 |
TInt aMNCLength |
|
1897 |
) |
|
1898 |
{ |
|
1899 |
TFLOGSTRING2("TSY: CMmNetMessHandler::MapOperatorAndCountryCode - MNCLenght: %d", |
|
1900 |
aMNCLength); |
|
1901 |
OstTrace1( TRACE_NORMAL, CMMNETMESSHANDLER_MAPOPERATORANDCOUNTRYCODE, "CMmNetMessHandler::MapOperatorAndCountryCode;aMNCLength=%d", aMNCLength ); |
|
1902 |
||
1903 |
// Country code mapping |
|
1904 |
TUint16 mcc1( 0 ); |
|
1905 |
TUint16 mcc2( 0 ); |
|
1906 |
TUint16 mcc3( 0 ); |
|
1907 |
||
1908 |
// Get the country code |
|
1909 |
CMmStaticUtility::GetMccCodes( |
|
1910 |
aIsaOperatorAndCountryCode, |
|
1911 |
&mcc1, |
|
1912 |
&mcc2, |
|
1913 |
&mcc3 ); |
|
1914 |
||
1915 |
if ( mcc1 < 10 ) //max one digit |
|
1916 |
{ |
|
1917 |
aCountryCode.AppendNum( mcc1, EDecimal ); |
|
1918 |
} |
|
1919 |
if ( mcc2 < 10 ) //max one digit |
|
1920 |
{ |
|
1921 |
aCountryCode.AppendNum( mcc2, EDecimal ); |
|
1922 |
} |
|
1923 |
if ( mcc3 < 10 ) //max one digit |
|
1924 |
{ |
|
1925 |
aCountryCode.AppendNum( mcc3, EDecimal ); |
|
1926 |
} |
|
1927 |
||
1928 |
// Operator code mapping |
|
1929 |
TUint16 mnc1( 0 ); |
|
1930 |
TUint16 mnc2( 0 ); |
|
1931 |
TUint16 mnc3( 0 ); |
|
1932 |
||
1933 |
TBool networkCodeMapped( EFalse ); |
|
1934 |
||
1935 |
// Get the network code |
|
1936 |
CMmStaticUtility::GetMncCodes( aIsaOperatorAndCountryCode, |
|
1937 |
&mnc1, |
|
1938 |
&mnc2, |
|
1939 |
&mnc3 ); |
|
1940 |
||
1941 |
if ( mnc1 < 10 ) // Max one digit |
|
1942 |
{ |
|
1943 |
aOperatorCode.AppendNum( mnc1, EDecimal ); |
|
1944 |
} |
|
1945 |
if ( mnc2 < 10 && aMNCLength != 1 ) |
|
1946 |
{ |
|
1947 |
aOperatorCode.AppendNum( mnc2, EDecimal ); |
|
1948 |
} |
|
1949 |
if ( mnc3 < 10 && aMNCLength != 1 && aMNCLength != 2 ) |
|
1950 |
{ |
|
1951 |
aOperatorCode.AppendNum( mnc3, EDecimal ); |
|
1952 |
} |
|
1953 |
// This added due some operators in USA and Canada sends wrong |
|
1954 |
// MNC codes, using the F value when it should be 0 |
|
1955 |
// e.g. anyone sends 17F instead of 170. |
|
1956 |
else if ( mnc3 == 0x0F ) |
|
1957 |
{ |
|
1958 |
// Put mcc codes together |
|
1959 |
TUint16 countryCode( (TUint16) ( 100 * mcc1 ) + ( 10 * mcc2 ) + mcc3 ); |
|
1960 |
||
1961 |
// Check if the country code is USA (310) or Canada (302) |
|
1962 |
if ( countryCode == 310 || |
|
1963 |
countryCode == 302 ) |
|
1964 |
{ |
|
1965 |
// Add 0 into the end |
|
1966 |
aOperatorCode.AppendNum( 0, EDecimal ); |
|
1967 |
||
1968 |
networkCodeMapped = ETrue; |
|
1969 |
} |
|
1970 |
} |
|
1971 |
return networkCodeMapped; |
|
1972 |
} |
|
1973 |
||
1974 |
// ----------------------------------------------------------------------------- |
|
1975 |
// CMmNetMessHandler::MapNwStatus |
|
1976 |
// Maps a ISA network status value into a TMobilePhoneNetworkStatus Symbian |
|
1977 |
// value. |
|
1978 |
// ----------------------------------------------------------------------------- |
|
1979 |
// |
|
1980 |
void CMmNetMessHandler::MapNwStatus |
|
1981 |
( |
|
1982 |
TUint8 aISANetworkStatus, // Isa network status value |
|
1983 |
RMobilePhone::TMobilePhoneNetworkStatus& aNWStatus // Network status |
|
1984 |
) |
|
1985 |
{ |
|
1986 |
TFLOGSTRING2("TSY: CMmNetMessHandler::MapNwStatus. ISANetworkStatus:%d", aISANetworkStatus); |
|
1987 |
OstTraceExt1( TRACE_NORMAL, CMMNETMESSHANDLER_MAPNWSTATUS, "CMmNetMessHandler::MapNwStatus;aISANetworkStatus=%hhu", aISANetworkStatus ); |
|
1988 |
||
1989 |
switch ( aISANetworkStatus ) |
|
1990 |
{ |
|
1991 |
case NET_OPER_STATUS_UNKNOWN: |
|
1992 |
{ |
|
1993 |
aNWStatus = RMobilePhone::ENetworkStatusUnknown; |
|
1994 |
break; |
|
1995 |
} |
|
1996 |
case NET_OPER_STATUS_AVAILABLE: |
|
1997 |
{ |
|
1998 |
aNWStatus = RMobilePhone::ENetworkStatusAvailable; |
|
1999 |
break; |
|
2000 |
} |
|
2001 |
case NET_OPER_STATUS_CURRENT: |
|
2002 |
{ |
|
2003 |
aNWStatus = RMobilePhone::ENetworkStatusCurrent; |
|
2004 |
break; |
|
2005 |
} |
|
2006 |
case NET_OPER_STATUS_FORBIDDEN: |
|
2007 |
{ |
|
2008 |
aNWStatus = RMobilePhone::ENetworkStatusForbidden; |
|
2009 |
break; |
|
2010 |
} |
|
2011 |
default: |
|
2012 |
{ |
|
2013 |
TFLOGSTRING("TSY: CMmNetMessHandler::MapNwStatus. mapped default network status"); |
|
2014 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_MAPNWSTATUS, "CMmNetMessHandler::MapNwStatus, mapped default network status" ); |
|
2015 |
aNWStatus = RMobilePhone::ENetworkStatusUnknown; |
|
2016 |
break; |
|
2017 |
} |
|
2018 |
} |
|
2019 |
} |
|
2020 |
||
2021 |
// ----------------------------------------------------------------------------- |
|
2022 |
// CMmNetMessHandler::NetCipheringInd |
|
2023 |
// Breaks a NET_CIPHERING_IND ISI and completes |
|
2024 |
// EMobileCallNotifyPrivacyConfirmation to SOS layer |
|
2025 |
// ----------------------------------------------------------------------------- |
|
2026 |
// |
|
2027 |
void CMmNetMessHandler::NetCipheringInd |
|
2028 |
( |
|
2029 |
const TIsiReceiveC& aIsiMessage |
|
2030 |
) const |
|
2031 |
{ |
|
2032 |
RMobilePhone::TMobilePhonePrivacy status = |
|
2033 |
RMobilePhone::EPrivacyUnspecified; |
|
2034 |
RMobilePhone::TMobilePhoneNetworkSecurity securityLevel = |
|
2035 |
RMobilePhone::ECipheringOff; |
|
2036 |
||
2037 |
TUint8 cipheringStatus( aIsiMessage.Get8bit( |
|
2038 |
ISI_HEADER_SIZE + NET_CIPHERING_IND_OFFSET_CIPHERINGSTATUS ) ); |
|
2039 |
||
2040 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetCipheringInd. CipheringStatus:%d", cipheringStatus); |
|
2041 |
OstTraceExt1( TRACE_NORMAL, CMMNETMESSHANDLER_NETCIPHERINGIND, "CMmNetMessHandler::NetCipheringInd;cipheringStatus=%hhu", cipheringStatus ); |
|
2042 |
||
2043 |
switch( cipheringStatus ) |
|
2044 |
{ |
|
2045 |
case NET_CIPHERING_INDICATOR_OFF: |
|
2046 |
{ |
|
2047 |
status = RMobilePhone::EPrivacyOff; |
|
2048 |
//securityLevel is already initialized |
|
2049 |
break; |
|
2050 |
} |
|
2051 |
case NET_CIPHERING_INDICATOR_ON: |
|
2052 |
{ |
|
2053 |
status = RMobilePhone::EPrivacyOn; |
|
2054 |
securityLevel = RMobilePhone::ECipheringGSM; |
|
2055 |
break; |
|
2056 |
} |
|
2057 |
default: |
|
2058 |
{ |
|
2059 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetCipheringInd. no ciphering status"); |
|
2060 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_NETCIPHERINGIND, "CMmNetMessHandler::NetCipheringInd, no ciphering status" ); |
|
2061 |
break; |
|
2062 |
} |
|
2063 |
} |
|
2064 |
||
2065 |
CMmDataPackage package; |
|
2066 |
package.PackData( &status ); |
|
2067 |
||
2068 |
iMessageRouter->Complete( |
|
2069 |
EMobileCallNotifyPrivacyConfirmation, |
|
2070 |
&package, |
|
2071 |
KErrNone ); |
|
2072 |
||
2073 |
package.PackData( &securityLevel ); |
|
2074 |
||
2075 |
iMessageRouter->Complete( |
|
2076 |
EMobilePhoneNotifyNetworkSecurityLevelChange, |
|
2077 |
&package, |
|
2078 |
KErrNone ); |
|
2079 |
} |
|
2080 |
||
2081 |
// ----------------------------------------------------------------------------- |
|
2082 |
// CMmNetMessHandler::NetRadioInfoInd |
|
2083 |
// Breaks a NET_RADIO_INFO_IND ISI message. Saves UTRAN radio state information |
|
2084 |
// and completes NotifyCurrentNetworkChange if state changed. |
|
2085 |
// Location info is invalid (=empty) during Cell_DCH state. |
|
2086 |
// ----------------------------------------------------------------------------- |
|
2087 |
// |
|
2088 |
void CMmNetMessHandler::NetRadioInfoInd |
|
2089 |
( |
|
2090 |
const TIsiReceiveC& aIsiMessage // Received ISI message |
|
2091 |
) |
|
2092 |
{ |
|
2093 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRadioInfoInd"); |
|
2094 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd" ); |
|
2095 |
||
2096 |
TBool oldCell_DCH = iCell_DCH; |
|
2097 |
||
2098 |
// Find NET_UTRAN_RADIO_INFO sub block |
|
2099 |
TUint sbStartOffSet( 0 ); |
|
2100 |
||
2101 |
TInt err( aIsiMessage.FindSubBlockOffsetById( |
|
2102 |
ISI_HEADER_SIZE + SIZE_NET_RADIO_INFO_IND, |
|
2103 |
NET_UTRAN_RADIO_INFO, |
|
2104 |
EIsiSubBlockTypeId8Len8, |
|
2105 |
sbStartOffSet ) ); |
|
2106 |
||
2107 |
if ( KErrNone == err ) |
|
2108 |
{ |
|
2109 |
TUint8 radioState( aIsiMessage.Get8bit( |
|
2110 |
sbStartOffSet + NET_UTRAN_RADIO_INFO_OFFSET_RADIOSTATE ) ); |
|
2111 |
||
2112 |
// iCell_DCH is true if and only if UTRAN radio state is Cell_DCH |
|
2113 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, UTRAN radio state=%d.", radioState); |
|
2114 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;UTRAN radioState=%hhu", radioState ); |
|
2115 |
||
2116 |
iCell_DCH = ( ( NET_UTRAN_RADIO_CELL_DCH == radioState ) ? |
|
2117 |
ETrue : EFalse ); |
|
2118 |
} |
|
2119 |
else |
|
2120 |
{ |
|
2121 |
TFLOGSTRING("TSY: CMmNetMessHandler::NetRadioInfoInd, no UTRAN radio state info."); |
|
2122 |
OstTrace0( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd, no UTRAN radio state info" ); |
|
2123 |
iCell_DCH = EFalse; |
|
2124 |
} |
|
2125 |
||
2126 |
// State changed? |
|
2127 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, iCell_DCH = %d.", iCell_DCH); |
|
2128 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, oldCell_DCH = %d.", oldCell_DCH); |
|
2129 |
OstTrace1( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;oldCell_DCH=%d", oldCell_DCH ); |
|
2130 |
||
2131 |
if ( iCell_DCH != oldCell_DCH ) |
|
2132 |
{ |
|
2133 |
if ( iCell_DCH ) |
|
2134 |
{ |
|
2135 |
// State change Idle ==> Cell_DCH. |
|
2136 |
// Complete with empty location info. |
|
2137 |
RMobilePhone::TMobilePhoneLocationAreaV1 location; |
|
2138 |
location.iAreaKnown = EFalse; |
|
2139 |
location.iLocationAreaCode = iLastLocInfo.iLocationAreaCode; |
|
2140 |
location.iCellId = iLastLocInfo.iCellId; |
|
2141 |
||
2142 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, location.iAreaKnown = %d.", location.iAreaKnown); |
|
2143 |
OstTrace1( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;location.iAreaKnown=%d", location.iAreaKnown ); |
|
2144 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, location.iLocationAreaCode = %d.", location.iLocationAreaCode); |
|
2145 |
OstTrace1( TRACE_NORMAL, DUP5_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;location.iLocationAreaCode=%d", location.iLocationAreaCode ); |
|
2146 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, location.iCellId = %d.", location.iCellId ); |
|
2147 |
OstTrace1( TRACE_NORMAL, DUP6_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;location.iCellId=%d", location.iCellId ); |
|
2148 |
||
2149 |
CMmDataPackage dataPackage; |
|
2150 |
dataPackage.PackData( &iLastNWInfo, &location ); |
|
2151 |
||
2152 |
iMessageRouter->Complete( |
|
2153 |
EMobilePhoneNotifyCurrentNetworkChange, |
|
2154 |
&dataPackage, |
|
2155 |
KErrNone ); |
|
2156 |
} |
|
2157 |
else |
|
2158 |
{ |
|
2159 |
// State change Cell_DCH ==> Idle. |
|
2160 |
// Complete with last saved location info. |
|
2161 |
CMmDataPackage dataPackage; |
|
2162 |
dataPackage.PackData( &iLastNWInfo, &iLastLocInfo ); |
|
2163 |
||
2164 |
iMessageRouter->Complete( |
|
2165 |
EMobilePhoneNotifyCurrentNetworkChange, |
|
2166 |
&dataPackage, |
|
2167 |
KErrNone ); |
|
2168 |
} |
|
2169 |
} |
|
2170 |
||
2171 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, iLastLocInfo.iAreaKnown = %d.", iLastLocInfo.iAreaKnown); |
|
2172 |
OstTrace1( TRACE_NORMAL, DUP7_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;iLastLocInfo.iAreaKnown=%d", iLastLocInfo.iAreaKnown ); |
|
2173 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, iLastLocInfo.iLocationAreaCode = %d.", iLastLocInfo.iLocationAreaCode); |
|
2174 |
OstTrace1( TRACE_NORMAL, DUP8_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;iLastLocInfo.iLocationAreaCode=%d", iLastLocInfo.iLocationAreaCode ); |
|
2175 |
TFLOGSTRING2("TSY: CMmNetMessHandler::NetRadioInfoInd, iLastLocInfo.iCellId = %d.", iLastLocInfo.iCellId); |
|
2176 |
OstTrace1( TRACE_NORMAL, DUP9_CMMNETMESSHANDLER_NETRADIOINFOIND, "CMmNetMessHandler::NetRadioInfoInd;iLastLocInfo.iCellId=%d", iLastLocInfo.iCellId ); |
|
2177 |
} |
|
2178 |
||
2179 |
// ----------------------------------------------------------------------------- |
|
2180 |
// CMmNetMessHandler::UiccReadCiReq |
|
2181 |
// Read ciphering information status from UICC |
|
2182 |
// ----------------------------------------------------------------------------- |
|
2183 |
// |
|
2184 |
TInt CMmNetMessHandler::UiccReadCiReq() |
|
2185 |
{ |
|
2186 |
TFLOGSTRING("TSY: CMmNetMessHandler::UiccReadCiReq"); |
|
2187 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_UICCREADCIREQ, "CMmNetMessHandler::UiccReadCiReq" ); |
|
2188 |
||
2189 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
2190 |
TUiccReadTransparent params; |
|
2191 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
2192 |
params.trId = ETrIdReadCipheringIndicatorStatus; |
|
2193 |
// We need to know the CI status info which is located in byte 3 in EF ad |
|
2194 |
// b1=0: ciphering indicator feature disabled |
|
2195 |
// b1=1: ciphering indicator feature enabled |
|
2196 |
params.dataAmount = 1; |
|
2197 |
params.dataOffset = 2; |
|
2198 |
params.fileId = KElemFileAdministrativeData; |
|
2199 |
params.fileIdSfi = 3; |
|
2200 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
2201 |
||
2202 |
// File id path |
|
2203 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
2204 |
params.filePath.Append( KMasterFileId ); |
|
2205 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
2206 |
||
2207 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
2208 |
} |
|
2209 |
||
2210 |
// ----------------------------------------------------------------------------- |
|
2211 |
// CMmNetMessHandler::UiccReadCiResp |
|
2212 |
// Complete ciphering indicator status |
|
2213 |
// ----------------------------------------------------------------------------- |
|
2214 |
// |
|
2215 |
void CMmNetMessHandler::UiccReadCiResp( TInt aStatus, const TDesC8& aFileData ) |
|
2216 |
{ |
|
2217 |
TFLOGSTRING("TSY: CMmNetMessHandler::UiccReadCiResp"); |
|
2218 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_UICCREADCIRESP, "CMmNetMessHandler::UiccReadCiResp" ); |
|
2219 |
||
2220 |
// Initialize ret value |
|
2221 |
TInt ret( KErrNone ); |
|
2222 |
||
2223 |
// Ciphering indicator information |
|
2224 |
RMobilePhone::TMobileCallCipheringIndicator cipherIndicatorStatus |
|
2225 |
( RMobilePhone::ECipheringDisplayOff ); |
|
2226 |
||
2227 |
if( UICC_STATUS_OK == aStatus ) |
|
2228 |
{ |
|
2229 |
// Get ciphering indicator info ( bit 0) |
|
2230 |
TUint8 cipheringIndicator(aFileData[0] & 0x01 ); |
|
2231 |
if ( cipheringIndicator ) |
|
2232 |
{ |
|
2233 |
cipherIndicatorStatus = RMobilePhone::ECipheringDisplayOn; |
|
2234 |
} |
|
2235 |
} |
|
2236 |
else |
|
2237 |
{ |
|
2238 |
ret = KErrNotFound; |
|
2239 |
} |
|
2240 |
CMmDataPackage package; |
|
2241 |
package.PackData( &cipherIndicatorStatus ); |
|
2242 |
||
2243 |
iMessageRouter->Complete( EMobilePhoneGetCipheringIndicatorStatus, |
|
2244 |
&package, |
|
2245 |
ret ); |
|
2246 |
} |
|
2247 |
||
2248 |
// ----------------------------------------------------------------------------- |
|
2249 |
// CMmNetMessHandler::UiccCsReadReq |
|
2250 |
// Read EHPLMN/HPLMN |
|
2251 |
// ----------------------------------------------------------------------------- |
|
2252 |
// |
|
2253 |
TInt CMmNetMessHandler::UiccCsReadReq() |
|
2254 |
{ |
|
2255 |
TFLOGSTRING("TSY: CMmNetMessHandler::UiccCsReadReq"); |
|
2256 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_UICCCSREADREQ, "CMmNetMessHandler::UiccCsReadReq" ); |
|
2257 |
||
2258 |
// At first we try to read EHPLMN, SIM file '6FD9' |
|
2259 |
// When response is received and if EHPLMN is not supported |
|
2260 |
// we need to read HPLMN from IMSI (EF '6F07') |
|
2261 |
||
2262 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
2263 |
TUiccReadTransparent params; |
|
2264 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
2265 |
params.trId = ETrIdReadCsDataEhplmn; |
|
2266 |
// Read EHPLMN, bytes 1-3 from '6FD9' |
|
2267 |
params.dataAmount = 3; |
|
2268 |
params.dataOffset = 0; |
|
2269 |
params.fileId = KElemFileEhplmn; |
|
2270 |
params.fileIdSfi = 0x1D; |
|
2271 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
2272 |
||
2273 |
// File id path |
|
2274 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
2275 |
params.filePath.Append( KMasterFileId ); |
|
2276 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
2277 |
||
2278 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
2279 |
} |
|
2280 |
||
2281 |
// ----------------------------------------------------------------------------- |
|
2282 |
// CMmNetMessHandler::UiccCsReadEhpmlnResp |
|
2283 |
// Complet EHPLMN |
|
2284 |
// ----------------------------------------------------------------------------- |
|
2285 |
// |
|
2286 |
void CMmNetMessHandler::UiccCsReadEhpmlnResp( |
|
2287 |
TInt aStatus, |
|
2288 |
const TDesC8& aFileData ) |
|
2289 |
{ |
|
2290 |
TFLOGSTRING("TSY: CMmNetMessHandler::UiccCsReadEhpmlnResp"); |
|
2291 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_UICCCSREADEHPMLNRESP, "CMmNetMessHandler::UiccCsReadEhpmlnResp" ); |
|
2292 |
||
2293 |
// If status was OK, EHPLMN was supported |
|
2294 |
if ( KErrNone == aStatus ) |
|
2295 |
{ |
|
2296 |
iHplmn = aFileData; |
|
2297 |
} |
|
2298 |
else // EHPLMN was not supported, read HPLMN |
|
2299 |
{ |
|
2300 |
TUiccReadTransparent params; |
|
2301 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
2302 |
params.trId = ETrIdReadCsDataHplmn; |
|
2303 |
params.dataAmount = 4; // Bytes 2-5 contain MCC/MNC |
|
2304 |
params.dataOffset = 1; // Read from second byte |
|
2305 |
params.fileId = KElemFileImsi; |
|
2306 |
params.fileIdSfi = 7; |
|
2307 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
2308 |
||
2309 |
// File id path |
|
2310 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
2311 |
params.filePath.Append( KMasterFileId ); |
|
2312 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
2313 |
||
2314 |
iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
2315 |
} |
|
2316 |
||
2317 |
if ( 0 != iHplmn.Length() ) |
|
2318 |
{ |
|
2319 |
SetSimNetworkInfo(); |
|
2320 |
} |
|
2321 |
} |
|
2322 |
||
2323 |
// ----------------------------------------------------------------------------- |
|
2324 |
// CMmNetMessHandler::UiccCsReadHpmlnResp |
|
2325 |
// Complete HPLMN |
|
2326 |
// ----------------------------------------------------------------------------- |
|
2327 |
// |
|
2328 |
void CMmNetMessHandler::UiccCsReadHpmlnResp( |
|
2329 |
TInt aStatus, |
|
2330 |
const TDesC8& aFileData ) |
|
2331 |
{ |
|
2332 |
TFLOGSTRING("TSY: CMmNetMessHandler::UiccCsReadHpmlnResp"); |
|
2333 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_UICCCSREADHPMLNRESP, "CMmNetMessHandler::UiccCsReadHpmlnResp" ); |
|
2334 |
||
2335 |
if ( KErrNone == aStatus ) |
|
2336 |
{ |
|
2337 |
TUint8 tempByte( 0 ); |
|
2338 |
// Coding of HPMLN is defined in TS 24.008 |
|
2339 |
// First byte is MCC2|MCC1 |
|
2340 |
tempByte = ( ( aFileData[1] & 0x0F ) << 4 ) | |
|
2341 |
( ( aFileData[0] & 0xF0 ) >> 4 ); |
|
2342 |
iHplmn.Append( tempByte ); |
|
2343 |
||
2344 |
// Second byte is MNC3|MCC3 |
|
2345 |
tempByte = ( ( aFileData[3] & 0x0F ) << 4 ) | |
|
2346 |
( ( aFileData[1] & 0xF0 ) >> 4 ); |
|
2347 |
iHplmn.Append( tempByte ); |
|
2348 |
||
2349 |
// Third byte is MNC2|MNC1 |
|
2350 |
tempByte = ( aFileData[2] & 0xF0 ) | |
|
2351 |
( aFileData[2] & 0x0F ) ; |
|
2352 |
iHplmn.Append( tempByte ); |
|
2353 |
} |
|
2354 |
||
2355 |
if ( 0 != iHplmn.Length() ) |
|
2356 |
{ |
|
2357 |
SetSimNetworkInfo(); |
|
2358 |
} |
|
2359 |
} |
|
2360 |
||
2361 |
// ----------------------------------------------------------------------------- |
|
2362 |
// CMmNetMessHandler::SimNetworkInfo |
|
2363 |
// Breaks home PLMN information and starts procedure for getting network name |
|
2364 |
// information. |
|
2365 |
// ----------------------------------------------------------------------------- |
|
2366 |
// |
|
2367 |
void CMmNetMessHandler::SetSimNetworkInfo() |
|
2368 |
{ |
|
2369 |
TFLOGSTRING("TSY: CMmNetMessHandler::SetSimNetworkInfo"); |
|
2370 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_SETSIMNETWORKINFO, "CMmNetMessHandler::SetSimNetworkInfo" ); |
|
2371 |
||
2372 |
// iHomeInfo is declared in cmmnetmesshandler.h (class private parameter |
|
2373 |
// to store the network information during the operator name is requested. |
|
2374 |
||
2375 |
// Remember to zero-fill the buffers before appending. |
|
2376 |
iHomeInfo.iCountryCode.FillZ( 0 ); |
|
2377 |
iHomeInfo.iNetworkId.FillZ( 0 ); |
|
2378 |
iHomeInfo.iDisplayTag.FillZ( 0 ); |
|
2379 |
iHomeInfo.iLongName.FillZ( 0 ); |
|
2380 |
iHomeInfo.iShortName.FillZ( 0 ); |
|
2381 |
||
2382 |
// Fill the mode, RAT and status, always the default ones. |
|
2383 |
iHomeInfo.iMode = RMobilePhone::ENetworkModeGsm; |
|
2384 |
iHomeInfo.iAccess = RMobilePhone::ENetworkAccessUnknown; |
|
2385 |
iHomeInfo.iStatus = RMobilePhone::ENetworkStatusUnknown; |
|
2386 |
||
2387 |
// Make sure that hplmn is not empty. |
|
2388 |
if ( 0 != iHplmn.Length() ) |
|
2389 |
{ |
|
2390 |
MapOperatorAndCountryCode( |
|
2391 |
iHplmn, |
|
2392 |
iHomeInfo.iNetworkId, |
|
2393 |
iHomeInfo.iCountryCode, |
|
2394 |
iMNClength ); |
|
2395 |
} |
|
2396 |
||
2397 |
// Initialize. |
|
2398 |
TUint mccNumber( 0 ); // Country Code. |
|
2399 |
TUint mncNumber( 0 ); // Network Code. |
|
2400 |
||
2401 |
// Convert descriptor contained number to integer. |
|
2402 |
CMmStaticUtility::GetIntFromDescriptor( |
|
2403 |
mccNumber, |
|
2404 |
iHomeInfo.iCountryCode ); |
|
2405 |
CMmStaticUtility::GetIntFromDescriptor( |
|
2406 |
mncNumber, |
|
2407 |
iHomeInfo.iNetworkId ); |
|
2408 |
||
2409 |
TFLOGSTRING2("TSY: CMmNetMessHandler::SetSimNetworkInfo - CountryCode: %S", &iHomeInfo.iCountryCode); |
|
2410 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_SETSIMNETWORKINFO, "CMmNetMessHandler::SetSimNetworkInfo - CountryCode=%S", iHomeInfo.iCountryCode ); |
|
2411 |
TFLOGSTRING2("TSY: CMmNetMessHandler::SetSimNetworkInfo - NetworkId: %S", &iHomeInfo.iNetworkId); |
|
2412 |
OstTraceExt1( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_SETSIMNETWORKINFO, "CMmNetMessHandler::SetSimNetworkInfo - NetworkId=%S", iHomeInfo.iNetworkId ); |
|
2413 |
||
2414 |
// Buffer for Display tag. |
|
2415 |
TBuf<KDisplayTagLength> alphaTag; |
|
2416 |
||
2417 |
// Get Hard coded name from operators.h. |
|
2418 |
TOperatorNames::GetName( |
|
2419 |
mccNumber, |
|
2420 |
mncNumber, |
|
2421 |
alphaTag ); |
|
2422 |
||
2423 |
TFLOGSTRING2("TSY: CMmNetMessHandler::SetSimNetworkInfo - Name: %S", &alphaTag); |
|
2424 |
OstTraceExt1( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_SETSIMNETWORKINFO, "CMmNetMessHandler::SetSimNetworkInfo - Name=%S", alphaTag ); |
|
2425 |
||
2426 |
// Copy hard coded name to iDisplayTag. Long and short names not handled |
|
2427 |
// in this case and they will left empty. |
|
2428 |
iHomeInfo.iDisplayTag.Copy( alphaTag ); |
|
2429 |
||
2430 |
// Complete. |
|
2431 |
CompleteMobilePhoneGetHomeNetwork(); |
|
2432 |
} |
|
2433 |
||
2434 |
// ----------------------------------------------------------------------------- |
|
2435 |
// CMmNetMessHandler::HandleError |
|
2436 |
// Handles CMmNetMessHandler's errors that comes via PhoNetReceiver RunError |
|
2437 |
// method. |
|
2438 |
// ----------------------------------------------------------------------------- |
|
2439 |
// |
|
2440 |
void CMmNetMessHandler::HandleError |
|
2441 |
( |
|
2442 |
const TIsiReceiveC& /*aIsiMessage*/, // Isi message |
|
2443 |
TInt /*aError*/ // Error code |
|
2444 |
) |
|
2445 |
{ |
|
2446 |
TFLOGSTRING("TSY: CMmNetMessHandler::HandleError"); |
|
2447 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_HANDLEERROR, "CMmNetMessHandler::HandleError" ); |
|
2448 |
} |
|
2449 |
||
2450 |
// ----------------------------------------------------------------------------- |
|
2451 |
// CMmNetMessHandler::GetImsPinVerifyStatus |
|
2452 |
// Return status of SIM PIN verify |
|
2453 |
// ----------------------------------------------------------------------------- |
|
2454 |
// |
|
2455 |
TBool CMmNetMessHandler::GetImsPinVerifyStatus() |
|
2456 |
{ |
|
2457 |
TFLOGSTRING("TSY: CMmNetMessHandler::GetImsPinVerifyStatus"); |
|
2458 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_GETIMSPINVERIFYSTATUS, "CMmNetMessHandler::GetImsPinVerifyStatus" ); |
|
2459 |
||
2460 |
return iImsPinVerifyRequired; |
|
2461 |
} |
|
2462 |
||
2463 |
// ----------------------------------------------------------------------------- |
|
2464 |
// CMmNetMessHandler::GpdsRadioActivityInd |
|
2465 |
// Breaks a GPDS_RADIO_ACTIVITY_IND ISI message. |
|
2466 |
// ----------------------------------------------------------------------------- |
|
2467 |
// |
|
2468 |
void CMmNetMessHandler::GpdsRadioActivityInd |
|
2469 |
( |
|
2470 |
const TIsiReceiveC& aIsiMessage // Received ISI message |
|
2471 |
) |
|
2472 |
{ |
|
2473 |
TFLOGSTRING2("TSY: CMmNetMessHandler::GpdsRadioActivityInd, NetworkMode = %d.", iNetworkMode); |
|
2474 |
OstTrace1( TRACE_NORMAL, CMMNETMESSHANDLER_GPDSRADIOACTIVITYIND, "CMmNetMessHandler::GpdsRadioActivityInd;iNetworkMode=%d", iNetworkMode ); |
|
2475 |
||
2476 |
// Should be ignored in 3G (information not valid). |
|
2477 |
if ( RMobilePhone::ENetworkModeGsm == iNetworkMode ) |
|
2478 |
{ |
|
2479 |
TUint8 radioActivityStatus( aIsiMessage.Get8bit( |
|
2480 |
ISI_HEADER_SIZE + GPDS_RADIO_ACTIVITY_IND_OFFSET_STATUS ) ); |
|
2481 |
// iPacketTransfer is true if and only |
|
2482 |
// if radio activity state is GPDS_RADIO_ON |
|
2483 |
TFLOGSTRING2("TSY: CMmNetMessHandler::GpdsRadioActivityInd, radio activity state=%d.", radioActivityStatus); |
|
2484 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_GPDSRADIOACTIVITYIND, "CMmNetMessHandler::GpdsRadioActivityInd;radio activity state=%hhu", radioActivityStatus ); |
|
2485 |
||
2486 |
TBool newPacketTransfer = ( ( GPDS_RADIO_ON == radioActivityStatus ) ? |
|
2487 |
ETrue : EFalse ); |
|
2488 |
||
2489 |
if ( GPDS_RADIO_OFF == radioActivityStatus ) |
|
2490 |
{ |
|
2491 |
// GPDS_RADIO_OFF => delayed completion |
|
2492 |
iDelayTimer->StartDelayTimer( newPacketTransfer, |
|
2493 |
KGPDSRAICompleteDelay ); |
|
2494 |
} |
|
2495 |
else |
|
2496 |
{ |
|
2497 |
// Cancel timer |
|
2498 |
iDelayTimer->Cancel(); |
|
2499 |
// GPDS_RADIO_ON => complete |
|
2500 |
CompleteGpdsRadioActivityInd( newPacketTransfer ); |
|
2501 |
} |
|
2502 |
} |
|
2503 |
else |
|
2504 |
{ |
|
2505 |
// Cancel timer |
|
2506 |
iDelayTimer->Cancel(); |
|
2507 |
} |
|
2508 |
} |
|
2509 |
||
2510 |
// ----------------------------------------------------------------------------- |
|
2511 |
// CMmNetMessHandler::GpdsContextDeactivateInd |
|
2512 |
// Breaks a GPDS_CONTEXT_DEACTIVATE_IND ISI message. |
|
2513 |
// ----------------------------------------------------------------------------- |
|
2514 |
// |
|
2515 |
void CMmNetMessHandler::GpdsContextDeactivateInd |
|
2516 |
( |
|
2517 |
const TIsiReceiveC& /*aIsiMessage*/ |
|
2518 |
) |
|
2519 |
{ |
|
2520 |
TFLOGSTRING("TSY: CMmNetMessHandler::GpdsContextDeactivateInd"); |
|
2521 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_GPDSCONTEXTDEACTIVATEIND, "CMmNetMessHandler::GpdsContextDeactivateInd" ); |
|
2522 |
// GPDS_RADIO_ACTIVITY_IND / RADIO_OFF is not received when |
|
2523 |
// last context is closed => iPacketTransfer remains to ETrue |
|
2524 |
// => simulate GPDS_RADIO_OFF from GPDS_CONTEXT_DEACTIVATE_IND. |
|
2525 |
// |
|
2526 |
// When PDP context is deactivated, it is still on the list at this point. |
|
2527 |
if ( 1 >= iMessageRouter->GetPacketServiceMessHandler()-> |
|
2528 |
PacketContextList()->NumberOfContexts() ) |
|
2529 |
{ |
|
2530 |
iDelayTimer->StartDelayTimer( EFalse, KGPDSRAICompleteDelay ); |
|
2531 |
} |
|
2532 |
// No else |
|
2533 |
||
2534 |
} |
|
2535 |
||
2536 |
// ----------------------------------------------------------------------------- |
|
2537 |
// CMmNetMessHandler::CompleteGpdsRadioActivityInd |
|
2538 |
// Saves GPDS radio activity information and |
|
2539 |
// completes NotifyCurrentNetworkChange if state changed. |
|
2540 |
// Location info is invalid (=empty) during Packet Transfer state. |
|
2541 |
// ----------------------------------------------------------------------------- |
|
2542 |
// |
|
2543 |
void CMmNetMessHandler::CompleteGpdsRadioActivityInd |
|
2544 |
( |
|
2545 |
TBool aNewPacketTrancferStatus |
|
2546 |
) |
|
2547 |
{ |
|
2548 |
// State changed? |
|
2549 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, NEW transfer status = %d.", aNewPacketTrancferStatus); |
|
2550 |
OstTrace1( TRACE_NORMAL, CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;NEW transfer status=%d", aNewPacketTrancferStatus ); |
|
2551 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, OLD transfer status = %d.", iPacketTransfer); |
|
2552 |
OstTrace1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;OLD transfer status=%d", iPacketTransfer ); |
|
2553 |
||
2554 |
if ( iPacketTransfer != aNewPacketTrancferStatus ) |
|
2555 |
{ |
|
2556 |
// Save new state |
|
2557 |
iPacketTransfer = aNewPacketTrancferStatus; |
|
2558 |
||
2559 |
if ( iPacketTransfer ) |
|
2560 |
{ |
|
2561 |
// State change Packet Idle ==> Packet Transfer. |
|
2562 |
// Complete with empty location info. |
|
2563 |
RMobilePhone::TMobilePhoneLocationAreaV1 location; |
|
2564 |
location.iAreaKnown = EFalse; |
|
2565 |
location.iLocationAreaCode = iLastLocInfo.iLocationAreaCode; |
|
2566 |
location.iCellId = iLastLocInfo.iCellId; |
|
2567 |
||
2568 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, location.iAreaKnown = %d.", location.iAreaKnown); |
|
2569 |
OstTrace1( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;location.iAreaKnown=%d", location.iAreaKnown ); |
|
2570 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, location.iLocationAreaCode = %d.", location.iLocationAreaCode); |
|
2571 |
OstTrace1( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;location.iLocationAreaCode=%d", location.iLocationAreaCode ); |
|
2572 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, location.iCellId = %d.", location.iCellId); |
|
2573 |
OstTrace1( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;location.iCellId=%d", location.iCellId ); |
|
2574 |
||
2575 |
CMmDataPackage dataPackage; |
|
2576 |
dataPackage.PackData( &iLastNWInfo, &location ); |
|
2577 |
iMessageRouter->Complete( |
|
2578 |
EMobilePhoneNotifyCurrentNetworkChange, |
|
2579 |
&dataPackage, |
|
2580 |
KErrNone ); |
|
2581 |
} |
|
2582 |
else |
|
2583 |
{ |
|
2584 |
// State change Packet Transfer ==> Packet Idle. |
|
2585 |
// Complete with last saved location info. |
|
2586 |
CMmDataPackage dataPackage; |
|
2587 |
dataPackage.PackData( &iLastNWInfo, &iLastLocInfo ); |
|
2588 |
iMessageRouter->Complete( |
|
2589 |
EMobilePhoneNotifyCurrentNetworkChange, |
|
2590 |
&dataPackage, |
|
2591 |
KErrNone ); |
|
2592 |
} |
|
2593 |
} |
|
2594 |
// No else |
|
2595 |
||
2596 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, iLastLocInfo.iAreaKnown = %d.", iLastLocInfo.iAreaKnown); |
|
2597 |
OstTrace1( TRACE_NORMAL, DUP5_CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;iLastLocInfo.iAreaKnown=%d", iLastLocInfo.iAreaKnown ); |
|
2598 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, iLastLocInfo.iLocationAreaCode = %d.", iLastLocInfo.iLocationAreaCode); |
|
2599 |
OstTrace1( TRACE_NORMAL, DUP6_CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;iLastLocInfo.iLocationAreaCode=%d", iLastLocInfo.iLocationAreaCode ); |
|
2600 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteGpdsRadioActivityInd, iLastLocInfo.iCellId = %d.", iLastLocInfo.iCellId); |
|
2601 |
OstTrace1( TRACE_NORMAL, DUP7_CMMNETMESSHANDLER_COMPLETEGPDSRADIOACTIVITYIND, "CMmNetMessHandler::CompleteGpdsRadioActivityInd;iLastLocInfo.iCellId=%d", iLastLocInfo.iCellId ); |
|
2602 |
} |
|
2603 |
||
2604 |
// ----------------------------------------------------------------------------- |
|
2605 |
// CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork |
|
2606 |
// This function completes EMobilePhoneGetHomeNetwork. |
|
2607 |
// ----------------------------------------------------------------------------- |
|
2608 |
// |
|
2609 |
void CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork() |
|
2610 |
{ |
|
2611 |
TFLOGSTRING("TSY: CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork"); |
|
2612 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_COMPLETEMOBILEPHONEGETHOMENETWORK, "CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork" ); |
|
2613 |
||
2614 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork - Operator display tag: %S", &iHomeInfo.iDisplayTag); |
|
2615 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_COMPLETEMOBILEPHONEGETHOMENETWORK, "CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork;Operator display tag=%S", iHomeInfo.iDisplayTag ); |
|
2616 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork - Operator short name: %S", &iHomeInfo.iShortName); |
|
2617 |
OstTraceExt1( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_COMPLETEMOBILEPHONEGETHOMENETWORK, "CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork;Operator short name=%S", iHomeInfo.iShortName ); |
|
2618 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork - Operator long name: %S", &iHomeInfo.iLongName); |
|
2619 |
OstTraceExt1( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_COMPLETEMOBILEPHONEGETHOMENETWORK, "CMmNetMessHandler::CompleteMobilePhoneGetHomeNetwork;Operator long name=%S", iHomeInfo.iLongName ); |
|
2620 |
||
2621 |
// Pack the data |
|
2622 |
CMmDataPackage package; |
|
2623 |
package.PackData( &iHomeInfo ); |
|
2624 |
||
2625 |
// Complete to DOS side |
|
2626 |
iMessageRouter->Complete( |
|
2627 |
EMobilePhoneGetHomeNetwork, |
|
2628 |
&package, |
|
2629 |
KErrNone ); |
|
2630 |
||
2631 |
iMNClength = 0; |
|
2632 |
} |
|
2633 |
||
2634 |
// ----------------------------------------------------------------------------- |
|
2635 |
// CMmNetMessHandler::FindOperatorInfoSubBlock |
|
2636 |
// Finds offset to NET_MODEM_GSM_REG_INFO or NET_MODEM_CURRENT_CELL_INFO |
|
2637 |
// in NET_MODEM_REG_STATUS_IND, NET_SET_RESP or NET_MODEM_REG_STATUS_GET_RESP |
|
2638 |
// ----------------------------------------------------------------------------- |
|
2639 |
// |
|
2640 |
TInt CMmNetMessHandler::FindOperatorInfoSubBlock( |
|
2641 |
const TIsiReceiveC& aIsiMessage, |
|
2642 |
TUint& aSbOffset |
|
2643 |
) const |
|
2644 |
{ |
|
2645 |
TUint sbStartOffSet( 0 ); |
|
2646 |
||
2647 |
TFLOGSTRING("TSY: CMmNetMessHandler::FindOperatorInfoSubBlock"); |
|
2648 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_FINDOPERATORINFOSUBBLOCK, "CMmNetMessHandler::FindOperatorInfoSubBlock" ); |
|
2649 |
||
2650 |
TInt ret( CalculateNetworkInformationSbStartOffset( |
|
2651 |
aIsiMessage, sbStartOffSet ) ); |
|
2652 |
||
2653 |
if ( KErrNone == ret ) |
|
2654 |
{ |
|
2655 |
// look for NET_MODEM_CURRENT_CELL_INFO subblock |
|
2656 |
ret = aIsiMessage.FindSubBlockOffsetById( |
|
2657 |
ISI_HEADER_SIZE + sbStartOffSet, |
|
2658 |
NET_MODEM_CURRENT_CELL_INFO, |
|
2659 |
EIsiSubBlockTypeId8Len8, |
|
2660 |
sbStartOffSet ); |
|
2661 |
if ( KErrNone != ret ) |
|
2662 |
{ // look for NET_MODEM_GSM_REG_INFO subblock |
|
2663 |
OstTrace0( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_FINDOPERATORINFOSUBBLOCK, "CMmNetMessHandler::FindOperatorInfoSubBlock - NET_MODEM_CURRENT_CELL_INFO NOT FOUND" ); |
|
2664 |
TFLOGSTRING("TSY: CMmNetMessHandler::FindOperatorInfoSubBlock - NET_MODEM_CURRENT_CELL_INFO NOT FOUND"); |
|
2665 |
ret = aIsiMessage.FindSubBlockOffsetById( |
|
2666 |
ISI_HEADER_SIZE + sbStartOffSet, |
|
2667 |
NET_MODEM_GSM_REG_INFO, |
|
2668 |
EIsiSubBlockTypeId8Len8, |
|
2669 |
sbStartOffSet ); |
|
2670 |
} |
|
2671 |
if ( KErrNone == ret ) |
|
2672 |
{ |
|
2673 |
aSbOffset = sbStartOffSet; |
|
2674 |
} |
|
2675 |
else |
|
2676 |
{ |
|
2677 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_FINDOPERATORINFOSUBBLOCK, "CMmNetMessHandler::FindOperatorInfoSubBlock - NOTHING FOUND!" ); |
|
2678 |
TFLOGSTRING("TSY: CMmNetMessHandler::FindOperatorInfoSubBlock - NOTHING FOUND!"); |
|
2679 |
} |
|
2680 |
} |
|
2681 |
return ret; |
|
2682 |
} |
|
2683 |
||
2684 |
// ----------------------------------------------------------------------------- |
|
2685 |
// CMmNetMessHandler::ExtractNetworkRegistrationStatus |
|
2686 |
// Extracts network registration status from NET_MODEM_REG_INFO_COMMON |
|
2687 |
// subblock of NET_MODEM_REG_STATUS_IND, NET_SET_RESP or |
|
2688 |
// NET_MODEM_REG_STATUS_GET_RESP. |
|
2689 |
// ----------------------------------------------------------------------------- |
|
2690 |
// |
|
2691 |
TInt CMmNetMessHandler::ExtractNetworkRegistrationStatus( |
|
2692 |
const TIsiReceiveC& aIsiMessage, |
|
2693 |
const TDesC8& aOperatorCode, |
|
2694 |
TUint8& aRegistrationStatus, |
|
2695 |
TUint& aSbStartOffset |
|
2696 |
) const |
|
2697 |
{ |
|
2698 |
TFLOGSTRING("TSY: CMmNetMessHandler::ExtractNetworkRegistrationStatus"); |
|
2699 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_EXTRACTNETWORKREGISTRATIONSTATUS, "CMmNetMessHandler::ExtractNetworkRegistrationStatus" ); |
|
2700 |
TUint sbStartOffSet( 0 ); |
|
2701 |
||
2702 |
TInt ret( CalculateNetworkInformationSbStartOffset( |
|
2703 |
aIsiMessage, sbStartOffSet ) ); |
|
2704 |
||
2705 |
if ( KErrNone == ret ) |
|
2706 |
{ |
|
2707 |
ret = aIsiMessage.FindSubBlockOffsetById( |
|
2708 |
ISI_HEADER_SIZE + sbStartOffSet, |
|
2709 |
NET_MODEM_REG_INFO_COMMON, |
|
2710 |
EIsiSubBlockTypeId8Len8, |
|
2711 |
sbStartOffSet ); |
|
2712 |
} |
|
2713 |
if ( KErrNone == ret ) |
|
2714 |
{ |
|
2715 |
aSbStartOffset = sbStartOffSet; |
|
2716 |
aRegistrationStatus = aIsiMessage.Get8bit( sbStartOffSet + |
|
2717 |
NET_MODEM_REG_INFO_COMMON_OFFSET_REGISTRATIONSTATUS ); |
|
2718 |
TFLOGSTRING2("TSY: CMmNetMessHandler::ExtractNetworkRegistrationStatus;registrationStatus=%d", aRegistrationStatus); |
|
2719 |
OstTraceExt1( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_EXTRACTNETWORKREGISTRATIONSTATUS, "CMmNetMessHandler::ExtractNetworkRegistrationStatus;registrationStatus=%hhu", aRegistrationStatus ); |
|
2720 |
// patch registration status if this is SIM-card |
|
2721 |
if ( 0 < iHplmn.Length() ) |
|
2722 |
{ |
|
2723 |
if ( NET_REG_STATUS_ROAM == aRegistrationStatus && |
|
2724 |
aOperatorCode == KO2NetworkId && |
|
2725 |
iHplmn == KO2Hplmn |
|
2726 |
) |
|
2727 |
{ |
|
2728 |
TFLOGSTRING("TSY: CMmNetMessHandler::ExtractNetworkRegistrationStatus; NET_REG_STATUS_ROAM --> NET_REG_STATUS_HOME"); |
|
2729 |
OstTrace0( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_EXTRACTNETWORKREGISTRATIONSTATUS, "CMmNetMessHandler::ExtractNetworkRegistrationStatus; NET_REG_STATUS_ROAM --> NET_REG_STATUS_HOME" ); |
|
2730 |
aRegistrationStatus = NET_REG_STATUS_HOME; |
|
2731 |
} |
|
2732 |
} |
|
2733 |
else |
|
2734 |
{ |
|
2735 |
TFLOGSTRING("TSY: CMmNetMessHandler::ExtractNetworkRegistrationStatus; cant patch, HPLMN is empty"); |
|
2736 |
OstTrace0( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_EXTRACTNETWORKREGISTRATIONSTATUS, "CMmNetMessHandler::ExtractNetworkRegistrationStatus - cant patch, HPLMN is empty" ); |
|
2737 |
} |
|
2738 |
} |
|
2739 |
else |
|
2740 |
{ |
|
2741 |
TFLOGSTRING("TSY: CMmNetMessHandler::ExtractNetworkRegistrationStatus; NET_MODEM_REG_INFO_COMMON not found"); |
|
2742 |
OstTrace0( TRACE_NORMAL, DUP5_CMMNETMESSHANDLER_EXTRACTNETWORKREGISTRATIONSTATUS, "CMmNetMessHandler::ExtractNetworkRegistrationStatus; NET_MODEM_REG_INFO_COMMON not found" ); |
|
2743 |
} |
|
2744 |
return ret; |
|
2745 |
} |
|
2746 |
||
2747 |
// ----------------------------------------------------------------------------- |
|
2748 |
// CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange |
|
2749 |
// Completes EMobilePhoneNotifyCurrentNetworkChange and |
|
2750 |
// EMobilePhoneGetNetworkRegistrationStatus IPCs. |
|
2751 |
// ----------------------------------------------------------------------------- |
|
2752 |
// |
|
2753 |
void CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange |
|
2754 |
( |
|
2755 |
const RMobilePhone::TMobilePhoneLocationAreaV1& aLocationAreaData, // LAC info |
|
2756 |
const RMobilePhone::TMobilePhoneNetworkInfoV5& aNetworkInfoData // Network info |
|
2757 |
) |
|
2758 |
{ |
|
2759 |
TFLOGSTRING("TSY: CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange"); |
|
2760 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_COMPLETEMOBILEPHONENOTIFYCURRENTNETWORKCHANGE, "CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange" ); |
|
2761 |
||
2762 |
// Assistant for packaging. |
|
2763 |
CMmDataPackage dataPackage; |
|
2764 |
||
2765 |
// Take possible Cell_DCH or packet transfer state into account |
|
2766 |
// when completing current network change. |
|
2767 |
iLastNWInfo = aNetworkInfoData; |
|
2768 |
iLastLocInfo = aLocationAreaData; |
|
2769 |
||
2770 |
if ( iCell_DCH || |
|
2771 |
( iPacketTransfer && |
|
2772 |
RMobilePhone::ENetworkModeGsm == iNetworkMode ) ) |
|
2773 |
{ |
|
2774 |
// Pack the data for sending to the manager, |
|
2775 |
// location info is invalid (empty). |
|
2776 |
RMobilePhone::TMobilePhoneLocationAreaV1 location; |
|
2777 |
location.iAreaKnown = EFalse; |
|
2778 |
location.iLocationAreaCode = iLastLocInfo.iLocationAreaCode; |
|
2779 |
location.iCellId = iLastLocInfo.iCellId; |
|
2780 |
||
2781 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - location.iAreaKnown = %d", location.iAreaKnown); |
|
2782 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - location.iLocationAreaCode = %d", location.iLocationAreaCode); |
|
2783 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - location.iCellId = %d", location.iCellId); |
|
2784 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_COMPLETEMOBILEPHONENOTIFYCURRENTNETWORKCHANGE, "CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - location.iAreaKnown=%hhu", location.iAreaKnown ); |
|
2785 |
OstTrace1( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_COMPLETEMOBILEPHONENOTIFYCURRENTNETWORKCHANGE, "CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - location.iLocationAreaCode=%u", location.iLocationAreaCode ); |
|
2786 |
OstTrace1( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_COMPLETEMOBILEPHONENOTIFYCURRENTNETWORKCHANGE, "CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - location.iCellId=%u", location.iCellId ); |
|
2787 |
||
2788 |
dataPackage.PackData( &iLastNWInfo, &location ); |
|
2789 |
} |
|
2790 |
else |
|
2791 |
{ |
|
2792 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - iLastLocInfo.iAreaKnown = %d", iLastLocInfo.iAreaKnown); |
|
2793 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - iLastLocInfo.iLocationAreaCode = %d", iLastLocInfo.iLocationAreaCode); |
|
2794 |
TFLOGSTRING2("TSY: CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - iLastLocInfo.iCellId = %d", iLastLocInfo.iCellId); |
|
2795 |
OstTraceExt1( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_COMPLETEMOBILEPHONENOTIFYCURRENTNETWORKCHANGE, "CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - iLastLocInfo.iAreaKnown=%hhu", iLastLocInfo.iAreaKnown ); |
|
2796 |
OstTrace1( TRACE_NORMAL, DUP5_CMMNETMESSHANDLER_COMPLETEMOBILEPHONENOTIFYCURRENTNETWORKCHANGE, "CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - iLastLocInfo.iLocationAreaCode=%u", iLastLocInfo.iLocationAreaCode ); |
|
2797 |
OstTrace1( TRACE_NORMAL, DUP7_CMMNETMESSHANDLER_COMPLETEMOBILEPHONENOTIFYCURRENTNETWORKCHANGE, "CMmNetMessHandler::CompleteMobilePhoneNotifyCurrentNetworkChange - iLastLocInfo.iCellId=%u", iLastLocInfo.iCellId ); |
|
2798 |
||
2799 |
// Pack the data for sending to the manager. |
|
2800 |
dataPackage.PackData( &iLastNWInfo, &iLastLocInfo ); |
|
2801 |
} |
|
2802 |
||
2803 |
// Inform that the network info has changed. |
|
2804 |
iMessageRouter->Complete( |
|
2805 |
EMobilePhoneNotifyCurrentNetworkChange, |
|
2806 |
&dataPackage, |
|
2807 |
KErrNone ); |
|
2808 |
||
2809 |
iMessageRouter->Complete( |
|
2810 |
EMobilePhoneGetNetworkRegistrationStatus, |
|
2811 |
KErrNone ); |
|
2812 |
||
2813 |
// Continue handling queued messages. |
|
2814 |
ContinueHandlingNetModemRegStatusMessages(); |
|
2815 |
} |
|
2816 |
||
2817 |
// ----------------------------------------------------------------------------- |
|
2818 |
// CMmNetMessHandler::QueueNetModemRegStatusMessagesL |
|
2819 |
// Queue functionality for NET_MODEM_REG_STATUS_IND, |
|
2820 |
// NET_MODEM_REG_STATUS_GET_RESP and NET_SET_RESP ISI-messages. |
|
2821 |
// ----------------------------------------------------------------------------- |
|
2822 |
// |
|
2823 |
void CMmNetMessHandler::QueueNetModemRegStatusMessagesL |
|
2824 |
( |
|
2825 |
const TIsiReceiveC& aIsiMessage |
|
2826 |
) |
|
2827 |
{ |
|
2828 |
TFLOGSTRING("TSY: CMmNetMessHandler::QueueNetModemRegStatusMessagesL"); |
|
2829 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_QUEUENETMODEMREGSTATUSMESSAGESL, "CMmNetMessHandler::QueueNetModemRegStatusMessagesL" ); |
|
2830 |
||
2831 |
// Make a copy of received message. Allocate heap memory. |
|
2832 |
// Can leave if out of mem. |
|
2833 |
HBufC8* tempHBuf = HBufC8::NewL( aIsiMessage.GetBuffer().Length() ); |
|
2834 |
// Copy data. |
|
2835 |
*tempHBuf = aIsiMessage.GetBuffer(); |
|
2836 |
// Catch possible error in append. |
|
2837 |
TInt errValue( iNetMessageQueue.Append( tempHBuf ) ); |
|
2838 |
||
2839 |
// Check possible error. |
|
2840 |
if ( KErrNone == errValue ) |
|
2841 |
{ |
|
2842 |
// Start handling queued messages. |
|
2843 |
StartHandlingNetModemRegStatusMessages(); |
|
2844 |
} |
|
2845 |
else |
|
2846 |
{ |
|
2847 |
// There was error. |
|
2848 |
delete tempHBuf; |
|
2849 |
tempHBuf = NULL; |
|
2850 |
} |
|
2851 |
} |
|
2852 |
||
2853 |
// ----------------------------------------------------------------------------- |
|
2854 |
// CMmNetMessHandler::StartHandlingNetModemRegStatusMessages |
|
2855 |
// Start handling queued messages. |
|
2856 |
// Can complete next IPCs if needed ECustomGetOperatorNameIPC, |
|
2857 |
// EMobilePhoneGetNetworkRegistrationStatus and EMobilePhoneSelectNetwork. |
|
2858 |
// ----------------------------------------------------------------------------- |
|
2859 |
// |
|
2860 |
void CMmNetMessHandler::StartHandlingNetModemRegStatusMessages() |
|
2861 |
{ |
|
2862 |
TFLOGSTRING("TSY: CMmNetMessHandler::StartHandlingNetModemRegStatusMessages"); |
|
2863 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_STARTHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::StartHandlingNetModemRegStatusMessages" ); |
|
2864 |
||
2865 |
// Continue handling if there is messages in queue |
|
2866 |
// and handling not already ongoing. |
|
2867 |
if ( !iNetMessageHandlingOngoing |
|
2868 |
&& 0 < iNetMessageQueue.Count() ) |
|
2869 |
{ |
|
2870 |
TFLOGSTRING("TSY: CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - Start handling next queued message"); |
|
2871 |
OstTrace0( TRACE_NORMAL, DUP1_CMMNETMESSHANDLER_STARTHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - Start handling next queued message" ); |
|
2872 |
||
2873 |
// Set flag ON as message handling start. |
|
2874 |
iNetMessageHandlingOngoing = ETrue; |
|
2875 |
||
2876 |
// Copy message from array. |
|
2877 |
const TDesC8& message( *iNetMessageQueue[0] ); |
|
2878 |
||
2879 |
// Print message to log. |
|
2880 |
TFLOG_PRINT_ISIMESSAGE( message ); |
|
2881 |
||
2882 |
// Save buffer pointer. |
|
2883 |
HBufC8* tempHBuf = iNetMessageQueue[0]; |
|
2884 |
// Remove used message from array and compress. |
|
2885 |
iNetMessageQueue.Remove( 0 ); |
|
2886 |
iNetMessageQueue.Compress(); |
|
2887 |
||
2888 |
TIsiReceiveC isimessage( ( TIsiReceiveC ) message ); |
|
2889 |
||
2890 |
// Get message Id. |
|
2891 |
TInt messageId( isimessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
2892 |
||
2893 |
// Check message id. |
|
2894 |
if ( NET_MODEM_REG_STATUS_IND == messageId ) |
|
2895 |
{ |
|
2896 |
TFLOGSTRING("TSY: CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_MODEM_REG_STATUS_IND"); |
|
2897 |
OstTrace0( TRACE_NORMAL, DUP2_CMMNETMESSHANDLER_STARTHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_MODEM_REG_STATUS_IND" ); |
|
2898 |
||
2899 |
// Start handling NET_MODEM_REG_STATUS_IND message. |
|
2900 |
NetModemRegStatusInd( isimessage ); |
|
2901 |
} |
|
2902 |
else if ( NET_MODEM_REG_STATUS_GET_RESP == messageId ) |
|
2903 |
{ |
|
2904 |
TFLOGSTRING("TSY: CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_MODEM_REG_STATUS_GET_RESP"); |
|
2905 |
OstTrace0( TRACE_NORMAL, DUP3_CMMNETMESSHANDLER_STARTHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_MODEM_REG_STATUS_GET_RESP" ); |
|
2906 |
||
2907 |
// Get the success code. |
|
2908 |
TUint8 successCode( isimessage.Get8bit( |
|
2909 |
ISI_HEADER_SIZE + |
|
2910 |
NET_MODEM_REG_STATUS_GET_RESP_OFFSET_SUCCESSCODE ) ); |
|
2911 |
||
2912 |
if ( NET_CAUSE_OK == successCode ) |
|
2913 |
{ |
|
2914 |
// Data to be read from the NET_MODEM_REG_STATUS_GET_RESP |
|
2915 |
// message is the same as in the NET_MODEM_REG_STATUS_IND |
|
2916 |
// indication. |
|
2917 |
NetModemRegStatusInd( isimessage ); |
|
2918 |
} |
|
2919 |
else |
|
2920 |
{ |
|
2921 |
// Map ISA error to symbian value. |
|
2922 |
TInt error( CMmStaticUtility::CSCauseToEpocError( |
|
2923 |
PN_MODEM_NETWORK, |
|
2924 |
KTsyNetCauseCommon, |
|
2925 |
successCode ) ); |
|
2926 |
||
2927 |
TFLOGSTRING2("TSY: CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_MODEM_REG_STATUS_GET_RESP - Error value: %d", error); |
|
2928 |
OstTrace1( TRACE_NORMAL, DUP4_CMMNETMESSHANDLER_STARTHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_MODEM_REG_STATUS_GET_RESP - Error value=%d", error ); |
|
2929 |
||
2930 |
// Initialize default return values to ECustomGetOperatorNameIPC |
|
2931 |
// complete. |
|
2932 |
RMmCustomAPI::TOperatorNameInfo operNameInfo; |
|
2933 |
operNameInfo.iType = RMmCustomAPI::EOperatorNameFlexiblePlmn; |
|
2934 |
operNameInfo.iName.Zero(); |
|
2935 |
||
2936 |
// Complete ECustomGetOperatorNameIPC with error. |
|
2937 |
// Packed parameter: a RMmCustomAPI::TOperatorNameInfo. |
|
2938 |
CMmDataPackage dataPackage; |
|
2939 |
dataPackage.PackData( &operNameInfo ); |
|
2940 |
||
2941 |
iMessageRouter->Complete( |
|
2942 |
ECustomGetOperatorNameIPC, |
|
2943 |
&dataPackage, |
|
2944 |
error ); |
|
2945 |
||
2946 |
// Complete EMobilePhoneGetNetworkRegistrationStatus with error. |
|
2947 |
iMessageRouter->Complete( |
|
2948 |
EMobilePhoneGetNetworkRegistrationStatus, |
|
2949 |
error ); |
|
2950 |
||
2951 |
// Continue handling queued messages. As previous message has |
|
2952 |
// completed with error. |
|
2953 |
ContinueHandlingNetModemRegStatusMessages(); |
|
2954 |
} |
|
2955 |
} |
|
2956 |
else if ( NET_SET_RESP == messageId ) |
|
2957 |
{ |
|
2958 |
TFLOGSTRING("TSY: CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_SET_RESP"); |
|
2959 |
OstTrace0( TRACE_NORMAL, DUP5_CMMNETMESSHANDLER_STARTHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_SET_RESP" ); |
|
2960 |
||
2961 |
// Check if the NW selection was done ok. |
|
2962 |
TUint8 successCode( isimessage.Get8bit( |
|
2963 |
ISI_HEADER_SIZE + NET_SET_RESP_OFFSET_SUCCESSCODE ) ); |
|
2964 |
||
2965 |
// Map ISA error to Symbian values. |
|
2966 |
TInt error( CMmStaticUtility::CSCauseToEpocError( |
|
2967 |
PN_MODEM_NETWORK, |
|
2968 |
KTsyNetCauseCommon, |
|
2969 |
successCode ) ); |
|
2970 |
||
2971 |
if ( KErrNone == error ) |
|
2972 |
{ |
|
2973 |
// Check subblocks. |
|
2974 |
if ( 0 < isimessage.Get8bit( |
|
2975 |
ISI_HEADER_SIZE + NET_SET_RESP_OFFSET_SUBBLOCKCOUNT ) ) |
|
2976 |
{ |
|
2977 |
// Data to be read from the NET_SET_RESP message is the |
|
2978 |
// same as in the NET_MODEM_REG_STATUS_IND indication. |
|
2979 |
NetModemRegStatusInd( isimessage ); |
|
2980 |
||
2981 |
// Inform that the network selection is completed. |
|
2982 |
iMessageRouter->Complete( |
|
2983 |
EMobilePhoneSelectNetwork, |
|
2984 |
NULL, |
|
2985 |
error ); |
|
2986 |
} |
|
2987 |
else |
|
2988 |
{ |
|
2989 |
// If no subblocks, continue handling queued messages. |
|
2990 |
ContinueHandlingNetModemRegStatusMessages(); |
|
2991 |
} |
|
2992 |
} |
|
2993 |
else |
|
2994 |
{ |
|
2995 |
TFLOGSTRING2("TSY: CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_SET_RESP - Error cause value: %d", successCode); |
|
2996 |
OstTraceExt1( TRACE_NORMAL, DUP6_CMMNETMESSHANDLER_STARTHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::StartHandlingNetModemRegStatusMessages - NET_SET_RESP - Error cause value=%hhu", successCode ); |
|
2997 |
||
2998 |
// SuccessCode is not ok, check also for GSM specific error code. |
|
2999 |
||
3000 |
TUint sbStartOffSet( 0 ); |
|
3001 |
||
3002 |
// Check if interruption request is not already ongoing for the |
|
3003 |
// network selection. |
|
3004 |
if ( NET_CAUSE_REQUEST_INTERRUPTED != successCode |
|
3005 |
&& !iSelectNetworkCancelIssued ) |
|
3006 |
{ |
|
3007 |
// If the subblock exists. |
|
3008 |
if ( KErrNone == isimessage.FindSubBlockOffsetById( |
|
3009 |
ISI_HEADER_SIZE + SIZE_NET_SET_RESP, |
|
3010 |
NET_MODEM_CAUSE_EXTENSION, |
|
3011 |
EIsiSubBlockTypeId8Len8, |
|
3012 |
sbStartOffSet ) ) |
|
3013 |
{ |
|
3014 |
// Get the gsm specific error code. |
|
3015 |
successCode = isimessage.Get8bit( |
|
3016 |
sbStartOffSet + |
|
3017 |
NET_MODEM_CAUSE_EXTENSION_OFFSET_REJECTCODE ); |
|
3018 |
||
3019 |
// Map ISA error to Symbian values. |
|
3020 |
error = CMmStaticUtility::CSCauseToEpocError( |
|
3021 |
PN_MODEM_NETWORK, |
|
3022 |
KTsyNetCauseGsm, |
|
3023 |
successCode ); |
|
3024 |
} |
|
3025 |
||
3026 |
// Inform that there was an error in |
|
3027 |
// network selection. |
|
3028 |
iMessageRouter->Complete( |
|
3029 |
EMobilePhoneSelectNetwork, |
|
3030 |
error ); |
|
3031 |
} |
|
3032 |
else if ( NET_CAUSE_REQUEST_INTERRUPTED == successCode ) |
|
3033 |
{ |
|
3034 |
iMessageRouter->Complete( |
|
3035 |
EMobilePhoneSelectNetwork, |
|
3036 |
NULL, |
|
3037 |
KErrNone ); |
|
3038 |
} |
|
3039 |
||
3040 |
// Continue handling queued messages. As previous message has |
|
3041 |
// completed with error. |
|
3042 |
ContinueHandlingNetModemRegStatusMessages(); |
|
3043 |
} |
|
3044 |
} |
|
3045 |
||
3046 |
// Delete used message. |
|
3047 |
delete tempHBuf; |
|
3048 |
} |
|
3049 |
} |
|
3050 |
||
3051 |
// ----------------------------------------------------------------------------- |
|
3052 |
// CMmNetMessHandler::ContinueHandlingNetModemRegStatusMessages |
|
3053 |
// Continue handling of queued messages if available. |
|
3054 |
// ----------------------------------------------------------------------------- |
|
3055 |
// |
|
3056 |
void CMmNetMessHandler::ContinueHandlingNetModemRegStatusMessages() |
|
3057 |
{ |
|
3058 |
TFLOGSTRING("TSY: CMmNetMessHandler::ContinueHandlingNetModemRegStatusMessages - Continue handling queued messages"); |
|
3059 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_CONTINUEHANDLINGNETMODEMREGSTATUSMESSAGES, "CMmNetMessHandler::ContinueHandlingNetModemRegStatusMessages - Continue handling queued messages" ); |
|
3060 |
||
3061 |
// Message handling done. |
|
3062 |
// Reset flag to OFF as message handling is finished. |
|
3063 |
iNetMessageHandlingOngoing = EFalse; |
|
3064 |
||
3065 |
// Start handling queued messages. |
|
3066 |
StartHandlingNetModemRegStatusMessages(); |
|
3067 |
} |
|
3068 |
||
3069 |
// ----------------------------------------------------------------------------- |
|
3070 |
// CMmNetMessHandler::InitializeOnsAndOplReading |
|
3071 |
// Starts reading Operator Name String and Operator PLMN List rules |
|
3072 |
// when SIM is ready. |
|
3073 |
// ----------------------------------------------------------------------------- |
|
3074 |
// |
|
3075 |
void CMmNetMessHandler::InitializeOnsAndOplReading() |
|
3076 |
{ |
|
3077 |
TFLOGSTRING("TSY: CMmNetMessHandler::InitializeOnsAndOplReading"); |
|
3078 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_INITIALIZEONSANDOPLREADING, "CMmNetMessHandler::InitializeOnsAndOplReading" ); |
|
3079 |
||
3080 |
// Set iNetMessageHandlingOngoing flag to ETrue. |
|
3081 |
iNetMessageHandlingOngoing = ETrue; |
|
3082 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3083 |
// Start Operator Name String (ONS Name) reading. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3084 |
iNetOperatorNameHandler->UiccOperatorReq(); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3085 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3086 |
// Start Operator PLMN List (OPL) rules reading by reading the record count |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3087 |
iNetOperatorNameHandler->UiccReadOplRecordCount(); |
0 | 3088 |
} |
3089 |
||
3090 |
// --------------------------------------------------------------------------- |
|
3091 |
// CMmNetMessHandler::GetMessageRouter |
|
3092 |
// Gets pointer to CMmMessageRouter object. |
|
3093 |
// --------------------------------------------------------------------------- |
|
3094 |
// |
|
3095 |
CMmMessageRouter* CMmNetMessHandler::GetMessageRouter() |
|
3096 |
{ |
|
3097 |
TFLOGSTRING("TSY: CMmNetMessHandler::GetMessageRouter"); |
|
3098 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_GETMESSAGEROUTER, "CMmNetMessHandler::GetMessageRouter" ); |
|
3099 |
return iMessageRouter; |
|
3100 |
} |
|
3101 |
||
3102 |
// --------------------------------------------------------------------------- |
|
3103 |
// CMmNetMessHandler::GetPhoNetSender |
|
3104 |
// Gets pointer to PhoNetSender object. |
|
3105 |
// --------------------------------------------------------------------------- |
|
3106 |
// |
|
3107 |
CMmPhoNetSender* CMmNetMessHandler::GetPhoNetSender() |
|
3108 |
{ |
|
3109 |
TFLOGSTRING("TSY: CMmNetMessHandler::GetPhoNetSender"); |
|
3110 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_GETPHONETSENDER, "CMmNetMessHandler::GetPhoNetSender" ); |
|
3111 |
return iPhoNetSender; |
|
3112 |
} |
|
3113 |
||
3114 |
// ----------------------------------------------------------------------------- |
|
3115 |
// CMmNetMessHandler::ExtractNetworkRegistrationStatus |
|
3116 |
// Extracts network registration status from NET_MODEM_REG_STATUS_IND, |
|
3117 |
// NET_SET_RESP or NET_MODEM_REG_STATUS_GET_RESP |
|
3118 |
// ----------------------------------------------------------------------------- |
|
3119 |
// |
|
3120 |
TInt CMmNetMessHandler::ExtractNetworkRegistrationStatus( |
|
3121 |
const TIsiReceiveC& aIsiMessage, |
|
3122 |
TUint8& aRegistrationStatus |
|
3123 |
) const |
|
3124 |
{ |
|
3125 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_EXTRACTNETWORKREGISTRATIONSTATUS, "CMmNetMessHandler::ExtractNetworkRegistrationStatus" ); |
|
3126 |
TFLOGSTRING("TSY: CMmNetMessHandler::ExtractNetworkRegistrationStatus"); |
|
3127 |
||
3128 |
TUint sbStartOffSet( 0 ); |
|
3129 |
// find offset to subblock from which operator code can be read |
|
3130 |
TInt returnValue( FindOperatorInfoSubBlock( |
|
3131 |
aIsiMessage, |
|
3132 |
sbStartOffSet ) ); |
|
3133 |
||
3134 |
if ( KErrNone == returnValue ) |
|
3135 |
{ |
|
3136 |
TPtrC8 operatorCode( aIsiMessage.GetData( |
|
3137 |
sbStartOffSet + NET_MODEM_CURRENT_CELL_INFO_OFFSET_OPERATORCODE, |
|
3138 |
KBCDLength ) ); |
|
3139 |
TUint8 registrationStatus( 0 ); |
|
3140 |
returnValue = ExtractNetworkRegistrationStatus( |
|
3141 |
aIsiMessage, |
|
3142 |
operatorCode, |
|
3143 |
registrationStatus, |
|
3144 |
sbStartOffSet |
|
3145 |
); |
|
3146 |
||
3147 |
if ( KErrNone == returnValue ) |
|
3148 |
{ |
|
3149 |
aRegistrationStatus = registrationStatus; |
|
3150 |
} |
|
3151 |
} |
|
3152 |
||
3153 |
return returnValue; |
|
3154 |
} |
|
3155 |
||
3156 |
// --------------------------------------------------------------------------- |
|
3157 |
// CMmNetMessHandler::GetNetOperatorNameHandler |
|
3158 |
// Gets pointer to NetOperatorNameHandler object. |
|
3159 |
// --------------------------------------------------------------------------- |
|
3160 |
// |
|
3161 |
CMmNetOperatorNameHandler* CMmNetMessHandler::GetNetOperatorNameHandler() |
|
3162 |
{ |
|
3163 |
TFLOGSTRING("TSY: CMmNetMessHandler::GetNetOperatorNameHandler"); |
|
3164 |
OstTrace0( TRACE_NORMAL, CMMNETMESSHANDLER_GETNETOPERATORNAMEHANDLER, "CMmNetMessHandler::GetNetOperatorNameHandler" ); |
|
3165 |
return iNetOperatorNameHandler; |
|
3166 |
} |
|
3167 |
||
3168 |
// ============================================================================= |
|
3169 |
// CDelayTimer: Used for delaying for completion of Packet transfer state |
|
3170 |
// from GPDS_RADIO_AVTIVITY_IND. |
|
3171 |
||
3172 |
// ----------------------------------------------------------------------------- |
|
3173 |
// CDelayTimer::NewL |
|
3174 |
// Two-phased constructor. |
|
3175 |
// ----------------------------------------------------------------------------- |
|
3176 |
// |
|
3177 |
CDelayTimer* CDelayTimer::NewL( |
|
3178 |
CMmNetMessHandler* aNetMessHandler ) |
|
3179 |
{ |
|
3180 |
TFLOGSTRING("TSY: CDelayTimer::NewL"); |
|
3181 |
OstTrace0( TRACE_NORMAL, CDELAYTIMER_NEWL, "CDelayTimer::NewL" ); |
|
3182 |
||
3183 |
CDelayTimer* self = new( ELeave ) CDelayTimer(); |
|
3184 |
||
3185 |
CleanupStack::PushL( self ); |
|
3186 |
||
3187 |
self->iNetMessHandler = aNetMessHandler; |
|
3188 |
self->ConstructL(); |
|
3189 |
||
3190 |
CleanupStack::Pop( self ); |
|
3191 |
||
3192 |
return self; |
|
3193 |
} |
|
3194 |
||
3195 |
// ----------------------------------------------------------------------------- |
|
3196 |
// CDelayTimer::CDelayTimer() |
|
3197 |
// C++ default constructor can NOT contain any code, that might leave. |
|
3198 |
// ----------------------------------------------------------------------------- |
|
3199 |
// |
|
3200 |
CDelayTimer::CDelayTimer() : CTimer( CActive::EPriorityStandard ) |
|
3201 |
{ |
|
3202 |
TFLOGSTRING("TSY: CDelayTimer::CDelayTimer"); |
|
3203 |
OstTrace0( TRACE_NORMAL, CDELAYTIMER_CDELAYTIMER, "CDelayTimer::CDelayTimer" ); |
|
3204 |
} |
|
3205 |
||
3206 |
// ----------------------------------------------------------------------------- |
|
3207 |
// CDelayTimer::ConstructL() |
|
3208 |
// Symbian 2nd phase constructor can leave. |
|
3209 |
// ----------------------------------------------------------------------------- |
|
3210 |
// |
|
3211 |
void CDelayTimer::ConstructL() |
|
3212 |
{ |
|
3213 |
TFLOGSTRING("TSY: CDelayTimer::ConstructL"); |
|
3214 |
OstTrace0( TRACE_NORMAL, CDELAYTIMER_CONSTRUCTL, "CDelayTimer::ConstructL" ); |
|
3215 |
||
3216 |
iNewPacketTransferState = ETrue; |
|
3217 |
||
3218 |
CTimer::ConstructL(); |
|
3219 |
CActiveScheduler::Add( this ); |
|
3220 |
} |
|
3221 |
||
3222 |
// ----------------------------------------------------------------------------- |
|
3223 |
// CDelayTimer::~CDelayTimer() |
|
3224 |
// Destructor, deletes all allocated resources. |
|
3225 |
// ----------------------------------------------------------------------------- |
|
3226 |
// |
|
3227 |
CDelayTimer::~CDelayTimer() |
|
3228 |
{ |
|
3229 |
TFLOGSTRING("TSY: CDelayTimer::~CDelayTimer"); |
|
3230 |
OstTrace0( TRACE_NORMAL, DUP1_CDELAYTIMER_CDELAYTIMER, "CDelayTimer::~CDelayTimer" ); |
|
3231 |
Cancel(); |
|
3232 |
} |
|
3233 |
||
3234 |
// ----------------------------------------------------------------------------- |
|
3235 |
// CDelayTimer::StartDelayTimer() |
|
3236 |
// Start delay timer. |
|
3237 |
// ----------------------------------------------------------------------------- |
|
3238 |
// |
|
3239 |
void CDelayTimer::StartDelayTimer( |
|
3240 |
TBool aNewPacketTransferState, TInt aTimeOut ) |
|
3241 |
{ |
|
3242 |
if ( iNewPacketTransferState != aNewPacketTransferState ) |
|
3243 |
{ |
|
3244 |
TFLOGSTRING("TSY: CDelayTimer::StartDelayTimer, Restart."); |
|
3245 |
OstTrace0( TRACE_NORMAL, CDELAYTIMER_STARTDELAYTIMER, "CDelayTimer::StartDelayTimer,Restart" ); |
|
3246 |
Cancel(); |
|
3247 |
iNewPacketTransferState = aNewPacketTransferState; |
|
3248 |
After( aTimeOut ); |
|
3249 |
} |
|
3250 |
// No else |
|
3251 |
} |
|
3252 |
||
3253 |
// ----------------------------------------------------------------------------- |
|
3254 |
// CDelayTimer::RunL() |
|
3255 |
// Called when operation completes. |
|
3256 |
// ----------------------------------------------------------------------------- |
|
3257 |
// |
|
3258 |
void CDelayTimer::RunL() |
|
3259 |
{ |
|
3260 |
TFLOGSTRING2("TSY: CDelayTimer::RunL, status = %d.", iStatus.Int()); |
|
3261 |
OstTrace1( TRACE_NORMAL, CDELAYTIMER_RUNL, "CDelayTimer::RunL;iStatus.Int=%d", iStatus.Int() ); |
|
3262 |
||
3263 |
// Timer request has completed, so notify the timer's owner |
|
3264 |
if ( iStatus == KErrNone ) |
|
3265 |
{ |
|
3266 |
iNetMessHandler->CompleteGpdsRadioActivityInd( |
|
3267 |
iNewPacketTransferState ); |
|
3268 |
} |
|
3269 |
// No else |
|
3270 |
||
3271 |
iNewPacketTransferState = ETrue; |
|
3272 |
} |
|
3273 |
||
3274 |
// ----------------------------------------------------------------------------- |
|
3275 |
// CDelayTimer::DoCancel() |
|
3276 |
// Called when operation is cancelled. |
|
3277 |
// ----------------------------------------------------------------------------- |
|
3278 |
// |
|
3279 |
void CDelayTimer::DoCancel() |
|
3280 |
{ |
|
3281 |
TFLOGSTRING("TSY: CDelayTimer::DoCancel"); |
|
3282 |
OstTrace0( TRACE_NORMAL, CDELAYTIMER_DOCANCEL, "CDelayTimer::DoCancel" ); |
|
3283 |
||
3284 |
CTimer::DoCancel(); |
|
3285 |
||
3286 |
iNewPacketTransferState = ETrue; |
|
3287 |
} |
|
3288 |
||
3289 |
// ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
3290 |
//None |
|
3291 |
||
3292 |
// End of File |