author | mikaruus <mika.a.ruuskanen@nokia.com> |
Wed, 17 Feb 2010 13:58:55 +0200 | |
changeset 7 | fa67e03b87df |
parent 5 | 8ccc39f9d787 |
child 9 | 8486d82aef45 |
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 |
// INCLUDE FILES |
|
20 |
||
21 |
#include "cmmcustommesshandler.h" |
|
22 |
#include "cmmsecuritymesshandler.h" |
|
23 |
#include "cmmstaticutility.h" |
|
24 |
#include "cmmnetmesshandler.h" |
|
25 |
#include "cmmnetoperatornamehandler.h" |
|
26 |
#include "cmmcallmesshandler.h" |
|
27 |
#include "cmmphonetsender.h" |
|
28 |
#include "cmmmessagerouter.h" |
|
29 |
#include "tsylogger.h" |
|
30 |
||
31 |
#include <tisi.h> |
|
32 |
#include <call_modemisi.h> |
|
33 |
#include <csdisi.h> |
|
34 |
#include <gssisi.h> |
|
35 |
#include <infoisi.h> |
|
36 |
#include <net_modemisi.h> |
|
37 |
#include <uiccisi.h> |
|
38 |
#include <ss_wmisi.h> |
|
39 |
// #include <permisi.h> To be done in CPS |
|
40 |
#include <product_profile_definitions.h> |
|
41 |
||
42 |
#include <ctsy/serviceapi/mmgsmwcdmautils.h> |
|
43 |
#include <ctsy/pluginapi/cmmdatapackage.h> |
|
44 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
|
45 |
||
46 |
#include <ctsy/serviceapi/gsmerror.h> |
|
47 |
#include <etelmmerr.h> |
|
48 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
49 |
#include "OstTraceDefinitions.h" |
0 | 50 |
#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
|
51 |
#include "cmmcustommesshandlerTraces.h" |
0 | 52 |
#endif |
53 |
||
54 |
// EXTERNAL DATA STRUCTURES |
|
55 |
//None |
|
56 |
||
57 |
// EXTERNAL FUNCTION PROTOTYPES |
|
58 |
//None |
|
59 |
||
60 |
// CONSTANTS |
|
61 |
// hard-coded transaction id for ISI messages |
|
62 |
// const TUint8 KCustomWimTransId = 7; |
|
63 |
||
64 |
// Max length for HSXPA message request |
|
65 |
const TUint KHSxPAMaxMessageSize = 2; |
|
66 |
||
67 |
// Uicc Card Status Byte (hardcoded). Values are derived from APDU server |
|
68 |
// interface documentation. Bitfield READER_STATUS_BYTE |
|
69 |
const TUint8 KUiccCardStatusCardNotPresentOrPoweredOff = 0x10; //0001 0000 |
|
70 |
const TUint8 KUiccCardStatusCardPresentAndPoweredOn = 0xD0; //1101 0000 (0001 0000|0x40|0x80) |
|
71 |
||
72 |
// Consts needed when constructing APDU's going to be sent to the UICC |
|
73 |
const TUint8 KEvenInstructionCode = 0x88; |
|
74 |
const TUint8 KOddInstructionCode = 0x89; |
|
75 |
||
76 |
const TUint8 KFirstBlockOfAuthenticationData = 0x80; |
|
77 |
const TUint8 KFirstBlockOfAuthenticationResponseData = 0xA0; |
|
78 |
||
79 |
const TUint8 KGsmAuthenticationContext = 0x80; // 1000 0000 |
|
80 |
const TUint8 K3GAuthenticationContext = 0x81; // 1000 0001 |
|
81 |
const TUint8 KGBAAuthenticationContext = 0x84; // 1000 0100 |
|
82 |
const TUint8 KMBMSAuthenticationContext = 0x85; // 1000 0101 |
|
83 |
||
84 |
const TUint8 KMaximumLenOfDataExpected = 0x00; |
|
85 |
const TUint8 KRunGsmAlgorithmRespLen = 0x0C; |
|
86 |
const TUint8 KClaNoSm = 0x00; |
|
87 |
const TUint8 KClaIcc = 0xA0; |
|
88 |
||
89 |
const TUint8 KSw1Position = 0x02; |
|
90 |
const TUint8 KSw2Position = 0x01; |
|
91 |
||
92 |
const TUint8 KNormalCommandEnding = 0x00; |
|
93 |
const TUint8 KAppAuthErrorIncorrectMac = 0x01; |
|
94 |
const TUint8 KCmdNotAllowedConditionsNotSatisfied = 0x02; |
|
95 |
const TUint8 KWarningAuthRespAvailable = 0x03; |
|
96 |
const TUint8 KWarningMoreDataAvailable = 0x04; |
|
97 |
const TUint8 KAppErrorAuthMbmsKeyFresh = 0x05; |
|
98 |
const TUint8 KAppErrorAuthMbmsOutOfMemMsk = 0x06; |
|
99 |
const TUint8 KAppErrorAuthMbmsOutOfMemMuk = 0x07; |
|
100 |
const TUint8 KWrongParametersDataNotFound = 0x08; |
|
101 |
const TUint8 KCmdNotAllowedSecurityStatusNotSatisfied = 0x09; |
|
102 |
const TUint8 KUnknownCommandEnding = 0xFF; |
|
103 |
||
104 |
const TUint8 KApduOk = 0x00; |
|
105 |
const TUint8 KApduNok = 0x01; |
|
106 |
||
107 |
const TUint8 KMinLenOfRes = 0x04; |
|
108 |
const TUint8 KMaxLenOfRes = 0x10; |
|
109 |
const TUint8 KLenOfSRes = 0x04; |
|
110 |
const TUint8 KLenOfIk = 0x10; |
|
111 |
const TUint8 KLenOfCk = 0x10; |
|
112 |
const TUint8 KLenOfKc = 0x08; |
|
113 |
const TUint8 KLenOfAuts = 0x0E; |
|
114 |
const TUint8 KMaxMbmsMikeyLen = 0xFB; |
|
115 |
const TUint8 KMaxMbmsSaltLen = 0xFB; |
|
116 |
const TUint8 KMaxApduSize = 0xFF; |
|
117 |
const TUint8 KMaxParentalRatingDataSize = 0x02; |
|
118 |
const TUint8 KMaxSpeSize = 0x01; |
|
119 |
||
120 |
const TUint8 KSuccessfull3GAuthTag = 0xDB; |
|
121 |
const TUint8 KSyncFailureTag = 0xDC; |
|
122 |
const TUint8 KGBABootstappingModeTag = 0xDD; |
|
123 |
const TUint8 KGBANAFDerivationModeTag = 0xDE; |
|
124 |
const TUint8 KMBMSDataObjectTag = 0x53; |
|
125 |
||
126 |
const TUint8 KMskUpdateMode = 0x01; |
|
127 |
const TUint8 KMtkGenerationMode = 0x02; |
|
128 |
const TUint8 KMskDeletionMode = 0x03; |
|
129 |
const TUint8 KSuccessfullMbmsOperationTag = 0xDB; |
|
130 |
const TUint8 KMbmsOperationResponseTag53 = 0x53; |
|
131 |
const TUint8 KMbmsOperationResponseTag73 = 0x73; |
|
132 |
const TUint8 KOMABcastOperationResponseTag = 0xAE; |
|
133 |
const TUint8 KBcastManagementDataTag = 0x80; |
|
134 |
const TUint8 KParentalRatingDataTag = 0x8A; |
|
135 |
const TUint8 KSPETypeNotSupportedTag = 0x8B; |
|
136 |
const TUint8 KMikeyMessageTag = 0x8C; |
|
137 |
const TUint8 KTekDataTag = 0x86; |
|
138 |
const TUint8 KSaltDataTag = 0x87; |
|
139 |
const TUint8 KParentalControlTag = 0x88; |
|
140 |
||
141 |
const TUint8 KServiceGBA = 0x44; // service no 68 |
|
142 |
const TUint8 KServiceMBMSsecurity = 0x45; // service no 69 |
|
143 |
||
144 |
||
145 |
// MACROS |
|
146 |
//None |
|
147 |
||
148 |
// LOCAL CONSTANTS AND MACROS |
|
149 |
//None |
|
150 |
||
151 |
// MODULE DATA STRUCTURES |
|
152 |
//None |
|
153 |
||
154 |
// LOCAL FUNCTION PROTOTYPES |
|
155 |
//None |
|
156 |
||
157 |
// ============================= LOCAL FUNCTIONS =============================== |
|
158 |
//None |
|
159 |
||
160 |
// ============================ MEMBER FUNCTIONS =============================== |
|
161 |
||
162 |
// ----------------------------------------------------------------------------- |
|
163 |
// CMmCustomMessHandler::CMmCustomMessHandler |
|
164 |
// C++ default constructor |
|
165 |
// ----------------------------------------------------------------------------- |
|
166 |
// |
|
167 |
CMmCustomMessHandler::CMmCustomMessHandler() |
|
168 |
{ |
|
169 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CMmCustomMessHandler.\n" ); |
|
170 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CMMCUSTOMMESSHANDLER, "CMmCustomMessHandler::CMmCustomMessHandler" ); |
|
171 |
iSimCBTopicToBeDeleted = KUnusedCbMsgId; |
|
172 |
// Set to true because it doesn't delete topic at start up |
|
173 |
iTopicInSimMemoryDelete = ETrue; |
|
174 |
} |
|
175 |
||
176 |
// ----------------------------------------------------------------------------- |
|
177 |
// CMmCustomMessHandler::~CMmCustomMessHandler |
|
178 |
// Destructor, deletes all allocated resources. |
|
179 |
// ----------------------------------------------------------------------------- |
|
180 |
// |
|
181 |
CMmCustomMessHandler::~CMmCustomMessHandler() |
|
182 |
{ |
|
183 |
TFLOGSTRING("TSY: CMmCustomMessHandler::~CMmCustomMessHandler.\n" ); |
|
184 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_CMMCUSTOMMESSHANDLER, "CMmCustomMessHandler::~CMmCustomMessHandler" ); |
|
185 |
||
186 |
if( iListOfCiphValues ) |
|
187 |
{ |
|
188 |
//close the array of ciphering values |
|
189 |
iListOfCiphValues->Close(); |
|
190 |
//delete the list of ciphering values |
|
191 |
delete iListOfCiphValues; |
|
192 |
} |
|
193 |
} |
|
194 |
||
195 |
// ----------------------------------------------------------------------------- |
|
196 |
// CMmCustomMessHandler::NewL |
|
197 |
// Two-phased constructor. |
|
198 |
// ----------------------------------------------------------------------------- |
|
199 |
// |
|
200 |
CMmCustomMessHandler* CMmCustomMessHandler::NewL |
|
201 |
( |
|
202 |
CMmPhoNetSender* aPhoNetSender, // pointer to the phonet sender |
|
203 |
CMmPhoNetReceiver* aPhoNetReceiver, // pointer to the phonet sender |
|
204 |
CMmNetMessHandler* aNetMessHandler, // pointer to the Net messHandler |
|
205 |
CMmSecurityMessHandler* aSecurityMessHandler, // pointer to the security |
|
206 |
CMmMessageRouter* aMessageRouter, //pointer to the message router |
|
207 |
CMmUiccMessHandler* aUiccMessHandler |
|
208 |
) |
|
209 |
{ |
|
210 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NewL.\n" ); |
|
211 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NEWL, "CMmCustomMessHandler::NewL" ); |
|
212 |
||
213 |
CMmCustomMessHandler* customMessHandler = |
|
214 |
new( ELeave ) CMmCustomMessHandler(); |
|
215 |
||
216 |
CleanupStack::PushL( customMessHandler ); |
|
217 |
customMessHandler->iPhoNetSender = aPhoNetSender; |
|
218 |
customMessHandler->iNetMessHandler = aNetMessHandler; |
|
219 |
customMessHandler->iSecurityMessHandler = aSecurityMessHandler; |
|
220 |
customMessHandler->iMessageRouter = aMessageRouter; |
|
221 |
customMessHandler->iMmUiccMessHandler = aUiccMessHandler; |
|
222 |
||
223 |
customMessHandler->ConstructL(); |
|
224 |
||
225 |
// CALL |
|
226 |
aPhoNetReceiver->RegisterL( |
|
227 |
customMessHandler, |
|
228 |
PN_MODEM_CALL ); |
|
229 |
||
230 |
// NETWORK |
|
231 |
aPhoNetReceiver->RegisterL( |
|
232 |
customMessHandler, |
|
233 |
PN_MODEM_NETWORK ); |
|
234 |
||
235 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
236 |
||
237 |
// TO BE DONE WITH INFO_PP_DATA_READ_RESP |
|
238 |
aPhoNetReceiver->RegisterL( |
|
239 |
customMessHandler, |
|
240 |
PN_INFO, |
|
241 |
INFO_PP_READ_RESP ); |
|
242 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
243 |
// SS |
|
244 |
aPhoNetReceiver->RegisterL( |
|
245 |
customMessHandler, |
|
246 |
PN_SS, |
|
247 |
SS_SERVICE_COMPLETED_IND ); |
|
248 |
aPhoNetReceiver->RegisterL( |
|
249 |
customMessHandler, |
|
250 |
PN_SS, |
|
251 |
SS_SERVICE_FAILED_RESP ); |
|
252 |
aPhoNetReceiver->RegisterL( |
|
253 |
customMessHandler, |
|
254 |
PN_SS, |
|
255 |
SS_GSM_USSD_SEND_RESP ); |
|
256 |
||
257 |
// GSS |
|
258 |
aPhoNetReceiver->RegisterL( |
|
259 |
customMessHandler, |
|
260 |
PN_GSS, |
|
261 |
GSS_CS_SERVICE_RESP ); |
|
262 |
aPhoNetReceiver->RegisterL( |
|
263 |
customMessHandler, |
|
264 |
PN_GSS, |
|
265 |
GSS_CS_SERVICE_FAIL_RESP ); |
|
266 |
aPhoNetReceiver->RegisterL( |
|
267 |
customMessHandler, |
|
268 |
PN_GSS, |
|
269 |
GSS_HSXPA_USER_SETTING_READ_RESP ); |
|
270 |
aPhoNetReceiver->RegisterL( |
|
271 |
customMessHandler, |
|
272 |
PN_GSS, |
|
273 |
GSS_HSXPA_USER_SETTING_WRITE_RESP ); |
|
274 |
aPhoNetReceiver->RegisterL( |
|
275 |
customMessHandler, |
|
276 |
PN_GSS, |
|
277 |
GSS_HSXPA_USER_SETTING_IND ); |
|
278 |
||
279 |
// PMM |
|
280 |
/* To be done in CPS |
|
281 |
aPhoNetReceiver->RegisterL( customMessHandler, |
|
282 |
PN_PERMANENT_DATA, |
|
283 |
PERM_PM_RECORD_READ_RESP ); |
|
284 |
||
285 |
aPhoNetReceiver->RegisterL( customMessHandler, |
|
286 |
PN_PERMANENT_DATA, |
|
287 |
PERM_PM_RECORD_WRITE_RESP );*/ |
|
288 |
||
289 |
// UICC |
|
290 |
aPhoNetReceiver->RegisterL( |
|
291 |
customMessHandler, |
|
292 |
PN_UICC, |
|
293 |
UICC_CARD_IND); |
|
294 |
||
295 |
CleanupStack::Pop( customMessHandler ); |
|
296 |
||
297 |
// Send PERM_PM_RECORD_READ_REQ and update |
|
298 |
// iCallLifeTimer. |
|
299 |
customMessHandler->ReadLifeTimerFromPermanentMemory ( KCustomTransId ); |
|
300 |
||
301 |
return customMessHandler; |
|
302 |
} |
|
303 |
||
304 |
// ----------------------------------------------------------------------------- |
|
305 |
// CMmCustomMessHandler::ConstructL |
|
306 |
// Symbian 2nd phase constructor can leave. |
|
307 |
// ----------------------------------------------------------------------------- |
|
308 |
// |
|
309 |
void CMmCustomMessHandler::ConstructL() |
|
310 |
{ |
|
311 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ConstructL.\n" ); |
|
312 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CONSTRUCTL, "CMmCustomMessHandler::ConstructL" ); |
|
313 |
||
314 |
// Initialize iListOfCiphValues |
|
315 |
iListOfCiphValues = new ( ELeave ) RArray<TCiphListEntry>( 1 ); |
|
316 |
||
317 |
// Initialize refresh indication boolean |
|
318 |
iIsRefresh = EFalse; |
|
319 |
||
320 |
// Initialize ECID boolean |
|
321 |
iECIDInfoRequested = EFalse; |
|
322 |
||
323 |
// Initialize ECID information |
|
324 |
iECIDInfo.iMCC = 0; // Mobile Country Code |
|
325 |
iECIDInfo.iMNC = 0; // Mobile Network Code |
|
326 |
iECIDInfo.iCID = 0; // Cell identity |
|
327 |
iECIDInfo.iLAC = 0; // Location area code |
|
328 |
||
329 |
// Initialize Call Life Timer value. |
|
330 |
iCallLifeTimer = KCallLifeTimerNotSet; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
331 |
|
0 | 332 |
// initialize ISim application activation status |
333 |
iIsimApplActivated = EFalse; |
|
334 |
} |
|
335 |
||
336 |
// ----------------------------------------------------------------------------- |
|
337 |
// CMmCustomMessHandler::ReceiveMessageL |
|
338 |
// Entry point for messages received from Domestic OS. Switches the message |
|
339 |
// to the correct method. |
|
340 |
// (other items were commented in a header). |
|
341 |
// ----------------------------------------------------------------------------- |
|
342 |
// |
|
343 |
void CMmCustomMessHandler::ReceiveMessageL |
|
344 |
( |
|
345 |
const TIsiReceiveC& aIsiMessage // ISI-message received |
|
346 |
) |
|
347 |
{ |
|
348 |
TInt resource( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) ); |
|
349 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
350 |
||
351 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::ReceiveMessageL, Resource: %d, Message: %d", resource, messageId); |
|
352 |
OstTraceExt2( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL;resource=%d;messageId=%d", resource, messageId ); |
|
353 |
||
354 |
switch( resource ) |
|
355 |
{ |
|
356 |
case PN_MODEM_CALL: |
|
357 |
{ |
|
358 |
// switch according to the message id |
|
359 |
// and call the appropriate messagehandler method |
|
360 |
switch( messageId ) |
|
361 |
{ |
|
362 |
case CALL_MODEM_RELEASE_RESP: |
|
363 |
{ |
|
364 |
CallReleaseResp( aIsiMessage ); |
|
365 |
break; |
|
366 |
} |
|
367 |
case CALL_MODEM_NOTIFICATION_IND: |
|
368 |
{ |
|
369 |
CallGsmNotificationInd( aIsiMessage ); |
|
370 |
break; |
|
371 |
} |
|
372 |
case CALL_MODEM_MO_ALERT_IND: |
|
373 |
{ |
|
374 |
CallMoAlertInd( aIsiMessage ); |
|
375 |
break; |
|
376 |
} |
|
377 |
case CALL_MODEM_TERMINATED_IND: |
|
378 |
{ |
|
379 |
CallTerminateInd( aIsiMessage ); |
|
380 |
break; |
|
381 |
} |
|
382 |
case CALL_MODEM_RELEASE_IND: |
|
383 |
{ |
|
384 |
CallReleaseInd( aIsiMessage ); |
|
385 |
break; |
|
386 |
} |
|
387 |
case CALL_MODEM_BLACKLIST_CLEAR_RESP: |
|
388 |
{ |
|
389 |
CallGsmBlackListClearResp(); |
|
390 |
break; |
|
391 |
} |
|
392 |
case CALL_MODEM_EMERG_NBR_CHECK_RESP: |
|
393 |
{ |
|
394 |
CallEmergencyNbrCheckResp( aIsiMessage ); |
|
395 |
break; |
|
396 |
} |
|
397 |
default: |
|
398 |
{ |
|
399 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL - switch resource - case PN_MODEM_CALL, switch messageId - default"); |
|
400 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL- switch resource - case PN_CALL, switch messageId - default" ); |
|
401 |
break; |
|
402 |
} |
|
403 |
} |
|
404 |
break; |
|
405 |
} |
|
406 |
case PN_GSS: |
|
407 |
{ |
|
408 |
// switch according to the message id |
|
409 |
// and call the appropriate messagehandler method |
|
410 |
switch( messageId ) |
|
411 |
{ |
|
412 |
case GSS_CS_SERVICE_RESP: |
|
413 |
{ |
|
414 |
GssCsServiceResp( aIsiMessage ); |
|
415 |
break; |
|
416 |
} |
|
417 |
case GSS_CS_SERVICE_FAIL_RESP: |
|
418 |
{ |
|
419 |
GssCsServiceFailResp( aIsiMessage ); |
|
420 |
break; |
|
421 |
} |
|
422 |
case GSS_HSXPA_USER_SETTING_READ_RESP: |
|
423 |
{ |
|
424 |
ReadHSxPAStatusResp( aIsiMessage ); |
|
425 |
break; |
|
426 |
} |
|
427 |
case GSS_HSXPA_USER_SETTING_WRITE_RESP: |
|
428 |
{ |
|
429 |
WriteHSxPAStatusResp( aIsiMessage ); |
|
430 |
break; |
|
431 |
} |
|
432 |
case GSS_HSXPA_USER_SETTING_IND: |
|
433 |
{ |
|
434 |
HSxPASettingInd( aIsiMessage ); |
|
435 |
break; |
|
436 |
} |
|
437 |
default: |
|
438 |
{ |
|
439 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL - switch resource - case PN_GSS, switch messageId - default"); |
|
440 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL- switch resource - case PN_GSS, switch messageId - default" ); |
|
441 |
break; |
|
442 |
} |
|
443 |
} |
|
444 |
break; // end case PN_GSS |
|
445 |
} |
|
446 |
case PN_MODEM_NETWORK: |
|
447 |
{ |
|
448 |
// switch according to the message id |
|
449 |
// and call the appropriate messagehandler method |
|
450 |
switch( messageId ) |
|
451 |
{ |
|
452 |
case NET_CS_WAKEUP_RESP: |
|
453 |
{ |
|
454 |
NetCsWakeupResp(); |
|
455 |
break; |
|
456 |
} |
|
457 |
case NET_MODEM_REG_STATUS_IND: |
|
458 |
{ |
|
459 |
NetModemRegStatusInd( aIsiMessage ); |
|
460 |
break; |
|
461 |
} |
|
462 |
case NET_CIPHERING_IND: |
|
463 |
{ |
|
464 |
NetCipheringInd( aIsiMessage ); |
|
465 |
break; |
|
466 |
} |
|
467 |
case NET_MODEM_REG_STATUS_GET_RESP: |
|
468 |
{ |
|
469 |
NetModemRegStatusGetResp( aIsiMessage ); |
|
470 |
break; |
|
471 |
} |
|
472 |
case NET_SET_RESP: |
|
473 |
{ |
|
474 |
NetSetResp( aIsiMessage ); |
|
475 |
break; |
|
476 |
} |
|
477 |
case NET_RAT_RESP: |
|
478 |
{ |
|
479 |
NetRatResp( aIsiMessage ); |
|
480 |
break; |
|
481 |
} |
|
482 |
case NET_NEIGHBOUR_CELLS_RESP: |
|
483 |
{ |
|
484 |
NetNeighbourCellsResp( aIsiMessage ); |
|
485 |
break; |
|
486 |
} |
|
487 |
default: |
|
488 |
{ |
|
489 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL - switch resource - case PN_MODEM_NETWORK, switch messageId - default"); |
|
490 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL- switch resource - case PN_MODEM_NETWORK, switch messageId - default" ); |
|
491 |
break; |
|
492 |
} |
|
493 |
} |
|
494 |
break; |
|
495 |
} |
|
496 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
497 |
case PN_INFO: |
|
498 |
#else /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
499 |
case PN_MODEM_INFO: |
|
500 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
501 |
{ |
|
502 |
// switch according to the message id |
|
503 |
// and call the appropriate messagehandler method |
|
504 |
switch( messageId ) |
|
505 |
{ |
|
506 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
507 |
// TO BE DONE WITH INFO_PP_DATA_READ_RESP |
|
508 |
case INFO_PP_READ_RESP: |
|
509 |
{ |
|
510 |
InfoPpReadResp( aIsiMessage ); |
|
511 |
break; |
|
512 |
} |
|
513 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
514 |
default: |
|
515 |
{ |
|
516 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL - switch resource - case PN_INFO, switch messageId - default"); |
|
517 |
OstTrace0( TRACE_NORMAL, DUP6_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL- switch resource - case PN_INFO, switch messageId - default" ); |
|
518 |
break; |
|
519 |
} |
|
520 |
} |
|
521 |
break; |
|
522 |
} |
|
523 |
case PN_SS: |
|
524 |
{ |
|
525 |
switch( messageId ) |
|
526 |
{ |
|
527 |
case SS_SERVICE_COMPLETED_IND: |
|
528 |
{ |
|
529 |
SsServiceCompletedInd( aIsiMessage ); |
|
530 |
break; |
|
531 |
} |
|
532 |
case SS_SERVICE_FAILED_RESP: |
|
533 |
{ |
|
534 |
SsServiceFailedResp( aIsiMessage ); |
|
535 |
break; |
|
536 |
} |
|
537 |
case SS_GSM_USSD_SEND_RESP: |
|
538 |
{ |
|
539 |
SsGsmUssdSendResp( aIsiMessage ); |
|
540 |
break; |
|
541 |
} |
|
542 |
default: |
|
543 |
{ |
|
544 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL - switch resource - case PN_SS, switch messageId - default"); |
|
545 |
OstTrace0( TRACE_NORMAL, DUP12_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL- switch resource - case PN_SS, switch messageId - default" ); |
|
546 |
break; |
|
547 |
} |
|
548 |
} |
|
549 |
break; |
|
550 |
} |
|
551 |
/* To be done in CPS |
|
552 |
case PN_PERMANENT_DATA: |
|
553 |
{ |
|
554 |
if ( KCustomTransId == aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ) |
|
555 |
{ |
|
556 |
switch( messageId ) |
|
557 |
{ |
|
558 |
case PERM_PM_RECORD_READ_RESP: |
|
559 |
{ |
|
560 |
LifeTimerFromPermanentMemoryReadResponse( aIsiMessage ); |
|
561 |
break; |
|
562 |
} |
|
563 |
||
564 |
case PERM_PM_RECORD_WRITE_RESP: |
|
565 |
{ |
|
566 |
LifeTimerToPermanentMemoryWriteResponse( aIsiMessage ); |
|
567 |
break; |
|
568 |
} |
|
569 |
||
570 |
default: |
|
571 |
{ |
|
572 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL\ |
|
573 |
- switch resource - case PN_PERMANENT_DATA, switch messageId - default.\n"); |
|
574 |
OstTrace0( TRACE_NORMAL, DUP16_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL - switch resource - case PN_PERMANENT_DATA, switch messageId - default." ); |
|
575 |
break; |
|
576 |
} |
|
577 |
} |
|
578 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL\ |
|
579 |
- switch resource - case PN_PERMANENT_DATA, transaction id is not KCustomTransId\n"); |
|
580 |
OstTrace0( TRACE_NORMAL, DUP14_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL - switch resource - case PN_PERMANENT_DATA, transaction id is not KCustomTransId" ); |
|
581 |
} |
|
582 |
break; |
|
583 |
}*/ |
|
584 |
||
585 |
case PN_UICC: |
|
586 |
{ |
|
587 |
if( UICC_CARD_IND == messageId ) |
|
588 |
{ |
|
589 |
UiccCardInd( aIsiMessage ); |
|
590 |
} |
|
591 |
break; |
|
592 |
} |
|
593 |
default: |
|
594 |
{ |
|
595 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReceiveMessageL - switch resource - default" ); |
|
596 |
OstTrace0( TRACE_NORMAL, DUP13_CMMCUSTOMMESSHANDLER_RECEIVEMESSAGEL, "CMmCustomMessHandler::ReceiveMessageL- switch resource - default" ); |
|
597 |
break; // server not known |
|
598 |
} |
|
599 |
} // end of switch |
|
600 |
} |
|
601 |
||
602 |
// ----------------------------------------------------------------------------- |
|
603 |
// CMmCustomMessHandler::CallReleaseReq |
|
604 |
// Constructs CALL_MODEM_RELEASE_REQ ISI message from input parameters and sends |
|
605 |
// it through phonet. HangUp request message. |
|
606 |
// (other items were commented in a header). |
|
607 |
// ----------------------------------------------------------------------------- |
|
608 |
// |
|
609 |
TInt CMmCustomMessHandler::CallReleaseReq |
|
610 |
( |
|
611 |
TUint8 aTransactionId, //transaction id |
|
612 |
TUint8 aCallId, //call id |
|
613 |
TUint8 aCause //cause value for releasing the call |
|
614 |
) |
|
615 |
{ |
|
616 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallReleaseReq.\n" ); |
|
617 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLRELEASEREQ, "CMmCustomMessHandler::CallReleaseReq" ); |
|
618 |
||
619 |
iReleaseCauseValueSent = aCause; |
|
620 |
||
621 |
//Append data for ISI message |
|
622 |
TBuf8< 2 + SIZE_CALL_MODEM_SB_CAUSE > messageBuf; |
|
623 |
||
624 |
messageBuf.Append( aCallId ); |
|
625 |
messageBuf.Append( 1 ); // Num of Subblocks |
|
626 |
||
627 |
//Call_Release_Req sub block |
|
628 |
messageBuf.Append( CALL_MODEM_SB_CAUSE ); |
|
629 |
messageBuf.Append( SIZE_CALL_MODEM_SB_CAUSE ); |
|
630 |
messageBuf.Append( CALL_MODEM_CAUSE_TYPE_CLIENT ); |
|
631 |
messageBuf.Append( aCause ); |
|
632 |
||
633 |
//send message via phonet |
|
634 |
return iPhoNetSender->Send( PN_MODEM_CALL, aTransactionId, CALL_MODEM_RELEASE_REQ, |
|
635 |
messageBuf ); |
|
636 |
} |
|
637 |
||
638 |
// ----------------------------------------------------------------------------- |
|
639 |
// CMmCustomMessHandler::CallReleaseResp |
|
640 |
// Breaks response to the HangUp request. In case of failure, HangUp is |
|
641 |
// completed to the Symbian OS layer. Otherwise HangUp handle the success case. |
|
642 |
// (other items were commented in a header). |
|
643 |
// ----------------------------------------------------------------------------- |
|
644 |
// |
|
645 |
void CMmCustomMessHandler::CallReleaseResp |
|
646 |
( |
|
647 |
const TIsiReceiveC& aIsiMsg //received ISI message |
|
648 |
) |
|
649 |
{ |
|
650 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallReleaseResp.\n" ); |
|
651 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLRELEASERESP, "CMmCustomMessHandler::CallReleaseResp" ); |
|
652 |
||
653 |
//initialize the causeType and causeValue |
|
654 |
TUint8 causeType = 0; |
|
655 |
TUint8 causeValue = 0; |
|
656 |
TInt ret = KErrNone; |
|
657 |
||
658 |
TUint sbStartOffSet( 0 ); |
|
659 |
||
660 |
//get cause sub block |
|
661 |
//if subblock is present |
|
662 |
if( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
663 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_RELEASE_RESP, CALL_MODEM_SB_CAUSE, |
|
664 |
EIsiSubBlockTypeId8Len8, sbStartOffSet ) ) |
|
665 |
{ |
|
666 |
//get cause type |
|
667 |
causeType = aIsiMsg.Get8bit( sbStartOffSet + |
|
668 |
CALL_MODEM_SB_CAUSE_OFFSET_CAUSETYPE ); |
|
669 |
||
670 |
//get cause value |
|
671 |
causeValue = aIsiMsg.Get8bit( sbStartOffSet + |
|
672 |
CALL_MODEM_SB_CAUSE_OFFSET_CAUSE ); |
|
673 |
||
674 |
if( iReleaseCauseValueSent != causeValue ) |
|
675 |
{ |
|
676 |
//map error value to ETEL error value |
|
677 |
ret = CMmStaticUtility::CSCauseToEpocError ( PN_MODEM_CALL, |
|
678 |
causeType, causeValue ); |
|
679 |
} |
|
680 |
} |
|
681 |
// no packed parameters for completion |
|
682 |
iMessageRouter->Complete( ECustomTerminateCallIPC, ret ); |
|
683 |
} |
|
684 |
||
685 |
// ----------------------------------------------------------------------------- |
|
686 |
// CMmCustomMessHandler::CallMoAlertInd |
|
687 |
// This method breaks the CallMo alerting indication message. |
|
688 |
// Trying to find Remote alerting information. In success case |
|
689 |
// send LocalRemoteAlertToneRequired value to SOS layer. |
|
690 |
// (other items were commented in a header). |
|
691 |
// ----------------------------------------------------------------------------- |
|
692 |
// |
|
693 |
void CMmCustomMessHandler::CallMoAlertInd |
|
694 |
( |
|
695 |
const TIsiReceiveC& aIsiMsg //received ISI message |
|
696 |
) |
|
697 |
{ |
|
698 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallMoAlertInd."); |
|
699 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLMOALERTIND, "CMmCustomMessHandler::CallMoAlertInd" ); |
|
700 |
||
701 |
TBool playRemoteAlertToneLocally( EFalse ); |
|
702 |
TUint sbStartOffSet( 0 ); |
|
703 |
||
704 |
// Get call alerting info sub block |
|
705 |
// if subblock was found |
|
706 |
if( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
707 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_MO_ALERT_IND, |
|
708 |
CALL_MODEM_SB_ALERTING_INFO, |
|
709 |
EIsiSubBlockTypeId8Len8, |
|
710 |
sbStartOffSet ) ) |
|
711 |
{ |
|
712 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallMoAlertInd,\ |
|
713 |
- CALL_MODEM_SB_ALERTING_INFO sub block found."); |
|
714 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_CALLMOALERTIND, "CMmCustomMessHandler::CallMoAlertInd, CALL_MODEM_SB_ALERTING_INFO sub block found" ); |
|
715 |
||
716 |
// Get alerting info |
|
717 |
TUint8 callAlertingInfo( aIsiMsg.Get8bit( |
|
718 |
sbStartOffSet + CALL_MODEM_SB_ALERTING_INFO_OFFSET_ALERTINGINFO ) ); |
|
719 |
||
720 |
// If LSB is "1" inform that remote alerting tone |
|
721 |
// should be generated locally. |
|
722 |
if ( callAlertingInfo & 0x01 ) |
|
723 |
{ |
|
724 |
playRemoteAlertToneLocally = ETrue; |
|
725 |
} |
|
726 |
} |
|
727 |
||
728 |
// Complete remote alerting tone notification |
|
729 |
// parameter for SOS layer: a TBool playRemoteAlertToneLocally |
|
730 |
CMmDataPackage dataPackage; |
|
731 |
dataPackage.PackData( &playRemoteAlertToneLocally ); |
|
732 |
iMessageRouter->Complete( ECustomGetRemoteAlertingToneStatusIPC, |
|
733 |
&dataPackage, |
|
734 |
KErrNone ); |
|
735 |
} |
|
736 |
||
737 |
// ----------------------------------------------------------------------------- |
|
738 |
// CMmCustomMessHandler::UiccReadCiReq |
|
739 |
// Read ciphering indicator status from UICC |
|
740 |
// ----------------------------------------------------------------------------- |
|
741 |
// |
|
742 |
TInt CMmCustomMessHandler::UiccReadCiReq( TInt aTrId ) |
|
743 |
{ |
|
744 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccReadCiReq, transaction ID: %d", aTrId ); |
|
745 |
OstTrace1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADCIREQ, "CMmCustomMessHandler::UiccReadCiReq;aTrId=%d", aTrId ); |
|
746 |
||
747 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
748 |
TUiccReadTransparent params; |
|
749 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
750 |
params.trId = static_cast<TUiccTrId>( aTrId ); |
|
751 |
// We need to know the CI status info which is located in byte 3 in EF AD |
|
752 |
// b1=0: ciphering indicator feature disabled |
|
753 |
// b1=1: ciphering indicator feature enabled |
|
754 |
params.dataAmount = 1; |
|
755 |
params.dataOffset = 2; |
|
756 |
params.fileId = KElemFileAdministrativeData; |
|
757 |
params.fileIdSfi = 3; |
|
758 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
759 |
||
760 |
// File id path |
|
761 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
762 |
params.filePath.Append( KMasterFileId ); |
|
763 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
764 |
||
765 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
766 |
} |
|
767 |
||
768 |
// ----------------------------------------------------------------------------- |
|
769 |
// CMmCustomMessHandler::UiccReadCiResp |
|
770 |
// Complete ciphering indicator status |
|
771 |
// ----------------------------------------------------------------------------- |
|
772 |
// |
|
773 |
void CMmCustomMessHandler::UiccReadCiResp( |
|
774 |
TInt aStatus, |
|
775 |
TInt aTrId, |
|
776 |
const TDesC8& aFileData ) |
|
777 |
{ |
|
778 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadCiResp" ); |
|
779 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADCIRESP, "CMmCustomMessHandler::UiccReadCiResp" ); |
|
780 |
||
781 |
TInt ret( KErrNone ); |
|
782 |
TBool cipherIndicatorStatus( EFalse ); |
|
783 |
||
784 |
if( UICC_STATUS_OK == aStatus ) |
|
785 |
{ |
|
786 |
// Get ciphering indicator info ( bit 0) |
|
787 |
TUint8 cipheringIndicator(aFileData[0] & 0x01 ); |
|
788 |
if ( cipheringIndicator ) |
|
789 |
{ |
|
790 |
cipherIndicatorStatus = ETrue; |
|
791 |
} |
|
792 |
} |
|
793 |
else |
|
794 |
{ |
|
795 |
ret = KErrNotFound; |
|
796 |
} |
|
797 |
||
798 |
if ( ETrIdReadCipheringIndicatorStatusCustom == aTrId ) |
|
799 |
{ |
|
800 |
// Complete GetCipheringInfo |
|
801 |
// packed parameter: TBool (ciphering indicator required/not required) |
|
802 |
CMmDataPackage dataPackage; |
|
803 |
dataPackage.PackData( &cipherIndicatorStatus ); |
|
804 |
iMessageRouter->Complete( |
|
805 |
ECustomGetCipheringInfoIPC, |
|
806 |
&dataPackage, |
|
807 |
ret ); |
|
808 |
} |
|
809 |
else if( ETrIdNotifyCipheringIndicatorStatusCustom == aTrId ) |
|
810 |
{ |
|
811 |
CMmDataPackage dataPackage; |
|
812 |
TCiphListEntry chiplistentry; |
|
813 |
chiplistentry.iTraId = aTrId; |
|
814 |
||
815 |
// Find the right value of ciphering for this resp message |
|
816 |
TInt index ( iListOfCiphValues->Find( chiplistentry, Match ) ); |
|
817 |
||
818 |
// If the right value is found |
|
819 |
if ( KErrNotFound != index ) |
|
820 |
{ |
|
821 |
TBool cipheringOn( ( *iListOfCiphValues )[index ].iCiphStatus ); |
|
822 |
dataPackage.PackData( &cipherIndicatorStatus, &cipheringOn ); |
|
823 |
||
824 |
// Delete the used ciphering value from the list |
|
825 |
iListOfCiphValues->Remove( index ); |
|
826 |
// Compress the list |
|
827 |
iListOfCiphValues->Compress(); |
|
828 |
} |
|
829 |
else |
|
830 |
{ |
|
831 |
TBool constantFalse( EFalse ); |
|
832 |
dataPackage.PackData( &constantFalse, &constantFalse ); |
|
833 |
ret = KErrGeneral; |
|
834 |
} |
|
835 |
||
836 |
iMessageRouter->Complete( |
|
837 |
ECustomNotifyCipheringInfoChangeIPC, |
|
838 |
&dataPackage, |
|
839 |
ret ); |
|
840 |
} |
|
841 |
//No else |
|
842 |
} |
|
843 |
||
844 |
// ----------------------------------------------------------------------------- |
|
845 |
// CMmCustomMessHandler::NetCsWakeupReq |
|
846 |
// Constructs NET_CS_WAKEUP_REQ ISI message from input parameters and sends |
|
847 |
// it through phonet. |
|
848 |
// (other items were commented in a header). |
|
849 |
// ----------------------------------------------------------------------------- |
|
850 |
// |
|
851 |
TInt CMmCustomMessHandler::NetCsWakeupReq( TUint8 aTransId ) |
|
852 |
{ |
|
853 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetCsWakeupReq.\n" ); |
|
854 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETCSWAKEUPREQ, "CMmCustomMessHandler::NetCsWakeupReq" ); |
|
855 |
||
856 |
//Data buffer length is 2 |
|
857 |
TBuf8<2> data; |
|
858 |
data.Append( aTransId ); |
|
859 |
data.Append( NET_CS_WAKEUP_REQ ); |
|
860 |
||
861 |
TIsiSend isimsg( iPhoNetSender->SendBufferDes() ); |
|
862 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_MODEM_NETWORK ); |
|
863 |
isimsg.CopyData( ISI_HEADER_SIZE, data ); |
|
864 |
||
865 |
return( iPhoNetSender->Send( isimsg.Complete() ) ); |
|
866 |
} |
|
867 |
||
868 |
// ----------------------------------------------------------------------------- |
|
869 |
// CMmCustomMessHandler::NetCsWakeupResp |
|
870 |
// Breaks a NET_CS_WAKEUP_RESP ISI message and complete NetWakeup with |
|
871 |
// KErrNone to SOS layer |
|
872 |
// (other items were commented in a header). |
|
873 |
// ----------------------------------------------------------------------------- |
|
874 |
// |
|
875 |
void CMmCustomMessHandler::NetCsWakeupResp() |
|
876 |
{ |
|
877 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetCsWakeupResp.\n" ); |
|
878 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETCSWAKEUPRESP, "CMmCustomMessHandler::NetCsWakeupResp" ); |
|
879 |
||
880 |
//getting this message indicates that the wakeup was successful |
|
881 |
//complete NetWakeup method (no packed parameters) |
|
882 |
iMessageRouter->Complete( ECustomNetWakeupIPC, KErrNone ); |
|
883 |
||
884 |
} |
|
885 |
||
886 |
// ----------------------------------------------------------------------------- |
|
887 |
// CMmCustomMessHandler::NetCipheringInd |
|
888 |
// This method breaks the ciphering indication message. |
|
889 |
// This indication saves the ciphering status and calls SimReadCiReq to get the |
|
890 |
// status of the ciphering indicator |
|
891 |
// (other items were commented in a header). |
|
892 |
// ----------------------------------------------------------------------------- |
|
893 |
// |
|
894 |
void CMmCustomMessHandler::NetCipheringInd( |
|
895 |
const TIsiReceiveC &aIsiMsg ) |
|
896 |
{ |
|
897 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetCipheringInd.\n" ); |
|
898 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETCIPHERINGIND, "CMmCustomMessHandler::NetCipheringInd" ); |
|
899 |
||
900 |
//set chipering to False |
|
901 |
TBool cipher( EFalse ); |
|
902 |
||
903 |
//get the ciphering status |
|
904 |
TUint8 cipheringStatus( aIsiMsg.Get8bit( ISI_HEADER_SIZE + |
|
905 |
NET_CIPHERING_IND_OFFSET_CIPHERINGSTATUS ) ); |
|
906 |
||
907 |
//check the value of the ciphering status |
|
908 |
if ( NET_CIPHERING_INDICATOR_ON == cipheringStatus ) |
|
909 |
{ |
|
910 |
cipher = ETrue; |
|
911 |
} |
|
912 |
||
913 |
TUint8 traId( ETrIdNotifyCipheringIndicatorStatusCustom ); |
|
914 |
||
915 |
//save the ciphering information for later completion in the list. |
|
916 |
//this method has to request the sim to complete, so new indication |
|
917 |
//might come, values must be buffered. |
|
918 |
TCiphListEntry chiplistentry; |
|
919 |
chiplistentry.iTraId = traId; |
|
920 |
chiplistentry.iCiphStatus = cipher; |
|
921 |
iListOfCiphValues->Append( chiplistentry ); |
|
922 |
||
923 |
//get the ciphering indicator information from SIM card |
|
924 |
//the response of this method will call the completion for the |
|
925 |
//notification |
|
926 |
UiccReadCiReq( ETrIdNotifyCipheringIndicatorStatusCustom ); |
|
927 |
} |
|
928 |
||
929 |
// ----------------------------------------------------------------------------- |
|
930 |
// CMmCustomMessHandler::NetModemRegStatusInd |
|
931 |
// This method breaks the NET_MODEM_REG_STATUS_IND message. |
|
932 |
// (other items were commented in a header). |
|
933 |
// ----------------------------------------------------------------------------- |
|
934 |
// |
|
935 |
void CMmCustomMessHandler::NetModemRegStatusInd |
|
936 |
( |
|
937 |
const TIsiReceiveC& aIsiMsg |
|
938 |
) |
|
939 |
{ |
|
940 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetModemRegStatusInd"); |
|
941 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETMODEMREGSTATUSIND, "CMmCustomMessHandler::NetModemRegStatusInd" ); |
|
942 |
||
943 |
if ( 0 != aIsiMsg.Get8bit( |
|
944 |
ISI_HEADER_SIZE + |
|
945 |
NET_MODEM_REG_STATUS_IND_OFFSET_SUBBLOCKCOUNT ) ) |
|
946 |
{ |
|
947 |
TUint sbStartOffSet( 0 ); |
|
948 |
||
949 |
TInt retValue( aIsiMsg.FindSubBlockOffsetById( |
|
950 |
ISI_HEADER_SIZE + SIZE_NET_MODEM_REG_STATUS_IND, |
|
951 |
NET_MODEM_REG_INFO_COMMON, |
|
952 |
EIsiSubBlockTypeId8Len8, |
|
953 |
sbStartOffSet ) ); |
|
954 |
||
955 |
// Check if NET_MODEM_REG_INFO_COMMON sub block is present. |
|
956 |
if ( KErrNone == retValue ) |
|
957 |
{ |
|
958 |
// Get registration status |
|
959 |
TUint8 registrationStatus( aIsiMsg.Get8bit( |
|
960 |
sbStartOffSet + |
|
961 |
NET_MODEM_REG_INFO_COMMON_OFFSET_REGISTRATIONSTATUS ) ); |
|
962 |
||
963 |
TBool nspsIsOn( EFalse ); |
|
964 |
||
965 |
switch ( registrationStatus ) |
|
966 |
{ |
|
967 |
case NET_REG_STATUS_NSPS: |
|
968 |
case NET_REG_STATUS_NSPS_NO_COVERAGE: |
|
969 |
{ |
|
970 |
nspsIsOn = ETrue; |
|
971 |
break; |
|
972 |
} |
|
973 |
case NET_REG_STATUS_NOSERV_NOSIM: |
|
974 |
case NET_REG_STATUS_NOSERV_SIM_REJECTED_BY_NW: |
|
975 |
{ |
|
976 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetModemRegStatusInd, No SIM"); |
|
977 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_NETMODEMREGSTATUSIND, "CMmCustomMessHandler::NetModemRegStatusInd, No SIM" ); |
|
978 |
// Complete NetworkConnectionFailure notification |
|
979 |
// (no packed parameters). |
|
980 |
// If puk code is required notification shouldn't |
|
981 |
// be completed. |
|
982 |
TBool pukCodeRequired( iSecurityMessHandler->GetPukCodeReq() ); |
|
983 |
if( !pukCodeRequired ) |
|
984 |
{ |
|
985 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetModemRegStatusInd - Complete network connection failure"); |
|
986 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_NETMODEMREGSTATUSIND, "CMmCustomMessHandler::NetModemRegStatusInd - Complete network connection failure" ); |
|
987 |
||
988 |
iMessageRouter->Complete( |
|
989 |
ECustomNotifyNetworkConnectionFailureIPC, |
|
990 |
KErrNone ); |
|
991 |
} |
|
992 |
break; |
|
993 |
} |
|
994 |
default: |
|
995 |
{ |
|
996 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetModemRegStatusInd, switch registrationStatus - default"); |
|
997 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_NETMODEMREGSTATUSIND, "CMmCustomMessHandler::NetModemRegStatusInd, switch registrationStatus - default" ); |
|
998 |
break; |
|
999 |
} |
|
1000 |
} |
|
1001 |
||
1002 |
// Inform of the status of NSPS. |
|
1003 |
// Packed parameter: TBool nspsIsOn. |
|
1004 |
CMmDataPackage dataPackage; |
|
1005 |
dataPackage.PackData( &nspsIsOn ); |
|
1006 |
||
1007 |
iMessageRouter->Complete( |
|
1008 |
ECustomNotifyNSPSStatusIPC, |
|
1009 |
&dataPackage, |
|
1010 |
KErrNone ); |
|
1011 |
} |
|
1012 |
// No else |
|
1013 |
||
1014 |
// Check if ECID info needs to be updated. |
|
1015 |
CheckECIDInfo( aIsiMsg ); |
|
1016 |
} |
|
1017 |
// No else |
|
1018 |
} |
|
1019 |
||
1020 |
// ----------------------------------------------------------------------------- |
|
1021 |
// CMmCustomMessHandler::UiccReadDynamic2FlagsReq |
|
1022 |
// Read dynamic 2 flags from UICC |
|
1023 |
// ----------------------------------------------------------------------------- |
|
1024 |
// |
|
1025 |
TInt CMmCustomMessHandler::UiccReadDynamic2FlagsReq() |
|
1026 |
{ |
|
1027 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadDynamic2FlagsReq"); |
|
1028 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADDYNAMIC2FLAGSREQ, "CMmCustomMessHandler::UiccReadDynamic2FlagsReq" ); |
|
1029 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
1030 |
TUiccWriteTransparent params; |
|
1031 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
1032 |
params.trId = ETrIdReadDynamic2Flags; |
|
1033 |
params.dataOffset = 0; |
|
1034 |
params.dataAmount = 0; |
|
1035 |
params.fileId = KElemFileDyn2FlagsOrange; |
|
1036 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
1037 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
1038 |
// File id path |
|
1039 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
1040 |
params.filePath.Append( KMasterFileId ); |
|
1041 |
params.filePath.Append( KOrangeDedicatedFile >> 8 ); |
|
1042 |
params.filePath.Append( KOrangeDedicatedFile ); |
|
1043 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
1044 |
} |
|
1045 |
||
1046 |
// ----------------------------------------------------------------------------- |
|
1047 |
// CMmCustomMessHandler::UiccReadDynamic2FlagsResp |
|
1048 |
// Complete dynamic 2 flags |
|
1049 |
// ----------------------------------------------------------------------------- |
|
1050 |
// |
|
1051 |
void CMmCustomMessHandler::UiccReadDynamic2FlagsResp( |
|
1052 |
TInt aStatus, |
|
1053 |
const TDesC8& aFileData ) |
|
1054 |
{ |
|
1055 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadDynamic2FlagsResp"); |
|
1056 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADDYNAMIC2FLAGSRESP, "CMmCustomMessHandler::UiccReadDynamic2FlagsResp" ); |
|
1057 |
||
1058 |
TInt ret( KErrNone ); |
|
1059 |
RMmCustomAPI::TGetAlsBlockStatus blockStatus |
|
1060 |
( RMmCustomAPI::EBlockStatusUnknown ); |
|
1061 |
||
1062 |
if ( UICC_STATUS_OK == aStatus ) |
|
1063 |
{ |
|
1064 |
// The value of the block status is in the LSB byte |
|
1065 |
if ( aFileData[0] & 0x01 ) |
|
1066 |
{ |
|
1067 |
blockStatus = RMmCustomAPI::EBlockStatusActive; |
|
1068 |
} |
|
1069 |
else |
|
1070 |
{ |
|
1071 |
blockStatus = RMmCustomAPI::EBlockStatusInactive; |
|
1072 |
} |
|
1073 |
} |
|
1074 |
else |
|
1075 |
{ |
|
1076 |
blockStatus = RMmCustomAPI::EBlockStatusNotSupported; |
|
1077 |
ret = KErrNotFound; |
|
1078 |
} |
|
1079 |
||
1080 |
// Complete, packed parameter: TGetAlsBlockStatus (block status) |
|
1081 |
CMmDataPackage dataPackage; |
|
1082 |
dataPackage.PackData( &blockStatus ); |
|
1083 |
iMessageRouter->Complete( |
|
1084 |
ECustomGetAlsBlockedIPC, |
|
1085 |
&dataPackage, |
|
1086 |
ret ); |
|
1087 |
} |
|
1088 |
||
1089 |
// ----------------------------------------------------------------------------- |
|
1090 |
// CMmCustomMessHandler::UiccWriteDynamic2FlagsReq |
|
1091 |
// Write dynamic 2 flags to UICC |
|
1092 |
// ----------------------------------------------------------------------------- |
|
1093 |
// |
|
1094 |
TInt CMmCustomMessHandler::UiccWriteDynamic2FlagsReq( TUint8 aInfo ) |
|
1095 |
{ |
|
1096 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccWriteDynamic2FlagsReq"); |
|
1097 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCWRITEDYNAMIC2FLAGSREQ, "CMmCustomMessHandler::UiccWriteDynamic2FlagsReq" ); |
|
1098 |
||
1099 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
1100 |
TUiccWriteTransparent params; |
|
1101 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
1102 |
params.trId = ETrIdWriteDynamic2Flags; |
|
1103 |
params.dataOffset = 0; |
|
1104 |
params.fileId = KElemFileDyn2FlagsOrange; |
|
1105 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
1106 |
params.serviceType = UICC_APPL_UPDATE_TRANSPARENT; |
|
1107 |
||
1108 |
// File id path |
|
1109 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
1110 |
params.filePath.Append( KMasterFileId ); |
|
1111 |
params.filePath.Append( KOrangeDedicatedFile >> 8 ); |
|
1112 |
params.filePath.Append( KOrangeDedicatedFile ); |
|
1113 |
||
1114 |
params.fileData.Append( aInfo ); |
|
1115 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
1116 |
} |
|
1117 |
||
1118 |
// ----------------------------------------------------------------------------- |
|
1119 |
// CMmCustomMessHandler::UiccWriteDynamic2FlagsResp |
|
1120 |
// Complete write dynamic flags request ro UICC |
|
1121 |
// ----------------------------------------------------------------------------- |
|
1122 |
// |
|
1123 |
void CMmCustomMessHandler::UiccWriteDynamic2FlagsResp( TInt aStatus ) |
|
1124 |
{ |
|
1125 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccWriteDynamic2FlagsReq"); |
|
1126 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCWRITEDYNAMIC2FLAGSRESP, "CMmCustomMessHandler::UiccWriteDynamic2FlagsResp" ); |
|
1127 |
||
1128 |
TInt ret( KErrNone ); |
|
1129 |
||
1130 |
if ( UICC_STATUS_OK != aStatus ) |
|
1131 |
{ |
|
1132 |
ret = KErrGeneral; |
|
1133 |
} |
|
1134 |
||
1135 |
iMessageRouter->Complete( ECustomSetAlsBlockedIPC, ret ); |
|
1136 |
} |
|
1137 |
||
1138 |
// ----------------------------------------------------------------------------- |
|
1139 |
// CMmCustomMessHandler::CallTerminateInd |
|
1140 |
// This method breaks the CALL_MODEM_TERMINATE_IND |
|
1141 |
// indication message. Gets CALL_MODEM_SB_SS_DIAGNOSTICS sub blocks and sets |
|
1142 |
// information into a call object. |
|
1143 |
// (other items were commented in a header). |
|
1144 |
// ----------------------------------------------------------------------------- |
|
1145 |
// |
|
1146 |
void CMmCustomMessHandler::CallTerminateInd |
|
1147 |
( |
|
1148 |
const TIsiReceiveC& aIsiMsg //received ISI message |
|
1149 |
) |
|
1150 |
{ |
|
1151 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallTerminateInd.\n" ); |
|
1152 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLTERMINATEIND, "CMmCustomMessHandler::CallTerminateInd" ); |
|
1153 |
||
1154 |
//unique call id (without possible generic id) |
|
1155 |
TInt callId = static_cast<TInt>( aIsiMsg.Get8bit( ISI_HEADER_SIZE + |
|
1156 |
CALL_MODEM_TERMINATED_IND_OFFSET_CALLID ) & 0x07 ); |
|
1157 |
||
1158 |
if ( CALL_MODEM_ID_NONE != callId ) |
|
1159 |
{ |
|
1160 |
TUint sbStartOffSet( 0 ); |
|
1161 |
||
1162 |
TUint8 ssDiagnostics = 0; |
|
1163 |
||
1164 |
//find sub block |
|
1165 |
if( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
1166 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_TERMINATED_IND, CALL_MODEM_SB_SS_DIAGNOSTICS, |
|
1167 |
EIsiSubBlockTypeId8Len8, sbStartOffSet ) ) |
|
1168 |
{ |
|
1169 |
//get ss diagnostics |
|
1170 |
ssDiagnostics = aIsiMsg.Get8bit( sbStartOffSet + |
|
1171 |
CALL_MODEM_SB_SS_DIAGNOSTICS_OFFSET_DIAGNOSTICS ); |
|
1172 |
||
1173 |
// Set highest bit to 1 if there is some diagnostic information |
|
1174 |
// (This is in accordance with 3GPP TS 24.008 "Mobile radio |
|
1175 |
// interface Layer 3 specification; Core network protocols" and with |
|
1176 |
// Series 60 Supplementary Services UI Specification) |
|
1177 |
if ( 0 != ssDiagnostics ) |
|
1178 |
{ |
|
1179 |
ssDiagnostics |= 0x80; // binary 10000000 |
|
1180 |
TFLOGSTRING3("TSY:CMmCustomMessHandler::CallTerminatedInd: Diagnostic octet=%d received for call id=%d", |
|
1181 |
ssDiagnostics, callId ); |
|
1182 |
OstTraceExt2( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_CALLTERMINATEIND, "CMmCustomMessHandler::CallTerminateInd;Diagnostic octet==%hhu received for call id=%d", ssDiagnostics, callId ); |
|
1183 |
} |
|
1184 |
} |
|
1185 |
||
1186 |
// set the diagnostics in call object (might be zero) |
|
1187 |
// parameters for SOS layer: Call id and TUint8 with diagnostics |
|
1188 |
CMmDataPackage dataPackage; |
|
1189 |
dataPackage.PackData( &callId, &ssDiagnostics ); |
|
1190 |
iMessageRouter->Complete( ECustomGetDiagnosticOctetsIPC, &dataPackage, |
|
1191 |
KErrNone ); |
|
1192 |
||
1193 |
} |
|
1194 |
} |
|
1195 |
||
1196 |
// ----------------------------------------------------------------------------- |
|
1197 |
// CMmCustomMessHandler::CallReleaseInd |
|
1198 |
// This method breaks the CALL_MODEM_RELEASE_IND. |
|
1199 |
// indication message. Gets CALL_MODEM_SB_SS_DIAGNOSTICS sub blocks and sets |
|
1200 |
// information into a call object. |
|
1201 |
// (other items were commented in a header). |
|
1202 |
// ----------------------------------------------------------------------------- |
|
1203 |
// |
|
1204 |
void CMmCustomMessHandler::CallReleaseInd |
|
1205 |
( |
|
1206 |
const TIsiReceiveC& aIsiMsg //received ISI message |
|
1207 |
) |
|
1208 |
{ |
|
1209 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallReleaseInd.\n" ); |
|
1210 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLRELEASEIND, "CMmCustomMessHandler::CallReleaseInd" ); |
|
1211 |
||
1212 |
//unique call id (without possible generic id) |
|
1213 |
TInt callId = static_cast<TInt>( aIsiMsg.Get8bit( ISI_HEADER_SIZE + |
|
1214 |
CALL_MODEM_RELEASE_IND_OFFSET_CALLID ) & 0x07 ); |
|
1215 |
||
1216 |
if ( CALL_MODEM_ID_NONE != callId ) |
|
1217 |
{ |
|
1218 |
TUint sbStartOffSet( 0 ); |
|
1219 |
||
1220 |
TUint8 ssDiagnostics = 0; |
|
1221 |
||
1222 |
//get call operation sub block |
|
1223 |
if( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
1224 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_RELEASE_IND, CALL_MODEM_SB_SS_DIAGNOSTICS, |
|
1225 |
EIsiSubBlockTypeId8Len8, sbStartOffSet ) ) |
|
1226 |
{ |
|
1227 |
//get ss diagnostics |
|
1228 |
ssDiagnostics = aIsiMsg.Get8bit( sbStartOffSet + |
|
1229 |
CALL_MODEM_SB_SS_DIAGNOSTICS_OFFSET_DIAGNOSTICS ); |
|
1230 |
||
1231 |
// Set highest bit to 1 if there is some diagnostic information |
|
1232 |
// (This is in accordance with 3GPP TS 24.008 "Mobile radio |
|
1233 |
// interface Layer 3 specification; Core network protocols" and with |
|
1234 |
// Series 60 Supplementary Services UI Specification) |
|
1235 |
if ( 0 != ssDiagnostics ) |
|
1236 |
{ |
|
1237 |
ssDiagnostics |= 0x80; // binary 10000000 |
|
1238 |
TFLOGSTRING3("TSY:CMmCustomMessHandler::CallReleaseInd: Diagnostic octet=%d received for call id=%d", |
|
1239 |
ssDiagnostics, callId ); |
|
1240 |
OstTraceExt2( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_CALLRELEASEIND, "CMmCustomMessHandler::CallReleaseInd;Diagnostic octet==%hhu received for call id=%d", ssDiagnostics, callId ); |
|
1241 |
} |
|
1242 |
} |
|
1243 |
||
1244 |
// set the diagnostics in call object (might be zero) |
|
1245 |
// parameters for SOS layer: Call id and TUint8 with diagnostics |
|
1246 |
CMmDataPackage dataPackage; |
|
1247 |
dataPackage.PackData( &callId, &ssDiagnostics ); |
|
1248 |
iMessageRouter->Complete( ECustomGetDiagnosticOctetsIPC, &dataPackage, |
|
1249 |
KErrNone ); |
|
1250 |
||
1251 |
} |
|
1252 |
} |
|
1253 |
||
1254 |
||
1255 |
// ----------------------------------------------------------------------------- |
|
1256 |
// CMmCustomMessHandler::InfoPpReadReq |
|
1257 |
// Constructs INFO_PP_READ_REQ ISI message from input parameters and sends |
|
1258 |
// it through phonet. This message can be used to read ALS or Two Digit Dialling |
|
1259 |
// support status in the product profiles from INFO server. |
|
1260 |
// (other items were commented in a header). |
|
1261 |
// ----------------------------------------------------------------------------- |
|
1262 |
// |
|
1263 |
TInt CMmCustomMessHandler::InfoPpReadReq |
|
1264 |
( |
|
1265 |
TProductProfileRequestType aReqType // request type, used as |
|
1266 |
) |
|
1267 |
{ |
|
1268 |
TFLOGSTRING("TSY: CMmCustomMessHandler::InfoPpReadReq.\n" ); |
|
1269 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_INFOPPREADREQ, "CMmCustomMessHandler::InfoPpReadReq" ); |
|
1270 |
||
1271 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
1272 |
//create the buffer for SB_PP subblock |
|
1273 |
TBuf8<SIZE_INFO_SB_PP> sbPPSubBlockBuf( 0 ); |
|
1274 |
TIsiSubBlock sbPPSubBlock( sbPPSubBlockBuf, INFO_SB_PP, EIsiSubBlockTypeId8Len8 ); |
|
1275 |
//add 0x00 as the Dynamic Value ID, not needed cause we want to get |
|
1276 |
//a static value |
|
1277 |
sbPPSubBlockBuf.Append( 0x00 ); |
|
1278 |
||
1279 |
//add 0x01 as the length of the product profile, we want only als |
|
1280 |
//profile, thus lenght is 1 |
|
1281 |
sbPPSubBlockBuf.Append( 0x01 ); |
|
1282 |
||
1283 |
//add the product profile number |
|
1284 |
if ( EGetAlsPPSupport == aReqType ) |
|
1285 |
{ |
|
1286 |
sbPPSubBlockBuf.Append( INFO_PP_ALS ); |
|
1287 |
} |
|
1288 |
else if ( ECheckTwoDigitDialSupport == aReqType ) |
|
1289 |
{ |
|
1290 |
sbPPSubBlockBuf.Append( KinfoPpTwoDigitDial ); |
|
1291 |
} |
|
1292 |
else |
|
1293 |
{ |
|
1294 |
// not supported |
|
1295 |
return KErrArgument; |
|
1296 |
} |
|
1297 |
||
1298 |
//value of the product profile is 0x00, not need cause we are reading |
|
1299 |
sbPPSubBlockBuf.Append( 0x00 ); |
|
1300 |
||
1301 |
// Construct INFO_PP_READ_REQ message (1 data byte + |
|
1302 |
// sub block count + INFO_SB_PP sub block) |
|
1303 |
TBuf8< 2 + SIZE_INFO_SB_PP > infoPpReadReq; |
|
1304 |
||
1305 |
//set pp batch reading to read specific product profile, thus 0. |
|
1306 |
infoPpReadReq.Append( INFO_PP_PROD_PROFILE_FEATURE ); |
|
1307 |
||
1308 |
// add sub block |
|
1309 |
infoPpReadReq.Append( 1 ); // number of sub blocks |
|
1310 |
infoPpReadReq.Append( sbPPSubBlock.CompleteSubBlock() ); |
|
1311 |
||
1312 |
//create the isi message |
|
1313 |
//transaction id = request type |
|
1314 |
TUint8 transId = static_cast<TUint8>( aReqType ); |
|
1315 |
||
1316 |
return iPhoNetSender->Send( PN_INFO, transId, INFO_PP_READ_REQ, infoPpReadReq ); |
|
1317 |
||
1318 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
1319 |
return KErrNone; |
|
1320 |
} |
|
1321 |
||
1322 |
// ----------------------------------------------------------------------------- |
|
1323 |
// CMmCustomMessHandler::InfoPpReadResp |
|
1324 |
// Breaks a INFO_PP_READ_RESP ISI message. This method |
|
1325 |
// gets the status of the ALS or two digit support. |
|
1326 |
// Complete with packed parameter RMmCustomAPI::TAlsSupport or |
|
1327 |
// RMmCustomAPI::TTwoDigitDialSupport to SOS layer. |
|
1328 |
// (other items were commented in a header). |
|
1329 |
// ----------------------------------------------------------------------------- |
|
1330 |
// |
|
1331 |
void CMmCustomMessHandler::InfoPpReadResp |
|
1332 |
( |
|
1333 |
const TIsiReceiveC& aIsiMessage //received ISI message |
|
1334 |
) |
|
1335 |
{ |
|
1336 |
TFLOGSTRING("TSY: CMmCustomMessHandler::InfoPpReadResp.\n" ); |
|
1337 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_INFOPPREADRESP, "CMmCustomMessHandler::InfoPpReadResp" ); |
|
1338 |
#ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING |
|
1339 |
TInt errorValue( KErrGeneral ); |
|
1340 |
||
1341 |
// Get Status |
|
1342 |
TUint8 status = aIsiMessage.Get8bit( ISI_HEADER_SIZE + INFO_PP_READ_RESP_OFFSET_STATUS ); |
|
1343 |
||
1344 |
//initialize the als support with off |
|
1345 |
RMmCustomAPI::TAlsSupport alsSupport( RMmCustomAPI::EAlsSupportOff ); |
|
1346 |
||
1347 |
//initialize two digit support with off |
|
1348 |
RMmCustomAPI::TTwoDigitDialSupport twoDigitDialSupport( |
|
1349 |
RMmCustomAPI::ETwoDigitDialSupportOff ); |
|
1350 |
||
1351 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::InfoPpReadResp - Status: %d", |
|
1352 |
status ); |
|
1353 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_INFOPPREADRESP, "CMmCustomMessHandler::InfoPpReadResp;status=%hhu", status ); |
|
1354 |
||
1355 |
switch ( status ) |
|
1356 |
{ |
|
1357 |
case INFO_OK: |
|
1358 |
{ |
|
1359 |
||
1360 |
TUint sbInfoPpReadStartOffset( 0 ); |
|
1361 |
||
1362 |
||
1363 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( ISI_HEADER_SIZE + SIZE_INFO_PP_READ_RESP, |
|
1364 |
INFO_SB_PP, EIsiSubBlockTypeId8Len8, sbInfoPpReadStartOffset ) ) |
|
1365 |
||
1366 |
{ |
|
1367 |
||
1368 |
TInt length = aIsiMessage.Get8bit( sbInfoPpReadStartOffset + INFO_SB_PP_OFFSET_STRLEN ); |
|
1369 |
||
1370 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::InfoPpReadResp - Info length: %d", |
|
1371 |
length ); |
|
1372 |
OstTrace1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_INFOPPREADRESP, "CMmCustomMessHandler::InfoPpReadResp - Info length=%d", length ); |
|
1373 |
||
1374 |
if ( 1 == length ) |
|
1375 |
{ |
|
1376 |
//introduce the pPFeatures buffer to hold the feature value, |
|
1377 |
//buffer size is 2 |
|
1378 |
TBuf8<KTwo> pPFeatures; |
|
1379 |
||
1380 |
//copy the 2 bytes from product profile |
|
1381 |
pPFeatures.Copy( aIsiMessage.GetData( sbInfoPpReadStartOffset |
|
1382 |
+ INFO_SB_PP_OFFSET_PRODUCTPROFILE, KTwo ) ); |
|
1383 |
||
1384 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::InfoPpReadResp - Info data: %S", |
|
1385 |
&pPFeatures ); |
|
1386 |
OstTraceExt1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_INFOPPREADRESP, "CMmCustomMessHandler::InfoPpReadResp;pPfeatures=%s", pPFeatures ); |
|
1387 |
||
1388 |
//check that product profile is requested one |
|
1389 |
if ( INFO_PP_ALS == pPFeatures [0] ) |
|
1390 |
{ |
|
1391 |
//Get the value of the Als feature |
|
1392 |
if ( 0 != pPFeatures [1] ) |
|
1393 |
{ |
|
1394 |
TFLOGSTRING("TSY: CMmCustomMessHandler::InfoPpReadResp - EAlsSupportOn"); |
|
1395 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_INFOPPREADRESP, "CMmCustomMessHandler::InfoPpReadResp - EAlsSupportOn" ); |
|
1396 |
alsSupport = RMmCustomAPI::EAlsSupportOn; |
|
1397 |
} |
|
1398 |
//set the error value to KErrNone |
|
1399 |
errorValue = KErrNone; |
|
1400 |
} |
|
1401 |
else if ( KinfoPpTwoDigitDial == pPFeatures [0] ) |
|
1402 |
{ |
|
1403 |
//Get the value of the two digit dial feature |
|
1404 |
if ( 0 != pPFeatures [1] ) |
|
1405 |
{ |
|
1406 |
TFLOGSTRING("TSY: CMmCustomMessHandler::InfoPpReadResp - EAlsSupportOff"); |
|
1407 |
OstTrace0( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_INFOPPREADRESP, "CMmCustomMessHandler::InfoPpReadResp - EAlsSupportOff" ); |
|
1408 |
twoDigitDialSupport = |
|
1409 |
RMmCustomAPI::ETwoDigitDialSupportOn; |
|
1410 |
} |
|
1411 |
//set the error value to KErrNone |
|
1412 |
errorValue = KErrNone; |
|
1413 |
} |
|
1414 |
||
1415 |
//No else |
|
1416 |
||
1417 |
} |
|
1418 |
} |
|
1419 |
break; |
|
1420 |
} |
|
1421 |
case INFO_FAIL: |
|
1422 |
{ |
|
1423 |
//error in operation |
|
1424 |
errorValue = KErrGeneral; |
|
1425 |
break; |
|
1426 |
} |
|
1427 |
case INFO_NO_NUMBER: |
|
1428 |
{ |
|
1429 |
//information is not found |
|
1430 |
errorValue = KErrNotFound; |
|
1431 |
break; |
|
1432 |
} |
|
1433 |
default: |
|
1434 |
{ |
|
1435 |
TFLOGSTRING("TSY: CMmCustomMessHandler::InfoPpReadResp, switch status - default.\n" ); |
|
1436 |
OstTrace0( TRACE_NORMAL, DUP6_CMMCUSTOMMESSHANDLER_INFOPPREADRESP, "CMmCustomMessHandler::InfoPpReadResp, switch status - default" ); |
|
1437 |
errorValue = KErrNotSupported; |
|
1438 |
break; |
|
1439 |
} |
|
1440 |
} |
|
1441 |
||
1442 |
TUint8 traId = aIsiMessage.Get8bit( ISI_HEADER_SIZE + INFO_PP_READ_RESP_OFFSET_TRANSID ); |
|
1443 |
if ( EGetAlsPPSupport == traId ) |
|
1444 |
{ |
|
1445 |
// complete with packed parameter RMmCustomAPI::TAlsSupport |
|
1446 |
CMmDataPackage dataPackage; |
|
1447 |
dataPackage.PackData( &alsSupport ); |
|
1448 |
iMessageRouter->Complete( ECustomCheckAlsPpSupportIPC, |
|
1449 |
&dataPackage, errorValue ); |
|
1450 |
} |
|
1451 |
else if ( ECheckTwoDigitDialSupport == traId ) |
|
1452 |
{ |
|
1453 |
// complete with packed parameter RMmCustomAPI::TTwoDigitDialSupport |
|
1454 |
CMmDataPackage dataPackage; |
|
1455 |
dataPackage.PackData( &twoDigitDialSupport ); |
|
1456 |
iMessageRouter->Complete( ECustomCheckTwoDigitDialSupportIPC, |
|
1457 |
&dataPackage, errorValue ); |
|
1458 |
} |
|
1459 |
||
1460 |
//No else |
|
1461 |
#endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */ |
|
1462 |
} |
|
1463 |
||
1464 |
// ----------------------------------------------------------------------------- |
|
1465 |
// CMmCustomMessHandler::CallGsmBlackListClearReq |
|
1466 |
// Constructs CALL_MODEM_BLACKLIST_CLEAR_REQ ISI message from input parameters and |
|
1467 |
// sends it through phonet. |
|
1468 |
// (other items were commented in a header). |
|
1469 |
// ----------------------------------------------------------------------------- |
|
1470 |
// |
|
1471 |
TInt CMmCustomMessHandler::CallGsmBlackListClearReq |
|
1472 |
( |
|
1473 |
TUint8 aTransId // Transaction Id |
|
1474 |
) |
|
1475 |
{ |
|
1476 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmBlackListClearReq.\n" ); |
|
1477 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLGSMBLACKLISTCLEARREQ, "CMmCustomMessHandler::CallGsmBlackListClearReq" ); |
|
1478 |
||
1479 |
// Construct CALL_MODEM_BLACKLIST_CLEAR_REQ message (1 data byte + |
|
1480 |
// sub block count) |
|
1481 |
TBuf8<2> blackListClearReq; |
|
1482 |
||
1483 |
blackListClearReq.Append( KCustomPadding ); |
|
1484 |
blackListClearReq.Append( 0x00 ); // sub block count |
|
1485 |
||
1486 |
//Send message via PhoNet |
|
1487 |
return iPhoNetSender->Send( PN_MODEM_CALL, aTransId, CALL_MODEM_BLACKLIST_CLEAR_REQ, |
|
1488 |
blackListClearReq ); |
|
1489 |
} |
|
1490 |
||
1491 |
// ----------------------------------------------------------------------------- |
|
1492 |
// CMmCustomMessHandler::CallGsmBlackListClearResp |
|
1493 |
// Breaks a CALL_MODEM_BLACKLIST_CLEAR_RESP ISI message. This method |
|
1494 |
// gets indicates that the clear blacklist was successful. |
|
1495 |
// Complete CallGsmBlackListClear with KErrNone to SOS layer. |
|
1496 |
// (other items were commented in a header). |
|
1497 |
// ----------------------------------------------------------------------------- |
|
1498 |
// |
|
1499 |
void CMmCustomMessHandler::CallGsmBlackListClearResp |
|
1500 |
( |
|
1501 |
// const TIsiReceiveC& aIsiMsg // Received isi messge |
|
1502 |
) |
|
1503 |
{ |
|
1504 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmBlackListClearResp.\n" ); |
|
1505 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLGSMBLACKLISTCLEARRESP, "CMmCustomMessHandler::CallGsmBlackListClearResp" ); |
|
1506 |
||
1507 |
// call server response |
|
1508 |
//getting this message indicates that the clear blacklist was successful |
|
1509 |
//complete SOS layer method |
|
1510 |
iMessageRouter->Complete( ECustomClearCallBlackListIPC, KErrNone ); |
|
1511 |
} |
|
1512 |
||
1513 |
// ----------------------------------------------------------------------------- |
|
1514 |
// CMmCustomMessHandler::SsServiceCompletedInd |
|
1515 |
// This method breaks the SS_SERVICE_COMPLETED_IND ISI message. |
|
1516 |
// Complete SsRequestCompleteNotification method from custom api or |
|
1517 |
// Complete NotifySsAdditionalInfo to SOS layer. |
|
1518 |
// (other items were commented in a header). |
|
1519 |
// ----------------------------------------------------------------------------- |
|
1520 |
// |
|
1521 |
void CMmCustomMessHandler::SsServiceCompletedInd |
|
1522 |
( |
|
1523 |
const TIsiReceiveC& aIsiMessage //received ISI message |
|
1524 |
) |
|
1525 |
{ |
|
1526 |
TFLOGSTRING("TSY: CMmCustomMessHandler::SsServiceCompletedInd"); |
|
1527 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_SSSERVICECOMPLETEDIND, "CMmCustomMessHandler::SsServiceCompletedInd" ); |
|
1528 |
||
1529 |
if ( 0 < aIsiMessage.Get8bit( ISI_HEADER_SIZE + |
|
1530 |
SS_SERVICE_COMPLETED_IND_OFFSET_SUBBLOCKCOUNT ) ) |
|
1531 |
{ |
|
1532 |
TUint ssStatus( 0 ); |
|
1533 |
TUint8 sbSsStatus( 0 ); |
|
1534 |
TUint sbForwardingFeatureOffset( 0 ); |
|
1535 |
TUint sbBarringFeatureOffset( 0 ); |
|
1536 |
||
1537 |
TUint sbStartOffset(0); |
|
1538 |
// SS_STATUS_RESULT sub block |
|
1539 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1540 |
ISI_HEADER_SIZE + SIZE_SS_SERVICE_COMPLETED_IND, |
|
1541 |
SS_STATUS_RESULT, |
|
1542 |
EIsiSubBlockTypeId8Len8, |
|
1543 |
sbStartOffset ) ) |
|
1544 |
{ |
|
1545 |
sbSsStatus = aIsiMessage.Get8bit( sbStartOffset + |
|
1546 |
SS_STATUS_RESULT_OFFSET_SSSTATUS ); |
|
1547 |
} |
|
1548 |
||
1549 |
// SS_GSM_FORWARDING_INFO sub block |
|
1550 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1551 |
ISI_HEADER_SIZE + SIZE_SS_SERVICE_COMPLETED_IND, |
|
1552 |
SS_GSM_FORWARDING_INFO, |
|
1553 |
EIsiSubBlockTypeId8Len8, |
|
1554 |
sbStartOffset ) ) |
|
1555 |
{ |
|
1556 |
// Sub block's sub block SS_GSM_FORWARDING_FEATURE: |
|
1557 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1558 |
sbStartOffset + SIZE_SS_GSM_FORWARDING_INFO, |
|
1559 |
SS_GSM_FORWARDING_FEATURE, |
|
1560 |
EIsiSubBlockTypeId8Len8, |
|
1561 |
sbForwardingFeatureOffset |
|
1562 |
) ) |
|
1563 |
{ |
|
1564 |
sbSsStatus = aIsiMessage.Get8bit( sbForwardingFeatureOffset + |
|
1565 |
SS_GSM_FORWARDING_FEATURE_OFFSET_SSSTATUS ); |
|
1566 |
} |
|
1567 |
//Cases which don't return the other sub block should still be ok. |
|
1568 |
else |
|
1569 |
{ |
|
1570 |
// This simulates successfull SS case, where the info subblock |
|
1571 |
// is received, but the forwarding feature isn't(the real status |
|
1572 |
// cannot be read). |
|
1573 |
sbSsStatus = SS_GSM_ACTIVE; |
|
1574 |
} |
|
1575 |
} |
|
1576 |
||
1577 |
// SS_GSM_BARRING_INFO sub block |
|
1578 |
if ( 0 == sbSsStatus && KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1579 |
ISI_HEADER_SIZE + SIZE_SS_SERVICE_COMPLETED_IND, |
|
1580 |
SS_GSM_BARRING_INFO, |
|
1581 |
EIsiSubBlockTypeId8Len8, |
|
1582 |
sbStartOffset |
|
1583 |
) ) |
|
1584 |
{ |
|
1585 |
// Sub block's sub block SS_GSM_BARRING_FEATURE |
|
1586 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1587 |
sbStartOffset + SIZE_SS_GSM_BARRING_FEATURE, |
|
1588 |
SS_GSM_BARRING_FEATURE, |
|
1589 |
EIsiSubBlockTypeId8Len8, |
|
1590 |
sbBarringFeatureOffset |
|
1591 |
) ) |
|
1592 |
{ |
|
1593 |
||
1594 |
sbSsStatus = aIsiMessage.Get8bit( sbBarringFeatureOffset + |
|
1595 |
SS_GSM_BARRING_FEATURE_OFFSET_SSSTATUS ); |
|
1596 |
} |
|
1597 |
} |
|
1598 |
||
1599 |
||
1600 |
// SS_GSM_GENERIC_SERVICE_INFO sub block |
|
1601 |
if ( 0 == sbSsStatus && KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1602 |
ISI_HEADER_SIZE + SIZE_SS_SERVICE_COMPLETED_IND, |
|
1603 |
SS_GSM_GENERIC_SERVICE_INFO, |
|
1604 |
EIsiSubBlockTypeId8Len8, |
|
1605 |
sbStartOffset |
|
1606 |
) ) |
|
1607 |
{ |
|
1608 |
sbSsStatus = aIsiMessage.Get8bit( sbStartOffset + |
|
1609 |
SS_GSM_GENERIC_SERVICE_INFO_OFFSET_SSSTATUS ); |
|
1610 |
} |
|
1611 |
||
1612 |
// SS_GSM_DATA sub block |
|
1613 |
if ( 0 == sbSsStatus && KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1614 |
ISI_HEADER_SIZE + SIZE_SS_SERVICE_COMPLETED_IND, |
|
1615 |
SS_GSM_DATA, |
|
1616 |
EIsiSubBlockTypeId8Len8, |
|
1617 |
sbStartOffset |
|
1618 |
) ) |
|
1619 |
{ |
|
1620 |
sbSsStatus = aIsiMessage.Get8bit( sbStartOffset + |
|
1621 |
SS_GSM_DATA_OFFSET_SSSTATUS ); |
|
1622 |
} |
|
1623 |
||
1624 |
if ( 0 != sbSsStatus ) |
|
1625 |
{ |
|
1626 |
//Found SS status info from SS_SERVICE_COMPLETED_IND |
|
1627 |
if ( SS_GSM_ACTIVE & sbSsStatus ) |
|
1628 |
{ |
|
1629 |
ssStatus = KCustomApiSsGsmActive; |
|
1630 |
} |
|
1631 |
else if ( SS_GSM_REGISTERED & sbSsStatus ) |
|
1632 |
{ |
|
1633 |
ssStatus = KCustomApiSsGsmRegistered; |
|
1634 |
} |
|
1635 |
else if ( SS_GSM_PROVISIONED & sbSsStatus ) |
|
1636 |
{ |
|
1637 |
ssStatus = KCustomApiSsGsmProvisioned; |
|
1638 |
} |
|
1639 |
else |
|
1640 |
{ |
|
1641 |
ssStatus = KCustomApiSsGsmQuiescent; |
|
1642 |
} |
|
1643 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::SsServiceCompletedInd: Complete SsRequestCompleteNotification ssStatus:%d", |
|
1644 |
ssStatus ); |
|
1645 |
OstTrace1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_SSSERVICECOMPLETEDIND, "CMmCustomMessHandler::SsServiceCompletedInd;Complete SsRequestCompleteNotification ssStatus=%u", ssStatus ); |
|
1646 |
||
1647 |
CMmDataPackage dataPackage; |
|
1648 |
// pack parameter: a TInt with SS status |
|
1649 |
dataPackage.PackData( &ssStatus ); |
|
1650 |
iMessageRouter->Complete( ECustomNotifySsRequestCompleteIPC, |
|
1651 |
&dataPackage, KErrNone ); |
|
1652 |
||
1653 |
} |
|
1654 |
||
1655 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
1656 |
ISI_HEADER_SIZE + SIZE_SS_SERVICE_COMPLETED_IND, |
|
1657 |
SS_GSM_ADDITIONAL_INFO, |
|
1658 |
EIsiSubBlockTypeId8Len8, |
|
1659 |
sbStartOffset ) ) |
|
1660 |
{ |
|
1661 |
//create SsAdditionalInfo structure |
|
1662 |
RMmCustomAPI::TSsAdditionalInfo additionalInfo; |
|
1663 |
||
1664 |
additionalInfo.iOperationCode = |
|
1665 |
aIsiMessage.Get8bit( ISI_HEADER_SIZE + |
|
1666 |
SS_SERVICE_COMPLETED_IND_OFFSET_OPERATION ); |
|
1667 |
||
1668 |
TUint8 length = aIsiMessage.Get8bit( sbStartOffset + |
|
1669 |
SS_GSM_ADDITIONAL_INFO_OFFSET_RETURNRESULTLEN ); |
|
1670 |
||
1671 |
additionalInfo.iAdditionalInfo.Copy( aIsiMessage.GetData( |
|
1672 |
sbStartOffset + SS_GSM_ADDITIONAL_INFO_OFFSET_RETURNRESULT, |
|
1673 |
length ) ); |
|
1674 |
||
1675 |
TFLOGSTRING("TSY: CMmCustomMessHandler::SsServiceCompletedInd: Complete SsAdditionalInfoNotification"); |
|
1676 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_SSSERVICECOMPLETEDIND, "CMmCustomMessHandler::SsServiceCompletedInd - Complete SsAdditionalInfoNotification" ); |
|
1677 |
||
1678 |
// complete notification |
|
1679 |
CMmDataPackage dataPackage; |
|
1680 |
// pack parameter: pointer to RMmCustomAPI::TSsAdditionalInfo |
|
1681 |
RMmCustomAPI::TSsAdditionalInfo* additionalInfoPtr = |
|
1682 |
&additionalInfo; |
|
1683 |
dataPackage.PackData( &additionalInfoPtr ); |
|
1684 |
iMessageRouter->Complete( ECustomSsAdditionalInfoNotificationIPC, |
|
1685 |
&dataPackage, KErrNone ); |
|
1686 |
||
1687 |
} |
|
1688 |
} |
|
1689 |
else // No subblock found, e.g. in AlterEgo functionality |
|
1690 |
{ |
|
1691 |
TInt ssStatus( KCustomApiSsGsmQuiescent ); |
|
1692 |
||
1693 |
CMmDataPackage dataPackage; |
|
1694 |
// pack parameter: a TInt with SS status |
|
1695 |
dataPackage.PackData( &ssStatus ); |
|
1696 |
iMessageRouter->Complete( ECustomNotifySsRequestCompleteIPC, |
|
1697 |
&dataPackage, KErrNone ); |
|
1698 |
} |
|
1699 |
} |
|
1700 |
||
1701 |
// ----------------------------------------------------------------------------- |
|
1702 |
// CMmCustomMessHandler::SsServiceFailedResp |
|
1703 |
// Breaks a SS_SERVICE_FAILED_RESP ISI message. This method |
|
1704 |
// triggers SsRequestCompleteNotification notification. |
|
1705 |
// Completes SsRequestCompleteNotification method from custom tsy with |
|
1706 |
// status value 0xFFFF to SOS layer. |
|
1707 |
// (other items were commented in a header). |
|
1708 |
// ----------------------------------------------------------------------------- |
|
1709 |
// |
|
1710 |
void CMmCustomMessHandler::SsServiceFailedResp |
|
1711 |
( |
|
1712 |
const TIsiReceiveC& aIsiMessage //received ISI message |
|
1713 |
) |
|
1714 |
{ |
|
1715 |
TFLOGSTRING("TSY: CMmCustomMessHandler::SsServiceFailedResp"); |
|
1716 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_SSSERVICEFAILEDRESP, "CMmCustomMessHandler::SsServiceFailedResp" ); |
|
1717 |
||
1718 |
TInt ssStatus( RMmCustomAPI::KSsStatusReturnError ); |
|
1719 |
||
1720 |
CMmDataPackage dataPackage; |
|
1721 |
||
1722 |
TUint sbStartOffset( 0 ); |
|
1723 |
||
1724 |
//create SsAdditionalInfo structure |
|
1725 |
RMmCustomAPI::TSsAdditionalInfo additionalInfo; |
|
1726 |
||
1727 |
// this data is not available, set to 0 just in case |
|
1728 |
additionalInfo.iOperationCode = 0x00; |
|
1729 |
||
1730 |
//if sub block exists |
|
1731 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetByIndex( |
|
1732 |
ISI_HEADER_SIZE + SIZE_SS_SERVICE_FAILED_RESP, |
|
1733 |
1, |
|
1734 |
EIsiSubBlockTypeId8Len8, |
|
1735 |
sbStartOffset ) ) |
|
1736 |
{ |
|
1737 |
TUint8 subBlockId( aIsiMessage.Get8bit( sbStartOffset ) ); |
|
1738 |
switch ( subBlockId ) |
|
1739 |
{ |
|
1740 |
case SS_GSM_INDICATE_PASSWORD_ERROR: |
|
1741 |
{ |
|
1742 |
// Set error code to additional info. No mapping needed because |
|
1743 |
// client wants error code as it was received from network. |
|
1744 |
additionalInfo.iAdditionalInfo.Append( |
|
1745 |
aIsiMessage.Get8bit( sbStartOffset + |
|
1746 |
SS_GSM_INDICATE_PASSWORD_ERROR_OFFSET_GUIDANCEINFO ) ); |
|
1747 |
break; |
|
1748 |
} |
|
1749 |
case SS_GSM_INDICATE_ERROR: |
|
1750 |
{ |
|
1751 |
additionalInfo.iAdditionalInfo.Append( aIsiMessage.Get8bit( |
|
1752 |
sbStartOffset + SS_GSM_INDICATE_ERROR_OFFSET_ERRORCODE ) ); |
|
1753 |
// If additional indication is not default, add it to buffer |
|
1754 |
TUint8 addIndication( |
|
1755 |
aIsiMessage.Get8bit( sbStartOffset + |
|
1756 |
SS_GSM_INDICATE_ERROR_OFFSET_ADDITIONALINDICATION ) ); |
|
1757 |
// Just to keep previous functionality, the default value |
|
1758 |
// not added to buffer |
|
1759 |
if ( SS_DEFAULT_VALUE != addIndication ) |
|
1760 |
{ |
|
1761 |
additionalInfo.iAdditionalInfo.Append( addIndication ); |
|
1762 |
} |
|
1763 |
break; |
|
1764 |
} |
|
1765 |
case SS_GSM_INDICATE_PROBLEM: |
|
1766 |
{ |
|
1767 |
// Problem code is added to additional info only if RELEASE |
|
1768 |
// COMPLETE message from network includes Return Result |
|
1769 |
// component |
|
1770 |
if ( SS_GSM_RETURN_RESULT_PROBLEM == |
|
1771 |
aIsiMessage.Get8bit( sbStartOffset + |
|
1772 |
SS_GSM_INDICATE_PROBLEM_OFFSET_PROBLEMTYPE ) ) |
|
1773 |
{ |
|
1774 |
additionalInfo.iAdditionalInfo.Append( |
|
1775 |
aIsiMessage.Get8bit( sbStartOffset + |
|
1776 |
SS_GSM_INDICATE_PROBLEM_OFFSET_PROBLEMCODE ) ); |
|
1777 |
} |
|
1778 |
break; |
|
1779 |
} |
|
1780 |
case SS_GSM_INDICATE_MSG_ERROR: |
|
1781 |
{ |
|
1782 |
additionalInfo.iAdditionalInfo.Append( |
|
1783 |
aIsiMessage.Get8bit( sbStartOffset + |
|
1784 |
SS_GSM_INDICATE_MSG_ERROR_OFFSET_MESSAGEERRORCODE ) ); |
|
1785 |
break; |
|
1786 |
} |
|
1787 |
case SS_OTHER_ERROR: |
|
1788 |
{ |
|
1789 |
additionalInfo.iAdditionalInfo.Append( aIsiMessage.Get8bit( |
|
1790 |
sbStartOffset + SS_OTHER_ERROR_OFFSET_ERRORCODE ) ); |
|
1791 |
break; |
|
1792 |
} |
|
1793 |
case SS_GSM_MM_RELEASED: |
|
1794 |
{ |
|
1795 |
// This subblock occurs when network has released SS request, |
|
1796 |
// therefore SS status is set accordingly |
|
1797 |
ssStatus = RMmCustomAPI::KSsStatusNetworkFailure; |
|
1798 |
||
1799 |
additionalInfo.iAdditionalInfo.Append( aIsiMessage.Get8bit( |
|
1800 |
sbStartOffset + SS_GSM_MM_RELEASED_OFFSET_CAUSE ) ); |
|
1801 |
break; |
|
1802 |
} |
|
1803 |
default: |
|
1804 |
{ |
|
1805 |
// unknown error sub block |
|
1806 |
additionalInfo.iAdditionalInfo.Append( 0x00 ); |
|
1807 |
break; |
|
1808 |
} |
|
1809 |
} |
|
1810 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::SsServiceFailedResp: Ss Status: %d", ssStatus ); |
|
1811 |
OstTrace1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_SSSERVICEFAILEDRESP, "CMmCustomMessHandler::SsServiceFailedResp;Ss Status=%d", ssStatus ); |
|
1812 |
// pack parameter: a TInt with SS status |
|
1813 |
dataPackage.PackData( &ssStatus ); |
|
1814 |
||
1815 |
// To complete outstanding SsRequestCompleteNotification |
|
1816 |
iMessageRouter->Complete( |
|
1817 |
ECustomNotifySsRequestCompleteIPC, |
|
1818 |
&dataPackage, |
|
1819 |
KErrNone ); |
|
1820 |
||
1821 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::SsServiceFailedResp: SB ID: 0x%x",subBlockId ); |
|
1822 |
OstTraceExt1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_SSSERVICEFAILEDRESP, "CMmCustomMessHandler::SsServiceFailedResp;subBlockId=%hhx", subBlockId ); |
|
1823 |
// pack parameter: pointer to RMmCustomAPI::TSsAdditionalInfo |
|
1824 |
RMmCustomAPI::TSsAdditionalInfo* additionalInfoPtr = &additionalInfo; |
|
1825 |
dataPackage.PackData( &additionalInfoPtr ); |
|
1826 |
||
1827 |
// To complete outstanding SsAdditionalInfoNotification |
|
1828 |
iMessageRouter->Complete( |
|
1829 |
ECustomSsAdditionalInfoNotificationIPC, |
|
1830 |
&dataPackage, |
|
1831 |
KErrNone ); |
|
1832 |
} |
|
1833 |
else |
|
1834 |
{ |
|
1835 |
TFLOGSTRING("TSY: CMmCustomMessHandler::SsServiceFailedResp: No subblock's"); |
|
1836 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_SSSERVICEFAILEDRESP, "CMmCustomMessHandler::SsServiceFailedResp - No subblock's" ); |
|
1837 |
||
1838 |
dataPackage.PackData( &ssStatus ); |
|
1839 |
||
1840 |
// No subblocks, complete with default values |
|
1841 |
iMessageRouter->Complete( ECustomNotifySsRequestCompleteIPC, |
|
1842 |
&dataPackage, |
|
1843 |
KErrNone ); |
|
1844 |
// No additional info given, no need to complete |
|
1845 |
// ECustomSsAdditionalInfoNotificationIPC |
|
1846 |
} |
|
1847 |
} |
|
1848 |
||
1849 |
// ----------------------------------------------------------------------------- |
|
1850 |
// CMmCustomMessHandler::CallEmergencyNbrCheckReq |
|
1851 |
// Constructs CALL_MODEM_EMERGENCY_NBR_CHECK_REQ ISI message from input parameters |
|
1852 |
// and sends it through phonet. This message can be used to check if given |
|
1853 |
// number is an emrgency number. |
|
1854 |
// (other items were commented in a header). |
|
1855 |
// ----------------------------------------------------------------------------- |
|
1856 |
// |
|
1857 |
TInt CMmCustomMessHandler::CallEmergencyNbrCheckReq |
|
1858 |
( |
|
1859 |
TUint8 aTransId, // Transaction Id |
|
1860 |
RMmCustomAPI::TMobileTelNumber& aNumber, // Telnumber |
|
1861 |
RMmCustomAPI::TCheckMode aCheckMode // Check mode |
|
1862 |
) |
|
1863 |
{ |
|
1864 |
TFLOGSTRING( "TSY: CMmCustomMessHandler::CallEmergencyNbrCheckReq" ); |
|
1865 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLEMERGENCYNBRCHECKREQ, "CMmCustomMessHandler::CallEmergencyNbrCheckReq" ); |
|
1866 |
||
1867 |
//save the information to match it when the response is got |
|
1868 |
iUsedEmergencyNbrCheckMode = aCheckMode; |
|
1869 |
iEmergencyNumberLength = aNumber.Length(); |
|
1870 |
||
1871 |
// Construct CALL_MODEM_EMERG_NBR_CHECK_REQ message (1 filler + |
|
1872 |
// sub block count + bytes for CALL_MODEM_SB_DESTINATION_ADDRESS sub block) |
|
1873 |
TBuf8< 2 + SIZE_CALL_MODEM_SB_DESTINATION_ADDRESS + |
|
1874 |
( RMobilePhone::KMaxMobileTelNumberSize * 2 ) > callEmergencyNbrCheckReq; |
|
1875 |
||
1876 |
// Filler |
|
1877 |
callEmergencyNbrCheckReq.Append( KCustomPadding ); |
|
1878 |
// Sub block count |
|
1879 |
callEmergencyNbrCheckReq.Append( 1 ); |
|
1880 |
||
1881 |
//create the CALL_MODEM_DESTINATION_ADDRESS subblock |
|
1882 |
TBuf8<SIZE_CALL_MODEM_SB_DESTINATION_ADDRESS + |
|
1883 |
( RMobilePhone::KMaxMobileTelNumberSize * 2 )> |
|
1884 |
destinationAddressBuf( 0 ); |
|
1885 |
TIsiSubBlock destinationAddressSb( destinationAddressBuf, |
|
1886 |
CALL_MODEM_SB_DESTINATION_ADDRESS, EIsiSubBlockTypeId8Len8 ); |
|
1887 |
||
1888 |
//add the Address type, not needed because this is not checked on ISA side |
|
1889 |
destinationAddressBuf.Append( CALL_MODEM_NBR_PLAN_UNKNOWN ); |
|
1890 |
||
1891 |
//add padding bytes |
|
1892 |
destinationAddressBuf.Append( KCustomPadding ); |
|
1893 |
destinationAddressBuf.Append( KCustomPadding ); |
|
1894 |
||
1895 |
//add number length |
|
1896 |
//lint -e{732} Warning about "loss of sign". Root cause is that |
|
1897 |
//TDesC::Length() returns a signed TInt |
|
1898 |
destinationAddressBuf.Append( aNumber.Length() ); |
|
1899 |
||
1900 |
//add the number string |
|
1901 |
TIsiUtility::CopyToBigEndian( aNumber, destinationAddressBuf ); |
|
1902 |
||
1903 |
// add the CALL_MODEM_DESTINATION_ADDRESS subblock |
|
1904 |
callEmergencyNbrCheckReq.Append( destinationAddressSb.CompleteSubBlock() ); |
|
1905 |
||
1906 |
// Sending message to phonet |
|
1907 |
return iPhoNetSender->Send( PN_MODEM_CALL, aTransId, CALL_MODEM_EMERG_NBR_CHECK_REQ, |
|
1908 |
callEmergencyNbrCheckReq ); |
|
1909 |
} |
|
1910 |
||
1911 |
// ----------------------------------------------------------------------------- |
|
1912 |
// CMmCustomMessHandler::CallEmergencyNbrCheckResp |
|
1913 |
// Breaks a CALL_EMERGENCY_CHECK_RESP ISI message. This method |
|
1914 |
// provides information whether the given number was an emergency number or not. |
|
1915 |
// Complete CompleteCheckEmergencyNumber with status and errorValue to SOS layer |
|
1916 |
// (other items were commented in a header). |
|
1917 |
// ----------------------------------------------------------------------------- |
|
1918 |
// |
|
1919 |
||
1920 |
void CMmCustomMessHandler::CallEmergencyNbrCheckResp |
|
1921 |
( |
|
1922 |
const TIsiReceiveC& aIsiMsg // Received ISI message |
|
1923 |
) |
|
1924 |
{ |
|
1925 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallEmergencyNbrCheckResp" ); |
|
1926 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLEMERGENCYNBRCHECKRESP, "CMmCustomMessHandler::CallEmergencyNbrCheckResp" ); |
|
1927 |
||
1928 |
// Get Status |
|
1929 |
TUint8 status( aIsiMsg.Get8bit( ISI_HEADER_SIZE + |
|
1930 |
CALL_MODEM_EMERG_NBR_CHECK_RESP_OFFSET_STATUS )); |
|
1931 |
||
1932 |
RMmCustomAPI::TMobileTelNumber telNumber; |
|
1933 |
||
1934 |
//Using the advance checking of the call server forces us to make sure |
|
1935 |
//that the call server is not is not misleading us... |
|
1936 |
if ( CALL_MODEM_EMERG_NBR_CHECK_PASS == status ) |
|
1937 |
{ |
|
1938 |
TUint sbStartOffSet( 0 ); |
|
1939 |
||
1940 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
1941 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_EMERG_NBR_CHECK_RESP, |
|
1942 |
CALL_MODEM_SB_EMERG_NUMBER, EIsiSubBlockTypeId8Len8, sbStartOffSet ) ) |
|
1943 |
{ |
|
1944 |
//get length of returned number (number of Unicode characters) |
|
1945 |
TUint8 numberLength( aIsiMsg.Get8bit( sbStartOffSet + |
|
1946 |
CALL_MODEM_SB_EMERG_NUMBER_OFFSET_ADDRLEN )); |
|
1947 |
||
1948 |
//copy 8-bit number to the 16-bit target using correct endianess |
|
1949 |
//ISI message contains one Unicode digit in two bytes ==> multiply length by 2 |
|
1950 |
TIsiUtility::CopyFromBigEndian( aIsiMsg.GetData( sbStartOffSet + |
|
1951 |
CALL_MODEM_SB_EMERG_NUMBER_OFFSET_ADDR, |
|
1952 |
numberLength * 2 ), telNumber ); |
|
1953 |
||
1954 |
//Check that the Number length returned by call server doesn't |
|
1955 |
//differ from original phone number. |
|
1956 |
//Call server uses advanced mode while checking |
|
1957 |
//numbers. For example 2112 is valid emergency number for |
|
1958 |
//call server -> server returns number 112. However 2112 is not |
|
1959 |
//emergency number. |
|
1960 |
if ( RMmCustomAPI::EEmerNumberCheckNormal == |
|
1961 |
iUsedEmergencyNbrCheckMode && numberLength != |
|
1962 |
iEmergencyNumberLength ) |
|
1963 |
{ |
|
1964 |
status = CALL_MODEM_EMERG_NBR_CHECK_FAIL; |
|
1965 |
} |
|
1966 |
} |
|
1967 |
else |
|
1968 |
{ |
|
1969 |
//acording to call server feature description, in case of succesful |
|
1970 |
//checking the sub block should be present. Therefore we consider |
|
1971 |
//this case as a failure. |
|
1972 |
status = CALL_MODEM_EMERG_NBR_CHECK_FAIL; |
|
1973 |
} |
|
1974 |
} |
|
1975 |
||
1976 |
// map to result: failed is 0, successful is ptr to number |
|
1977 |
RMmCustomAPI::TMobileTelNumber* result = |
|
1978 |
( ( CALL_MODEM_EMERG_NBR_CHECK_FAIL == status ) ? |
|
1979 |
0 : &telNumber ); |
|
1980 |
||
1981 |
// packed parameter: TBool result |
|
1982 |
CMmDataPackage dataPackage; |
|
1983 |
dataPackage.PackData( &result ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1984 |
|
0 | 1985 |
TFLOGSTRING2( "TSY: TSY: CMmCustomMessHandler::CallEmergencyNbrCheckResp status: %d", status); |
1986 |
TFLOGSTRING2( "TSY: TSY: CMmCustomMessHandler::CallEmergencyNbrCheckResp emergency number: %S", &telNumber); |
|
1987 |
//we complete with KErrNone as there is always a value to return |
|
1988 |
iMessageRouter->Complete( ECustomCheckEmergencyNumberIPC, &dataPackage, |
|
1989 |
KErrNone ); |
|
1990 |
||
1991 |
} |
|
1992 |
||
1993 |
// ----------------------------------------------------------------------------- |
|
1994 |
// CMmCustomMessHandler::UiccOperatorReq |
|
1995 |
// Read operator name from UICC |
|
1996 |
// ----------------------------------------------------------------------------- |
|
1997 |
// |
|
1998 |
TInt CMmCustomMessHandler::UiccOperatorReq() |
|
1999 |
{ |
|
2000 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccOperatorReq" ); |
|
2001 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCOPERATORREQ, "CMmCustomMessHandler::UiccOperatorReq" ); |
|
2002 |
||
2003 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
2004 |
TUiccReadTransparent params; |
|
2005 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
2006 |
params.trId = ETrIdReadOperatorNameCustom; |
|
2007 |
params.dataOffset = 0; |
|
2008 |
params.dataAmount = 0; |
|
2009 |
params.fileId = KElemFileOperatorName; |
|
2010 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
2011 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
2012 |
||
2013 |
// File id path |
|
2014 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
2015 |
params.filePath.Append( KMasterFileId ); |
|
2016 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
2017 |
||
2018 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
2019 |
} |
|
2020 |
||
2021 |
// ----------------------------------------------------------------------------- |
|
2022 |
// CMmCustomMessHandler::UiccOperatorResp |
|
2023 |
// Complete operator name |
|
2024 |
// ----------------------------------------------------------------------------- |
|
2025 |
// |
|
2026 |
void CMmCustomMessHandler::UiccOperatorResp( |
|
2027 |
TInt aStatus, |
|
2028 |
const TDesC8& aFileData ) |
|
2029 |
{ |
|
2030 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccOperatorResp" ); |
|
2031 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCOPERATORRESP, "CMmCustomMessHandler::UiccOperatorResp" ); |
|
2032 |
||
2033 |
TInt errorValue( KErrGeneral ); |
|
2034 |
||
2035 |
// Network provider name |
|
2036 |
TBuf<KNwProviderNameLength> name; |
|
2037 |
||
2038 |
if ( KErrNone == aStatus ) |
|
2039 |
{ |
|
2040 |
errorValue = KErrNone; |
|
2041 |
name.Copy( aFileData ); |
|
2042 |
} |
|
2043 |
||
2044 |
// Packed parameter: TDes* (network provider name) |
|
2045 |
CMmDataPackage dataPackage; |
|
2046 |
TDes* namePtr( &name ); |
|
2047 |
dataPackage.PackData( &namePtr ); |
|
2048 |
||
2049 |
iMessageRouter->Complete( |
|
2050 |
ECustomGetNetworkProviderNameIPC, |
|
2051 |
&dataPackage, |
|
2052 |
errorValue ); |
|
2053 |
} |
|
2054 |
||
2055 |
// ----------------------------------------------------------------------------- |
|
2056 |
// CMmCustomMessHandler::SsGsmUssdSendReq |
|
2057 |
// Constructs SS_GSM_USSD_SEND_REQ ISI message from input parameters |
|
2058 |
// and sends it through phonet. |
|
2059 |
// This message can be used only to cancel ussd session. |
|
2060 |
// (other items were commented in a header). |
|
2061 |
// ----------------------------------------------------------------------------- |
|
2062 |
// |
|
2063 |
TInt CMmCustomMessHandler::SsGsmUssdSendReq |
|
2064 |
( |
|
2065 |
TUint8 aTransId //transaction Id |
|
2066 |
) |
|
2067 |
{ |
|
2068 |
TFLOGSTRING("TSY: CMmCustomMessHandler::SsGsmUssdSendReq" ); |
|
2069 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_SSGSMUSSDSENDREQ, "CMmCustomMessHandler::SsGsmUssdSendReq" ); |
|
2070 |
||
2071 |
// create buffer for isi msg data |
|
2072 |
TBuf8<2> data; |
|
2073 |
data.Append( SS_GSM_USSD_END ); |
|
2074 |
//number of sub blocks |
|
2075 |
data.Append( 0 ); |
|
2076 |
||
2077 |
// Message sent via Phonet and return |
|
2078 |
return iPhoNetSender->Send( PN_SS, aTransId, SS_GSM_USSD_SEND_REQ, data ); |
|
2079 |
||
2080 |
} |
|
2081 |
||
2082 |
||
2083 |
// ----------------------------------------------------------------------------- |
|
2084 |
// CMmCustomMessHandler::SsGsmUssdSendResp |
|
2085 |
// Breaks a SS_USSD_SEND_RESP ISI message. |
|
2086 |
// This method gets USSD type information from message and completes cancelling |
|
2087 |
// of ussd session. Complete CancelUssdSession with KErrNone to SOS layer. |
|
2088 |
// (other items were commented in a header). |
|
2089 |
// ----------------------------------------------------------------------------- |
|
2090 |
// |
|
2091 |
void CMmCustomMessHandler::SsGsmUssdSendResp |
|
2092 |
( |
|
2093 |
const TIsiReceiveC& aIsiMessage //received ISI message |
|
2094 |
) |
|
2095 |
{ |
|
2096 |
TFLOGSTRING("TSY: CMmCustomMessHandler::SsGsmUssdSendResp" ); |
|
2097 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_SSGSMUSSDSENDRESP, "CMmCustomMessHandler::SsGsmUssdSendResp" ); |
|
2098 |
||
2099 |
||
2100 |
TUint ussdType( aIsiMessage.Get8bit( |
|
2101 |
ISI_HEADER_SIZE + |
|
2102 |
SS_GSM_USSD_SEND_RESP_OFFSET_USSDTYPE ) ); |
|
2103 |
||
2104 |
if ( SS_GSM_USSD_END == ussdType ) |
|
2105 |
{ |
|
2106 |
// no packed parameters for completion |
|
2107 |
iMessageRouter->Complete( ECustomCancelUssdSessionIPC, KErrNone ); |
|
2108 |
} |
|
2109 |
||
2110 |
} |
|
2111 |
||
2112 |
// ----------------------------------------------------------------------------- |
|
2113 |
// CMmCustomMessHandler::Match |
|
2114 |
// This method can be checks if two TCiphListEntry entries are same. |
|
2115 |
// (other items were commented in a header). |
|
2116 |
// ----------------------------------------------------------------------------- |
|
2117 |
// |
|
2118 |
TBool CMmCustomMessHandler::Match |
|
2119 |
( |
|
2120 |
const TCiphListEntry& aArg1, //first argument |
|
2121 |
const TCiphListEntry& aArg2 //second argument |
|
2122 |
) |
|
2123 |
{ |
|
2124 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Match.\n" ); |
|
2125 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_MATCH, "CMmCustomMessHandler::Match" ); |
|
2126 |
||
2127 |
TBool ret ( EFalse ); |
|
2128 |
||
2129 |
//we are interested only in the traId value |
|
2130 |
if ( aArg1.iTraId == aArg2.iTraId ) |
|
2131 |
{ |
|
2132 |
ret = ETrue; |
|
2133 |
} |
|
2134 |
||
2135 |
return ret; |
|
2136 |
} |
|
2137 |
||
2138 |
// ----------------------------------------------------------------------------- |
|
2139 |
// CMmCustomMessHandler::NetModemRegStatusGetReq |
|
2140 |
// Constructs NET_MODEM_REG_STATUS_GET_REQ ISI message from input parameters |
|
2141 |
// and sends it through phonet. |
|
2142 |
// (other items were commented in a header). |
|
2143 |
// ----------------------------------------------------------------------------- |
|
2144 |
// |
|
2145 |
TInt CMmCustomMessHandler::NetModemRegStatusGetReq |
|
2146 |
( |
|
2147 |
const TUint8 aTransactionId |
|
2148 |
) |
|
2149 |
{ |
|
2150 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetModemRegStatusGetReq." ); |
|
2151 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETMODEMREGSTATUSGETREQ, "CMmCustomMessHandler::NetModemRegStatusGetReq" ); |
|
2152 |
||
2153 |
// Data length buffer is 2. |
|
2154 |
TBuf8<2> data; |
|
2155 |
data.Append( aTransactionId ); |
|
2156 |
data.Append( NET_MODEM_REG_STATUS_GET_REQ ); |
|
2157 |
||
2158 |
TIsiSend isimsg( iPhoNetSender->SendBufferDes() ); |
|
2159 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_MODEM_NETWORK ); |
|
2160 |
isimsg.CopyData( ISI_HEADER_SIZE, data ); |
|
2161 |
||
2162 |
return( iPhoNetSender->Send( isimsg.Complete() ) ); |
|
2163 |
} |
|
2164 |
||
2165 |
// ----------------------------------------------------------------------------- |
|
2166 |
// CMmCustomMessHandler::NetModemRegStatusGetResp |
|
2167 |
// NET_MODEM_REG_STATUS_GET_RESP message is handled in queue functionality |
|
2168 |
// in cmmnetmesshandler/cmmnetoperatornamehandler and will be completed |
|
2169 |
// there after handling. |
|
2170 |
// This method check if ECID info needs to be updated. |
|
2171 |
// ----------------------------------------------------------------------------- |
|
2172 |
// |
|
2173 |
void CMmCustomMessHandler::NetModemRegStatusGetResp( |
|
2174 |
const TIsiReceiveC& aIsiMsg ) |
|
2175 |
{ |
|
2176 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetModemRegStatusGetResp" ); |
|
2177 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETMODEMREGSTATUSGETRESP, "CMmCustomMessHandler::NetModemRegStatusGetResp" ); |
|
2178 |
||
2179 |
// Get the success code. |
|
2180 |
TUint8 successCode( aIsiMsg.Get8bit( |
|
2181 |
ISI_HEADER_SIZE + |
|
2182 |
NET_MODEM_REG_STATUS_GET_RESP_OFFSET_SUCCESSCODE ) ); |
|
2183 |
||
2184 |
if ( NET_CAUSE_OK == successCode ) |
|
2185 |
{ |
|
2186 |
// Check if ECID info needs to be updated. |
|
2187 |
CheckECIDInfo( aIsiMsg ); |
|
2188 |
} |
|
2189 |
} |
|
2190 |
||
2191 |
// ----------------------------------------------------------------------------- |
|
2192 |
// CMmCustomMessHandler::CallGsmNotificationInd |
|
2193 |
// This method breaks the CALL_MODEM_NOTIFICATION_IND ISI message. |
|
2194 |
// Complete: ECustomNotifySsNetworkEventIPC to SOS layer. |
|
2195 |
// If CALL_MODEM_SB_ALERTING_INFO sub block exist ECustomGetRemoteAlertingToneStatusIPC |
|
2196 |
// is completed to SOS layer. |
|
2197 |
// (other items were commented in a header). |
|
2198 |
// ----------------------------------------------------------------------------- |
|
2199 |
// |
|
2200 |
void CMmCustomMessHandler::CallGsmNotificationInd |
|
2201 |
( |
|
2202 |
const TIsiReceiveC& aIsiMsg // received ISI message |
|
2203 |
) |
|
2204 |
{ |
|
2205 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd"); |
|
2206 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd" ); |
|
2207 |
||
2208 |
TInt ret( KErrNone ); |
|
2209 |
||
2210 |
// For packaging |
|
2211 |
CMmDataPackage dataPackage; |
|
2212 |
||
2213 |
RMmCustomAPI::TSsTypeAndMode ssTypeAndMode; |
|
2214 |
RMmCustomAPI::TSsInfo ssInfo; |
|
2215 |
||
2216 |
// Initialize the default values |
|
2217 |
ssInfo.iCallHold = RMmCustomAPI::ESsHoldNotActive; |
|
2218 |
ssInfo.iEctCallState = RMmCustomAPI::ESsEctNotActive; |
|
2219 |
ssInfo.iCallWait = EFalse; |
|
2220 |
ssInfo.iConfInd = EFalse; |
|
2221 |
ssInfo.iClirSuppReject = EFalse; |
|
2222 |
ssInfo.iForwMode = RMmCustomAPI::EForwNotActive; |
|
2223 |
ssInfo.iCugIndex = CALL_MODEM_CUG_DEFAULT; |
|
2224 |
ssInfo.iChoice = RMmCustomAPI::ESsChoiceUnknown; |
|
2225 |
ssInfo.iRemoteAddress.FillZ(); |
|
2226 |
ssTypeAndMode.iSsMode = RMmCustomAPI::ESsModeUnknown; |
|
2227 |
ssTypeAndMode.iSsType = RMmCustomAPI::ESsAllSs; |
|
2228 |
||
2229 |
TUint sbStartOffSet( 0 ); |
|
2230 |
||
2231 |
// Get CALL_MODEM_SB_SS_CODE sub block |
|
2232 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2233 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2234 |
CALL_MODEM_SB_SS_CODE, |
|
2235 |
EIsiSubBlockTypeId8Len8, |
|
2236 |
sbStartOffSet ) ) |
|
2237 |
{ |
|
2238 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2239 |
- CALL_MODEM_SB_SS_CODE sub block founded"); |
|
2240 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_SS_CODE sub block found" ); |
|
2241 |
||
2242 |
TUint16 ssCode( aIsiMsg.Get16bit( |
|
2243 |
sbStartOffSet + CALL_MODEM_SB_SS_CODE_OFFSET_MMISSCODE ) ); |
|
2244 |
||
2245 |
switch ( ssCode ) |
|
2246 |
{ |
|
2247 |
case CALL_MODEM_SSC_ALL_FWDS: |
|
2248 |
case CALL_MODEM_SSC_CFU: |
|
2249 |
case CALL_MODEM_SSC_CFB: |
|
2250 |
case CALL_MODEM_SSC_CFNRY: |
|
2251 |
case CALL_MODEM_SSC_CFGNC: |
|
2252 |
case CALL_MODEM_SSC_ALL_COND_FWD: |
|
2253 |
{ |
|
2254 |
HandleForwarding( ssCode, aIsiMsg, ssTypeAndMode ); |
|
2255 |
break; |
|
2256 |
} |
|
2257 |
case CALL_MODEM_SSC_OUTGOING_BARR_SERV: |
|
2258 |
case CALL_MODEM_SSC_INCOMING_BARR_SERV: |
|
2259 |
{ |
|
2260 |
HandleBarring( ssCode, aIsiMsg, ssTypeAndMode ); |
|
2261 |
break; |
|
2262 |
} |
|
2263 |
case CALL_MODEM_SSC_CALL_WAITING: |
|
2264 |
{ |
|
2265 |
ssTypeAndMode.iSsType = RMmCustomAPI::ESsCallWaiting; |
|
2266 |
break; |
|
2267 |
} |
|
2268 |
case CALL_MODEM_SSC_CLIP: |
|
2269 |
{ |
|
2270 |
ssTypeAndMode.iSsType = RMmCustomAPI::ESsClip; |
|
2271 |
break; |
|
2272 |
} |
|
2273 |
case CALL_MODEM_SSC_CLIR: |
|
2274 |
{ |
|
2275 |
ssTypeAndMode.iSsType = RMmCustomAPI::ESsClir; |
|
2276 |
break; |
|
2277 |
} |
|
2278 |
case CALL_MODEM_SSC_COLP: |
|
2279 |
{ |
|
2280 |
ssTypeAndMode.iSsType = RMmCustomAPI::ESsColp; |
|
2281 |
break; |
|
2282 |
} |
|
2283 |
case CALL_MODEM_SSC_COLR: |
|
2284 |
{ |
|
2285 |
ssTypeAndMode.iSsType = RMmCustomAPI::ESsColr; |
|
2286 |
break; |
|
2287 |
} |
|
2288 |
default: |
|
2289 |
{ |
|
2290 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2291 |
switch ssCode - default."); |
|
2292 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, switch ssCode - default" ); |
|
2293 |
break; |
|
2294 |
} |
|
2295 |
} |
|
2296 |
} |
|
2297 |
||
2298 |
// Get CALL_GSM_SS_NOTIFY sub block |
|
2299 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2300 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2301 |
CALL_MODEM_SB_SS_NOTIFY, |
|
2302 |
EIsiSubBlockTypeId8Len8, |
|
2303 |
sbStartOffSet ) ) |
|
2304 |
{ |
|
2305 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2306 |
- CALL_MODEM_SB_SS_NOTIFY sub block founded"); |
|
2307 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_SS_NOTIFY sub block found" ); |
|
2308 |
||
2309 |
// Get the SsNotifyIndictor |
|
2310 |
TUint8 ssNotify( aIsiMsg.Get8bit( |
|
2311 |
sbStartOffSet + CALL_MODEM_SB_SS_NOTIFY_OFFSET_SSNOTIFICATION ) ); |
|
2312 |
||
2313 |
// Mask the value |
|
2314 |
// Incoming call is a forwarded call |
|
2315 |
if ( CALL_MODEM_SSN_INCOMING_IS_FWD == ssNotify ) |
|
2316 |
{ |
|
2317 |
ssInfo.iForwMode = RMmCustomAPI::ESsIncCallIsForw; |
|
2318 |
} |
|
2319 |
// Incoming call has been forwarded to C |
|
2320 |
else if ( CALL_MODEM_SSN_INCOMING_FWD == ssNotify ) |
|
2321 |
{ |
|
2322 |
ssInfo.iForwMode = RMmCustomAPI::ESsIncCallForwToC; |
|
2323 |
} |
|
2324 |
//Outgoing call is fowarded to C |
|
2325 |
else if ( CALL_MODEM_SSN_OUTGOING_FWD == ssNotify ) |
|
2326 |
{ |
|
2327 |
ssInfo.iForwMode = RMmCustomAPI::ESsOutCallForwToC; |
|
2328 |
} |
|
2329 |
// No else |
|
2330 |
} |
|
2331 |
||
2332 |
// Get CALL_MODEM_SB_SS_NOTIFY_INDICATOR sub block |
|
2333 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2334 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2335 |
CALL_MODEM_SB_SS_NOTIFY_INDICATOR, |
|
2336 |
EIsiSubBlockTypeId8Len8, |
|
2337 |
sbStartOffSet ) ) |
|
2338 |
{ |
|
2339 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2340 |
- CALL_MODEM_SB_SS_NOTIFY_INDICATOR sub block founded"); |
|
2341 |
OstTrace0( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_SS_NOTIFY_INDICATOR sub block found" ); |
|
2342 |
||
2343 |
// Get the SsNotifyIndictor |
|
2344 |
TUint8 ssNotifyIndicator( aIsiMsg.Get8bit( sbStartOffSet + |
|
2345 |
CALL_MODEM_SB_SS_NOTIFY_INDICATOR_OFFSET_SSINDICATOR ) ); |
|
2346 |
||
2347 |
// Mask the value of the Indicator |
|
2348 |
if ( CALL_MODEM_SSI_CALL_IS_WAITING == ssNotifyIndicator ) // Call waiting |
|
2349 |
{ |
|
2350 |
ssInfo.iCallWait = ETrue; |
|
2351 |
} |
|
2352 |
else if ( CALL_MODEM_SSI_MPTY == ssNotifyIndicator ) // Conference call |
|
2353 |
{ |
|
2354 |
ssInfo.iConfInd = ETrue; |
|
2355 |
} |
|
2356 |
// CLIR suppresion rejected |
|
2357 |
else if ( CALL_MODEM_SSI_CLIR_SUPPR_REJ == ssNotifyIndicator ) |
|
2358 |
{ |
|
2359 |
ssInfo.iClirSuppReject = ETrue; |
|
2360 |
} |
|
2361 |
// No else |
|
2362 |
} |
|
2363 |
||
2364 |
// Get CALL_MODEM_SB_SS_HOLD_INDICATOR sub block |
|
2365 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2366 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2367 |
CALL_MODEM_SB_SS_HOLD_INDICATOR, |
|
2368 |
EIsiSubBlockTypeId8Len8, |
|
2369 |
sbStartOffSet ) ) |
|
2370 |
{ |
|
2371 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2372 |
- CALL_MODEM_SB_SS_HOLD_INDICATOR sub block founded"); |
|
2373 |
OstTrace0( TRACE_NORMAL, DUP6_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_SS_HOLD_INDICATOR sub block found" ); |
|
2374 |
||
2375 |
// Get the ectIndictor |
|
2376 |
TUint8 holdIndicator( aIsiMsg.Get8bit( sbStartOffSet + |
|
2377 |
CALL_MODEM_SB_SS_HOLD_INDICATOR_OFFSET_SSHOLDINDICATOR ) ); |
|
2378 |
||
2379 |
// If hold indicator is 1 |
|
2380 |
if ( holdIndicator ) |
|
2381 |
{ |
|
2382 |
ssInfo.iCallHold = RMmCustomAPI::ESsHoldActive; |
|
2383 |
} |
|
2384 |
else // hold indicator is 0 |
|
2385 |
{ |
|
2386 |
ssInfo.iCallHold = RMmCustomAPI::ESsHoldResume; |
|
2387 |
} |
|
2388 |
} |
|
2389 |
||
2390 |
// Get CALL_MODEM_SB_CUG_INFO sub block |
|
2391 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2392 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2393 |
CALL_MODEM_SB_CUG_INFO, |
|
2394 |
EIsiSubBlockTypeId8Len8, |
|
2395 |
sbStartOffSet ) ) |
|
2396 |
{ |
|
2397 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2398 |
- CALL_MODEM_SB_CUG_INFO sub block founded"); |
|
2399 |
OstTrace0( TRACE_NORMAL, DUP7_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_CUG_INFO sub block found" ); |
|
2400 |
||
2401 |
// Get the CUG index |
|
2402 |
ssInfo.iCugIndex = aIsiMsg.Get16bit( |
|
2403 |
sbStartOffSet + CALL_MODEM_SB_CUG_INFO_OFFSET_CUGIND ); |
|
2404 |
} |
|
2405 |
||
2406 |
// Get CALL_MODEM_SB_SS_ECT_INDICATOR sub block |
|
2407 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2408 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2409 |
CALL_MODEM_SB_SS_ECT_INDICATOR, |
|
2410 |
EIsiSubBlockTypeId8Len8, |
|
2411 |
sbStartOffSet ) ) |
|
2412 |
{ |
|
2413 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2414 |
- CALL_MODEM_SB_SS_ECT_INDICATOR sub block founded"); |
|
2415 |
OstTrace0( TRACE_NORMAL, DUP8_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_SS_ECT_INDICATOR sub block found" ); |
|
2416 |
||
2417 |
// Get the ectIndictor |
|
2418 |
TUint8 ectIndicator( aIsiMsg.Get8bit( |
|
2419 |
sbStartOffSet + CALL_MODEM_SB_SS_ECT_INDICATOR_OFFSET_SSECTINDICATOR ) ); |
|
2420 |
||
2421 |
// If ect is 1 |
|
2422 |
if ( ectIndicator ) |
|
2423 |
{ |
|
2424 |
ssInfo.iEctCallState = RMmCustomAPI::ESsEctActive; |
|
2425 |
} |
|
2426 |
else // ect is 0 |
|
2427 |
{ |
|
2428 |
ssInfo.iEctCallState = RMmCustomAPI::ESsEctAlerting; |
|
2429 |
} |
|
2430 |
} |
|
2431 |
||
2432 |
// Get CALL_MODEM_SB_REMOTE_ADDRESS sub block |
|
2433 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2434 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2435 |
CALL_MODEM_SB_REMOTE_ADDRESS, |
|
2436 |
EIsiSubBlockTypeId8Len8, |
|
2437 |
sbStartOffSet ) ) |
|
2438 |
{ |
|
2439 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2440 |
- CALL_MODEM_SB_REMOTE_ADDRESS sub block founded"); |
|
2441 |
OstTrace0( TRACE_NORMAL, DUP9_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_REMOTE_ADDRESS sub block found" ); |
|
2442 |
||
2443 |
// Get the presentation |
|
2444 |
||
2445 |
TUint8 presentationIndicator( aIsiMsg.Get8bit( |
|
2446 |
sbStartOffSet + CALL_MODEM_SB_REMOTE_ADDRESS_OFFSET_PRESENTATION ) ); |
|
2447 |
// Mask with 0110 0000 to get bits 6-7 |
|
2448 |
presentationIndicator &= 0x60; |
|
2449 |
||
2450 |
switch ( presentationIndicator ) |
|
2451 |
{ |
|
2452 |
case CALL_MODEM_PRESENTATION_ALLOWED: |
|
2453 |
{ |
|
2454 |
ssInfo.iChoice = RMmCustomAPI::ESsPresAllowed; |
|
2455 |
break; |
|
2456 |
} |
|
2457 |
case CALL_MODEM_PRESENTATION_RESTRICTED: |
|
2458 |
{ |
|
2459 |
ssInfo.iChoice = RMmCustomAPI::ESsPresRestricted; |
|
2460 |
break; |
|
2461 |
} |
|
2462 |
case CALL_MODEM_PRESENTATION_UNAVAILABLE: |
|
2463 |
{ |
|
2464 |
ssInfo.iChoice = RMmCustomAPI::ESsNumberNotAvailable; |
|
2465 |
break; |
|
2466 |
} |
|
2467 |
default: |
|
2468 |
{ |
|
2469 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2470 |
- CALL_MODEM_SB_REMOTE_ADDRESS sub block\ |
|
2471 |
- switch presentationIndicator - default."); |
|
2472 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, switch presentationIndicator - default" ); |
|
2473 |
// The variable already has a default value |
|
2474 |
break; |
|
2475 |
} |
|
2476 |
} |
|
2477 |
||
2478 |
// Copy the number with rigth endianess |
|
2479 |
TUint8 remoteAddressLength( aIsiMsg.Get8bit( |
|
2480 |
sbStartOffSet + CALL_MODEM_SB_REMOTE_ADDRESS_OFFSET_ADDRLEN ) ); |
|
2481 |
||
2482 |
// Copy 8-bit name to the 16-bit target using correct endianess |
|
2483 |
TIsiUtility::CopyFromBigEndian( aIsiMsg.GetData( |
|
2484 |
sbStartOffSet + CALL_MODEM_SB_REMOTE_ADDRESS_OFFSET_ADDR, |
|
2485 |
remoteAddressLength ), |
|
2486 |
ssInfo.iRemoteAddress ); |
|
2487 |
} |
|
2488 |
||
2489 |
// Get CALL_MODEM_SB_ALERTING_INFO sub block |
|
2490 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2491 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2492 |
CALL_MODEM_SB_ALERTING_INFO, |
|
2493 |
EIsiSubBlockTypeId8Len8, |
|
2494 |
sbStartOffSet ) ) |
|
2495 |
{ |
|
2496 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CallGsmNotificationInd,\ |
|
2497 |
- CALL_MODEM_SB_ALERTING_INFO sub block founded"); |
|
2498 |
OstTrace0( TRACE_NORMAL, DUP10_CMMCUSTOMMESSHANDLER_CALLGSMNOTIFICATIONIND, "CMmCustomMessHandler::CallGsmNotificationInd, CALL_MODEM_SB_ALERTING_INFO sub block found" ); |
|
2499 |
||
2500 |
TBool playRemoteAlertToneLocally( EFalse ); |
|
2501 |
||
2502 |
// Get alerting info |
|
2503 |
TUint8 callAlertingInfo( aIsiMsg.Get8bit( |
|
2504 |
sbStartOffSet + CALL_MODEM_SB_ALERTING_INFO_OFFSET_ALERTINGINFO ) ); |
|
2505 |
||
2506 |
// If LSB is "1" inform that remote alerting tone |
|
2507 |
// should be generated locally. |
|
2508 |
if ( callAlertingInfo & 0x01 ) |
|
2509 |
{ |
|
2510 |
playRemoteAlertToneLocally = ETrue; |
|
2511 |
} |
|
2512 |
||
2513 |
// Complete remote alerting tone notification |
|
2514 |
// Parameter for SOS layer: a TBool playRemoteAlertToneLocally |
|
2515 |
dataPackage.PackData( &playRemoteAlertToneLocally ); |
|
2516 |
iMessageRouter->Complete( ECustomGetRemoteAlertingToneStatusIPC, |
|
2517 |
&dataPackage, |
|
2518 |
KErrNone ); |
|
2519 |
} |
|
2520 |
||
2521 |
// Complete SsNetworkEvent notification |
|
2522 |
// Pack parameter: a RMmCustomAPI::TSsTypeAndMode and |
|
2523 |
// a RMmCustomAPI::TSsInfo |
|
2524 |
dataPackage.PackData( &ssTypeAndMode, &ssInfo ); |
|
2525 |
iMessageRouter->Complete( ECustomNotifySsNetworkEventIPC, |
|
2526 |
&dataPackage, |
|
2527 |
ret ); |
|
2528 |
} |
|
2529 |
||
2530 |
// ----------------------------------------------------------------------------- |
|
2531 |
// CMmCustomMessHandler::HandleForwarding |
|
2532 |
// Breaks a CALL_MODEM_NOTIFICATION_IND ISI message. |
|
2533 |
// Gets forwardfing related information from message and sets it in |
|
2534 |
// aSsTypeAndMode for further completion in the method CallGsmNotificationIndL2 |
|
2535 |
// to SOS layer. |
|
2536 |
// (other items were commented in a header). |
|
2537 |
// ----------------------------------------------------------------------------- |
|
2538 |
// |
|
2539 |
void CMmCustomMessHandler::HandleForwarding |
|
2540 |
( |
|
2541 |
TUint16 aSsCode, //SS code |
|
2542 |
const TIsiReceiveC& aIsiMsg, //Isi message |
|
2543 |
RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode //ss type and mode |
|
2544 |
) const |
|
2545 |
{ |
|
2546 |
TFLOGSTRING("TSY: CMmCustomMessHandler::HandleForwarding.\n" ); |
|
2547 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_HANDLEFORWARDING, "CMmCustomMessHandler::HandleForwarding" ); |
|
2548 |
||
2549 |
//identify the kind of forwarding |
|
2550 |
switch ( aSsCode ) |
|
2551 |
{ |
|
2552 |
case CALL_MODEM_SSC_ALL_FWDS: |
|
2553 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsAllForwardings; |
|
2554 |
break; |
|
2555 |
case CALL_MODEM_SSC_CFU: |
|
2556 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsForwUncond; |
|
2557 |
break; |
|
2558 |
case CALL_MODEM_SSC_CFB: |
|
2559 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsForwBusy; |
|
2560 |
break; |
|
2561 |
case CALL_MODEM_SSC_CFNRY: |
|
2562 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsForwNoReply; |
|
2563 |
break; |
|
2564 |
case CALL_MODEM_SSC_CFGNC: |
|
2565 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsForwNoReach; |
|
2566 |
break; |
|
2567 |
case CALL_MODEM_SSC_ALL_COND_FWD: |
|
2568 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsAllCondForwardings; |
|
2569 |
break; |
|
2570 |
default: |
|
2571 |
TFLOGSTRING("TSY: CMmCustomMessHandler::HandleForwarding, switch aSsCode - default.\n" ); |
|
2572 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_HANDLEFORWARDING, "CMmCustomMessHandler::HandleForwarding, switch aSsCode - default" ); |
|
2573 |
//this case is imposible, added due code convention |
|
2574 |
break; |
|
2575 |
} |
|
2576 |
||
2577 |
TUint sbStartOffSet( 0 ); |
|
2578 |
||
2579 |
//get call gsm ss status sub block |
|
2580 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2581 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2582 |
CALL_MODEM_SB_SS_STATUS, EIsiSubBlockTypeId8Len8, sbStartOffSet ) ) |
|
2583 |
{ |
|
2584 |
//get the ss status |
|
2585 |
TUint8 ssStatus ( aIsiMsg.Get8bit( sbStartOffSet + |
|
2586 |
CALL_MODEM_SB_SS_STATUS_OFFSET_SSSTATUS ) ); |
|
2587 |
||
2588 |
//set the right status for the bit configuration of ssStatus |
|
2589 |
if ( CALL_MODEM_SS_STATUS_ACTIVE & ssStatus ) //if active is present |
|
2590 |
{ |
|
2591 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeActive; |
|
2592 |
} |
|
2593 |
// if quiescent is present |
|
2594 |
else if ( CALL_MODEM_SS_STATUS_QUIESCENT & ssStatus ) |
|
2595 |
{ |
|
2596 |
//if registered and provisioned, and not active or quiescent |
|
2597 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeNotAvailable; |
|
2598 |
} |
|
2599 |
//if registered and provisioned, and not active or quiescent |
|
2600 |
else if ( ( CALL_MODEM_SS_STATUS_REGISTERED | CALL_MODEM_SS_STATUS_PROVISIONED ) |
|
2601 |
== ssStatus ) |
|
2602 |
{ |
|
2603 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeNotActive; |
|
2604 |
} |
|
2605 |
else if ( CALL_MODEM_SS_STATUS_PROVISIONED == ssStatus ) //only provisioned |
|
2606 |
{ |
|
2607 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeNotRegistered; |
|
2608 |
} |
|
2609 |
else //not provisioned |
|
2610 |
{ |
|
2611 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeNotProvisioned; |
|
2612 |
} |
|
2613 |
} |
|
2614 |
} |
|
2615 |
||
2616 |
// ----------------------------------------------------------------------------- |
|
2617 |
// CMmCustomMessHandler::HandleBarring |
|
2618 |
// Breaks a CALL_MODEM_NOTIFICATION_IND ISI message. |
|
2619 |
// Gets barring related information from message and sets it in |
|
2620 |
// aSsTypeAndMode for further completion in the method CallGsmNotificationIndL2. |
|
2621 |
// to SOS layer. |
|
2622 |
// (other items were commented in a header). |
|
2623 |
// ----------------------------------------------------------------------------- |
|
2624 |
// |
|
2625 |
void CMmCustomMessHandler::HandleBarring |
|
2626 |
( |
|
2627 |
TUint16 aSsCode, //SS code |
|
2628 |
const TIsiReceiveC& aIsiMsg, //ISI message |
|
2629 |
RMmCustomAPI::TSsTypeAndMode& aSsTypeAndMode //Ss type and mode |
|
2630 |
) const |
|
2631 |
{ |
|
2632 |
TFLOGSTRING("TSY: CMmCustomMessHandler::HandleBarring.\n" ); |
|
2633 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_HANDLEBARRING, "CMmCustomMessHandler::HandleBarring" ); |
|
2634 |
||
2635 |
//identify the kind of barring |
|
2636 |
switch ( aSsCode ) |
|
2637 |
{ |
|
2638 |
case CALL_MODEM_SSC_OUTGOING_BARR_SERV: |
|
2639 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsOutgoingBarrServ; |
|
2640 |
break; |
|
2641 |
case CALL_MODEM_SSC_INCOMING_BARR_SERV: |
|
2642 |
aSsTypeAndMode.iSsType = RMmCustomAPI::ESsIncomingBarrServ; |
|
2643 |
break; |
|
2644 |
default: |
|
2645 |
TFLOGSTRING("TSY: CMmCustomMessHandler::HandleBarring, switch aSsCode - default.\n" ); |
|
2646 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_HANDLEBARRING, "CMmCustomMessHandler::HandleBarring, switch aSsCode - default" ); |
|
2647 |
//this case is imposible, added due code convention |
|
2648 |
break; |
|
2649 |
} |
|
2650 |
||
2651 |
TUint sbStartOffSet( 0 ); |
|
2652 |
||
2653 |
//get call gsm ss status sub block |
|
2654 |
if ( KErrNone == aIsiMsg.FindSubBlockOffsetById( |
|
2655 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_NOTIFICATION_IND, |
|
2656 |
CALL_MODEM_SB_SS_STATUS, EIsiSubBlockTypeId8Len8, sbStartOffSet ) ) |
|
2657 |
{ |
|
2658 |
//get the ss status |
|
2659 |
TUint8 ssStatus ( aIsiMsg.Get8bit( sbStartOffSet + |
|
2660 |
CALL_MODEM_SB_SS_STATUS_OFFSET_SSSTATUS ) ); |
|
2661 |
||
2662 |
//set the right status for the bit configuration of ssStatus |
|
2663 |
if ( CALL_MODEM_SS_STATUS_ACTIVE & ssStatus ) //if active is present |
|
2664 |
{ |
|
2665 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeActive; |
|
2666 |
} |
|
2667 |
//if quiescent is present |
|
2668 |
else if ( CALL_MODEM_SS_STATUS_QUIESCENT & ssStatus ) |
|
2669 |
{ |
|
2670 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeNotAvailable; |
|
2671 |
} |
|
2672 |
else if ( CALL_MODEM_SS_STATUS_PROVISIONED == ssStatus ) //only provisioned |
|
2673 |
{ |
|
2674 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeNotRegistered; |
|
2675 |
} |
|
2676 |
else |
|
2677 |
{ |
|
2678 |
aSsTypeAndMode.iSsMode = RMmCustomAPI::ESsModeNotProvisioned; |
|
2679 |
} |
|
2680 |
} |
|
2681 |
} |
|
2682 |
||
2683 |
// ----------------------------------------------------------------------------- |
|
2684 |
// CMmCustomMessHandler::NetSetReq |
|
2685 |
// Constructs NET_SET_REQ ISI message from input parameters |
|
2686 |
// and sends it through phonet. |
|
2687 |
// This message is created for reseting the network server |
|
2688 |
// to previous registered network when the user doesn't select |
|
2689 |
// a network from the network list got in a search |
|
2690 |
// (other items were commented in a header). |
|
2691 |
// ----------------------------------------------------------------------------- |
|
2692 |
// |
|
2693 |
TInt CMmCustomMessHandler::NetSetReq( TUint8 aTransId ) |
|
2694 |
{ |
|
2695 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetSetReq"); |
|
2696 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETSETREQ, "CMmCustomMessHandler::NetSetReq" ); |
|
2697 |
||
2698 |
// Data for ISI message, buffer size is one |
|
2699 |
TBuf8<2 + SIZE_NET_OPERATOR_INFO_COMMON> netSetReq; |
|
2700 |
// Registered in another protocol is set to 0 |
|
2701 |
netSetReq.Append ( 0 ); |
|
2702 |
||
2703 |
// 1 SubBlock |
|
2704 |
netSetReq.Append ( 1 ); |
|
2705 |
||
2706 |
TBuf8<SIZE_NET_OPERATOR_INFO_COMMON> netGsmOperatorInfoCommonBuf; |
|
2707 |
TIsiSubBlock netGsmOperatorInfoCommonSb( |
|
2708 |
netGsmOperatorInfoCommonBuf, |
|
2709 |
NET_OPERATOR_INFO_COMMON, |
|
2710 |
EIsiSubBlockTypeId8Len8 ); |
|
2711 |
||
2712 |
netGsmOperatorInfoCommonBuf.Append( NET_SELECT_MODE_NO_SELECTION ); |
|
2713 |
netGsmOperatorInfoCommonBuf.Append( NET_INDEX_NOT_USED ); |
|
2714 |
||
2715 |
netSetReq.Append( netGsmOperatorInfoCommonSb.CompleteSubBlock() ); |
|
2716 |
||
2717 |
// Send message via Phonet |
|
2718 |
return iPhoNetSender->Send( |
|
2719 |
PN_MODEM_NETWORK, |
|
2720 |
aTransId, |
|
2721 |
NET_SET_REQ, |
|
2722 |
netSetReq ); |
|
2723 |
} |
|
2724 |
||
2725 |
// ----------------------------------------------------------------------------- |
|
2726 |
// CMmCustomMessHandler::NetSetResp |
|
2727 |
// Breaks a NET_SERVER_RESP ISI message. |
|
2728 |
// This message maps the CS cause value to ETel error value and complete |
|
2729 |
// CompleteResetNetServer to SOS layer. |
|
2730 |
// (other items were commented in a header). |
|
2731 |
// ----------------------------------------------------------------------------- |
|
2732 |
// |
|
2733 |
void CMmCustomMessHandler::NetSetResp( const TIsiReceiveC& aIsiMsg ) |
|
2734 |
{ |
|
2735 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetSetResp"); |
|
2736 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETSETRESP, "CMmCustomMessHandler::NetSetResp" ); |
|
2737 |
||
2738 |
// Get the cause |
|
2739 |
TUint8 cause( aIsiMsg.Get8bit( |
|
2740 |
ISI_HEADER_SIZE + |
|
2741 |
NET_SET_RESP_OFFSET_SUCCESSCODE ) ); |
|
2742 |
||
2743 |
// Map the cs error as symbian value |
|
2744 |
TInt error( CMmStaticUtility::CSCauseToEpocError( |
|
2745 |
PN_MODEM_NETWORK, |
|
2746 |
KTsyNetCauseCommon, |
|
2747 |
cause ) ); |
|
2748 |
||
2749 |
// Completion ResetNetServer method (no packed parameters) |
|
2750 |
iMessageRouter->Complete( ECustomResetNetServerIPC, error ); |
|
2751 |
} |
|
2752 |
||
2753 |
// ----------------------------------------------------------------------------- |
|
2754 |
// CMmCustomMessHandler::NetRatResp |
|
2755 |
// Breaks a NET_SERVER_RESP ISI message. |
|
2756 |
// This method get RatName sub blocks maps the CS cause value to ETel error |
|
2757 |
// value and complete ResetNetServer to SOS layer. |
|
2758 |
// (other items were commented in a header). |
|
2759 |
// ----------------------------------------------------------------------------- |
|
2760 |
// |
|
2761 |
void CMmCustomMessHandler::NetRatResp( const TIsiReceiveC& aIsiMsg ) |
|
2762 |
{ |
|
2763 |
TFLOGSTRING( "TSY: CMmCustomMessHandler::NetRatResp"); |
|
2764 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETRATRESP, "CMmCustomMessHandler::NetRatResp" ); |
|
2765 |
||
2766 |
// Get the success code |
|
2767 |
TUint8 successCode( aIsiMsg.Get8bit( |
|
2768 |
ISI_HEADER_SIZE + NET_RAT_RESP_OFFSET_SUCCESSCODE ) ); |
|
2769 |
||
2770 |
TInt ret( KErrNone ); |
|
2771 |
||
2772 |
TUint32 supportedNetworkModes( 0 ); |
|
2773 |
||
2774 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::NetRatResp successCode : %d", successCode); |
|
2775 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_NETRATRESP, "CMmCustomMessHandler::NetRatResp;successCode=%hhu", successCode ); |
|
2776 |
||
2777 |
// Check if we have sub blocks in the message |
|
2778 |
if ( aIsiMsg.Get8bit( ISI_HEADER_SIZE + NET_RAT_RESP_OFFSET_SUBBLOCKCOUNT ) |
|
2779 |
!= 0 && NET_CAUSE_OK == successCode ) |
|
2780 |
{ |
|
2781 |
TUint8 subBlockIndex( 1 ); |
|
2782 |
TUint sbStartOffSet( 0 ); |
|
2783 |
||
2784 |
// NET_RAT_INFO sub block |
|
2785 |
while ( KErrNone == aIsiMsg.FindSubBlockOffsetByIndex( |
|
2786 |
ISI_HEADER_SIZE + SIZE_NET_RAT_RESP, |
|
2787 |
subBlockIndex, |
|
2788 |
EIsiSubBlockTypeId8Len8, |
|
2789 |
sbStartOffSet ) ) |
|
2790 |
{ |
|
2791 |
// Get ratName |
|
2792 |
TUint8 ratName( aIsiMsg.Get8bit( |
|
2793 |
sbStartOffSet + NET_RAT_INFO_OFFSET_RATNAME ) ); |
|
2794 |
||
2795 |
switch ( ratName ) |
|
2796 |
{ |
|
2797 |
case NET_GSM_RAT: |
|
2798 |
{ |
|
2799 |
supportedNetworkModes += RMmCustomAPI::KCapsNetworkModeGsm; |
|
2800 |
break; |
|
2801 |
} |
|
2802 |
case NET_UMTS_RAT: |
|
2803 |
{ |
|
2804 |
supportedNetworkModes += RMmCustomAPI::KCapsNetworkModeUmts; |
|
2805 |
break; |
|
2806 |
} |
|
2807 |
} |
|
2808 |
subBlockIndex++; |
|
2809 |
} |
|
2810 |
} |
|
2811 |
else |
|
2812 |
{ |
|
2813 |
// Map the cs error as symbian value |
|
2814 |
ret = CMmStaticUtility::CSCauseToEpocError( |
|
2815 |
PN_MODEM_NETWORK, |
|
2816 |
KTsyNetCauseCommon, |
|
2817 |
successCode ); |
|
2818 |
} |
|
2819 |
||
2820 |
CMmDataPackage dataPackage; |
|
2821 |
dataPackage.PackData( &supportedNetworkModes ); |
|
2822 |
||
2823 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::NetRatResp - ret: %d", ret); |
|
2824 |
OstTrace1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_NETRATRESP, "CMmCustomMessHandler::NetRatResp;ret=%d", ret ); |
|
2825 |
||
2826 |
// Completion ResetNetServer method (packed parameters) |
|
2827 |
iMessageRouter->Complete( |
|
2828 |
ECustomGetSystemNetworkModesIPC, |
|
2829 |
&dataPackage, |
|
2830 |
ret ); |
|
2831 |
} |
|
2832 |
||
2833 |
// ----------------------------------------------------------------------------- |
|
2834 |
// CMmCustomMessHandler::GssCsServiceResp |
|
2835 |
// Breaks a GSS_CS_SERVICE_RESP ISI message. |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2836 |
// completes ECustomSetSystemNetworkModeIPC, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2837 |
// ECustomGetCurrentSystemNetworkModesIPC, ECustomSetBandSelectionIPC or |
0 | 2838 |
// ECustomGetBandSelectionIPC with KErrNone to SOS layer. |
2839 |
// (other items were commented in a header). |
|
2840 |
// ----------------------------------------------------------------------------- |
|
2841 |
// |
|
2842 |
void CMmCustomMessHandler::GssCsServiceResp ( |
|
2843 |
const TIsiReceiveC& aIsiMessage ) // Received isi message |
|
2844 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2845 |
TFLOGSTRING( "TSY: CMmCustomMessHandler::GssCsServiceResp" ); |
0 | 2846 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_GSSCSSERVICERESP, "CMmCustomMessHandler::GssCsServiceResp" ); |
2847 |
||
2848 |
TUint8 transactId ( aIsiMessage.Get8bit( |
|
2849 |
ISI_HEADER_SIZE + GSS_CS_SERVICE_RESP_OFFSET_TRANSID ) ); |
|
2850 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2851 |
if ( KCustomTransId == transactId ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2852 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2853 |
TUint8 operation ( aIsiMessage.Get8bit( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2854 |
ISI_HEADER_SIZE + GSS_CS_SERVICE_RESP_OFFSET_OPERATION ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2855 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2856 |
// GSS_SELECTED_RAT_WRITE (0x0E) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2857 |
if ( GSS_SELECTED_RAT_WRITE == operation ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2858 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2859 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GssCsServiceResp - Complete ECustomSetSystemNetworkModeIPC"); |
0 | 2860 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_GSSCSSERVICERESP, "CMmCustomMessHandler::GssCsServiceResp - Complete ECustomSetSystemNetworkModeIPC" ); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2861 |
//completion ResetGssServer method (no packed parameters) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2862 |
iMessageRouter->Complete( ECustomSetSystemNetworkModeIPC, KErrNone ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2863 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2864 |
// GSS_SELECTED_RAT_READ (0x9C) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2865 |
else if ( GSS_SELECTED_RAT_READ == operation ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2866 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2867 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GssCsServiceResp - Complete ECustomGetCurrentSystemNetworkModesIPC"); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2868 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_GSSCSSERVICERESP, "CMmCustomMessHandler::GssCsServiceResp - Complete ECustomGetCurrentSystemNetworkModesIPC" ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2869 |
TInt err( KErrNone ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2870 |
TUint32 ratMode ( RMmCustomAPI::KCapsNetworkModeDual ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2871 |
TUint subblockOffset( 0 ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2872 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2873 |
ISI_HEADER_SIZE + SIZE_GSS_CS_SERVICE_RESP, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2874 |
GSS_RAT_INFO, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2875 |
EIsiSubBlockTypeId8Len8, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2876 |
subblockOffset ) ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2877 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2878 |
TUint8 mode = aIsiMessage.Get8bit( subblockOffset + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2879 |
GSS_RAT_INFO_OFFSET_FUNCTION ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2880 |
switch ( mode ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2881 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2882 |
case GSS_GSM_RAT: |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2883 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2884 |
ratMode = RMmCustomAPI::KCapsNetworkModeGsm; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2885 |
break; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2886 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2887 |
case GSS_UMTS_RAT: |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2888 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2889 |
ratMode = RMmCustomAPI::KCapsNetworkModeUmts; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2890 |
break; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2891 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2892 |
case GSS_DUAL_RAT: |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2893 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2894 |
ratMode = RMmCustomAPI::KCapsNetworkModeDual; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2895 |
break; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2896 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2897 |
default: |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2898 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2899 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GssCsServiceResp - Unrecognized RAT"); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2900 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_GSSCSSERVICERESP, "CMmCustomMessHandler::GssCsServiceResp - Unrecognized RAT" ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2901 |
err = KErrGeneral; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2902 |
break; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2903 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2904 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2905 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2906 |
else |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2907 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2908 |
err = KErrGeneral; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2909 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2910 |
CMmDataPackage dataPackage; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2911 |
dataPackage.PackData( &ratMode ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2912 |
//completion ResetNetServer method (packed parameters) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2913 |
iMessageRouter->Complete( ECustomGetCurrentSystemNetworkModesIPC, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2914 |
&dataPackage, err ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2915 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2916 |
// not suppoted for S60 ver 3.2 |
0 | 2917 |
#if ( NCP_COMMON_S60_VERSION_SUPPORT != S60_VERSION_32 ) |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2918 |
// GSS_SELECTED_BANDS_WRITE (0x9D) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2919 |
else if ( GSS_SELECTED_BANDS_WRITE == operation ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2920 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2921 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GssCsServiceResp - Complete ECustomSetBandSelectionIPC"); |
0 | 2922 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_GSSCSSERVICERESP, "CMmCustomMessHandler::GssCsServiceResp - Complete ECustomSetBandSelectionIPC" ); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2923 |
iMessageRouter->Complete( ECustomSetBandSelectionIPC, KErrNone ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2924 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2925 |
// GSS_SELECTED_BANDS_READ (0x9E) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2926 |
else if ( GSS_SELECTED_BANDS_READ == operation ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2927 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2928 |
CompleteGetBandSelection( aIsiMessage ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2929 |
} |
0 | 2930 |
#endif // NCP_COMMON_S60_VERSION_SUPPORT |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2931 |
} |
0 | 2932 |
} |
2933 |
||
2934 |
// ----------------------------------------------------------------------------- |
|
2935 |
// CMmCustomMessHandler::GssCsServiceFailResp |
|
2936 |
// Breaks a GSS_CS_SERVICE_FAIL_RESP ISI message. |
|
2937 |
// completes ECustomSetSystemNetworkModeIPC, ECustomSetBandSelectionIPC |
|
2938 |
// or ECustomGetBandSelectionIPC with error value to SOS layer. |
|
2939 |
// (other items were commented in a header). |
|
2940 |
// ----------------------------------------------------------------------------- |
|
2941 |
// |
|
2942 |
void CMmCustomMessHandler::GssCsServiceFailResp ( |
|
2943 |
const TIsiReceiveC& aIsiMessage ) // Received isi message |
|
2944 |
{ |
|
2945 |
TFLOGSTRING( "TSY: CMmCustomMessHandler::GssCsServiceFailResp" ); |
|
2946 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_GSSCSSERVICEFAILRESP, "CMmCustomMessHandler::GssCsServiceFailResp" ); |
|
2947 |
||
2948 |
TUint8 transactId ( aIsiMessage.Get8bit( ISI_HEADER_SIZE + |
|
2949 |
GSS_CS_SERVICE_FAIL_RESP_OFFSET_TRANSID ) ); |
|
2950 |
TUint8 operation ( aIsiMessage.Get8bit( ISI_HEADER_SIZE + |
|
2951 |
GSS_CS_SERVICE_FAIL_RESP_OFFSET_OPERATION ) ); |
|
2952 |
||
2953 |
// GSS_SELECTED_RAT_WRITE (0x0E) |
|
2954 |
if ( KCustomTransId == transactId && GSS_SELECTED_RAT_WRITE == operation ) |
|
2955 |
{ |
|
2956 |
//completion ResetGssServer method (no packed parameters) |
|
2957 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GssCsServiceFailResp - ECustomSetSystemNetworkModeIPC"); |
|
2958 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_GSSCSSERVICEFAILRESP, "CMmCustomMessHandler::GssCsServiceFailResp - ECustomSetSystemNetworkModeIPC" ); |
|
2959 |
iMessageRouter->Complete( ECustomSetSystemNetworkModeIPC, KErrGeneral ); |
|
2960 |
} |
|
2961 |
// not suppoted for S60 ver 3.2 |
|
2962 |
#if ( NCP_COMMON_S60_VERSION_SUPPORT != S60_VERSION_32 ) |
|
2963 |
||
2964 |
else if ( GSS_SELECTED_BANDS_WRITE == operation ) |
|
2965 |
{ |
|
2966 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GssCsServiceFailResp - ECustomSetBandSelectionIPC"); |
|
2967 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_GSSCSSERVICEFAILRESP, "CMmCustomMessHandler::GssCsServiceFailResp - ECustomSetBandSelectionIPC" ); |
|
2968 |
iMessageRouter->Complete( ECustomSetBandSelectionIPC, KErrGeneral ); |
|
2969 |
} |
|
2970 |
else if ( GSS_SELECTED_BANDS_READ == operation ) |
|
2971 |
{ |
|
2972 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GssCsServiceFailResp - ECustomGetBandSelectionIPC"); |
|
2973 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_GSSCSSERVICEFAILRESP, "CMmCustomMessHandler::GssCsServiceFailResp - ECustomGetBandSelectionIPC" ); |
|
2974 |
iMessageRouter->Complete( ECustomGetBandSelectionIPC, KErrGeneral ); |
|
2975 |
} |
|
2976 |
#endif // NCP_COMMON_S60_VERSION_SUPPORT |
|
2977 |
} |
|
2978 |
||
2979 |
// ----------------------------------------------------------------------------- |
|
2980 |
// CMmCustomMessHandler::UiccReadFieldReq |
|
2981 |
// Read given file from UICC |
|
2982 |
// ----------------------------------------------------------------------------- |
|
2983 |
// |
|
2984 |
TInt CMmCustomMessHandler::UiccReadFieldReq( |
|
2985 |
RMmCustomAPI::TSimFileInfo& aSimFileInfo ) |
|
2986 |
{ |
|
2987 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadFieldReq" ); |
|
2988 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADFIELDREQ, "CMmCustomMessHandler::UiccReadFieldReq" ); |
|
2989 |
||
2990 |
// We have received only file path, file ID is two last bytes of path |
|
2991 |
TInt length( aSimFileInfo.iPath.Length() ); |
|
2992 |
TBuf8<2> temp; |
|
2993 |
if ( 2 <= length ) |
|
2994 |
{ |
|
2995 |
temp.Append( aSimFileInfo.iPath.Mid( length - 2 ) ); |
|
2996 |
} |
|
2997 |
TUint16 fileId( static_cast<TUint16> ( (temp[0] << 8 ) | temp[1] ) ); |
|
2998 |
||
2999 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
3000 |
TUiccReadTransparent params; |
|
3001 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
3002 |
params.trId = ETrIdReadField; |
|
3003 |
params.dataAmount = aSimFileInfo.iSize; |
|
3004 |
params.dataOffset = aSimFileInfo.iOffSet; |
|
3005 |
params.fileId = fileId; |
|
3006 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
3007 |
params.filePath = aSimFileInfo.iPath.Mid( 0, length - 2 ); |
|
3008 |
||
3009 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
3010 |
} |
|
3011 |
||
3012 |
// ----------------------------------------------------------------------------- |
|
3013 |
// CMmCustomMessHandler::UiccReadFieldResp |
|
3014 |
// Complete read file |
|
3015 |
// ----------------------------------------------------------------------------- |
|
3016 |
// |
|
3017 |
void CMmCustomMessHandler::UiccReadFieldResp( |
|
3018 |
TInt aStatus, |
|
3019 |
const TDesC8& aFileData ) |
|
3020 |
{ |
|
3021 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadFieldResp" ); |
|
3022 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADFIELDRESP, "CMmCustomMessHandler::UiccReadFieldResp" ); |
|
3023 |
||
3024 |
TInt error( KErrNone ); |
|
3025 |
if ( aStatus != KErrNone ) |
|
3026 |
{ |
|
3027 |
error = KErrNotFound; |
|
3028 |
} |
|
3029 |
||
3030 |
// Packed parameter for completion: pointer to TDesC8 with data |
|
3031 |
const TDesC8* dataPtr = &aFileData; |
|
3032 |
CMmDataPackage dataPackage; |
|
3033 |
dataPackage.PackData( &dataPtr ); |
|
3034 |
iMessageRouter->Complete( ECustomReadSimFileIPC, &dataPackage, error); |
|
3035 |
} |
|
3036 |
||
3037 |
// ----------------------------------------------------------------------------- |
|
3038 |
// CMmCustomMessHandler::NetRatReq |
|
3039 |
// Constructs NET_RAT_REQ ISI message from input parameters and |
|
3040 |
// sends it through phonet.This message is created to read Supported Net Rats |
|
3041 |
// (other items were commented in a header). |
|
3042 |
// ----------------------------------------------------------------------------- |
|
3043 |
// |
|
3044 |
TInt CMmCustomMessHandler::NetRatReq |
|
3045 |
( |
|
3046 |
TUint8 aTransId, // transaction Id |
|
3047 |
TBool aUseCurrentRats // use current rats setting |
|
3048 |
) |
|
3049 |
{ |
|
3050 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetRatReq"); |
|
3051 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETRATREQ, "CMmCustomMessHandler::NetRatReq" ); |
|
3052 |
||
3053 |
TFLOGSTRING3( "TSY: CCMmCustomMessHandler::NetRatReq - aTransId: %d, aUseCurrentRats: %d", aTransId, aUseCurrentRats ); |
|
3054 |
OstTraceExt2( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_NETRATREQ, "CMmCustomMessHandler::NetRatReq;aTransId=%hhu;aUseCurrentRats=%hhu", aTransId, aUseCurrentRats ); |
|
3055 |
||
3056 |
// Create message data buffer for service type, buffer size is 1 |
|
3057 |
TBuf8<1> messageData; |
|
3058 |
// Append service type |
|
3059 |
if ( aUseCurrentRats ) |
|
3060 |
{ |
|
3061 |
messageData.Append( NET_CURRENT_RAT ); |
|
3062 |
} |
|
3063 |
else |
|
3064 |
{ |
|
3065 |
messageData.Append( NET_SUPPORTED_RATS ); |
|
3066 |
} |
|
3067 |
||
3068 |
// Sending message to phonet |
|
3069 |
return iPhoNetSender->Send( |
|
3070 |
PN_MODEM_NETWORK, |
|
3071 |
aTransId, |
|
3072 |
NET_RAT_REQ, |
|
3073 |
messageData ); |
|
3074 |
} |
|
3075 |
||
3076 |
// ----------------------------------------------------------------------------- |
|
3077 |
// CMmCustomMessHandler::GssCsServiceReq |
|
3078 |
// Constructs GSS_CS_SERVICE_REQ ISI message from input parameters and |
|
3079 |
// sends it through phonet.This message is created to set System network mode |
|
3080 |
// (other items were commented in a header). |
|
3081 |
// ----------------------------------------------------------------------------- |
|
3082 |
// |
|
3083 |
TInt CMmCustomMessHandler::GssCsServiceReq |
|
3084 |
( |
|
3085 |
TUint8 aTransId, //transaction Id |
|
3086 |
RMmCustomAPI::TNetworkModeCaps aNetworkModeCaps //network mode caps |
|
3087 |
) |
|
3088 |
{ |
|
3089 |
||
3090 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::GssCsServiceReq - aTransId: %d", |
|
3091 |
aTransId ); |
|
3092 |
OstTraceExt1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_GSSCSSERVICEREQ, "CMmCustomMessHandler::GssCsServiceReq;aTransId=%hhu", aTransId ); |
|
3093 |
||
3094 |
// create message data buffer for service type, buffer size is 6 |
|
3095 |
TBuf8< KGssCsBufferSize > messageData; |
|
3096 |
||
3097 |
// append service type, GSS_SELECTED_RAT_WRITE (0x0E) |
|
3098 |
messageData.Append( GSS_SELECTED_RAT_WRITE ); |
|
3099 |
||
3100 |
// Number of sub blocks |
|
3101 |
messageData.Append( 1 ); |
|
3102 |
||
3103 |
// add the GSS_RAT_INFO (0x0B) subblock into ISI |
|
3104 |
messageData.Append( GSS_RAT_INFO ); |
|
3105 |
||
3106 |
// Length of sub block is 4 (SIZE_GSS_RAT_INFO) |
|
3107 |
messageData.Append( SIZE_GSS_RAT_INFO ); |
|
3108 |
||
3109 |
//Sub block for GSS_RAT_INFO_FUNCTIONS |
|
3110 |
if ( RMmCustomAPI::KCapsNetworkModeGsm == aNetworkModeCaps ) |
|
3111 |
{ |
|
3112 |
// GSS_GSM_RAT (0x01) is GSM mode |
|
3113 |
messageData.Append( GSS_GSM_RAT ); |
|
3114 |
} |
|
3115 |
else if ( RMmCustomAPI::KCapsNetworkModeUmts == aNetworkModeCaps ) |
|
3116 |
{ |
|
3117 |
// GSS_UMTS_RAT (0x02) is Umts mode |
|
3118 |
messageData.Append( GSS_UMTS_RAT ); |
|
3119 |
} |
|
3120 |
else |
|
3121 |
{ |
|
3122 |
// GSS_DUAL_RAT (0x00) is Dual mode |
|
3123 |
messageData.Append( GSS_DUAL_RAT ); |
|
3124 |
} |
|
3125 |
||
3126 |
// Padding byte |
|
3127 |
messageData.Append( KCustomPadding ); |
|
3128 |
||
3129 |
// Sending message to phonet |
|
3130 |
return iPhoNetSender->Send( PN_GSS, aTransId, GSS_CS_SERVICE_REQ, messageData ); |
|
3131 |
||
3132 |
} |
|
3133 |
||
3134 |
// ----------------------------------------------------------------------------- |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3135 |
// CMmCustomMessHandler::GssCsServiceReq |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3136 |
// Constructs GSS_CS_SERVICE_REQ ISI message from input parameters and |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3137 |
// sends it through phonet. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3138 |
// (other items were commented in a header). |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3139 |
// ----------------------------------------------------------------------------- |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3140 |
// |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3141 |
TInt CMmCustomMessHandler::GssCsServiceReq |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3142 |
( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3143 |
TUint8 aTransId //transaction Id |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3144 |
) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3145 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3146 |
TFLOGSTRING( "TSY: CMmCustomMessHandler::GssCsServiceReq" ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3147 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_GSSCSSERVICEREQ, "CMmCustomMessHandler::GssCsServiceReq" ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3148 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3149 |
TBuf8<KTwo> messageData; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3150 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3151 |
messageData.Append( GSS_SELECTED_RAT_READ ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3152 |
messageData.Append( 0 ); // number of subblocks |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3153 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3154 |
// Sending message to phonet |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3155 |
return iPhoNetSender->Send( PN_GSS, aTransId, GSS_CS_SERVICE_REQ, messageData ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3156 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3157 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3158 |
// ----------------------------------------------------------------------------- |
0 | 3159 |
// CMmCustomMessHandler::ExtFuncL |
3160 |
// Forwards requests coming from the Symbian OS layer to the |
|
3161 |
// specific method. |
|
3162 |
// ----------------------------------------------------------------------------- |
|
3163 |
// |
|
3164 |
TInt CMmCustomMessHandler::ExtFuncL |
|
3165 |
( |
|
3166 |
TInt aIpc, //Ipc |
|
3167 |
const CMmDataPackage* aDataPackage //data package |
|
3168 |
) |
|
3169 |
{ |
|
3170 |
||
3171 |
//*************************************************************// |
|
3172 |
// NOTE |
|
3173 |
// |
|
3174 |
// LICENSEE SPECIFIC MESSAGE HANDLER IMPLEMENTATION STARTS HERE |
|
3175 |
// |
|
3176 |
//*************************************************************// |
|
3177 |
||
3178 |
TInt ret( KErrNone ); |
|
3179 |
||
3180 |
TUint8 transId = KCustomTransId; |
|
3181 |
||
3182 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::ExtFuncL -- aIpc -- (%d)", aIpc ); |
|
3183 |
OstTrace1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_EXTFUNCL, "CMmCustomMessHandler::ExtFuncL;aIpc=%d", aIpc ); |
|
3184 |
||
3185 |
switch ( aIpc ) |
|
3186 |
{ |
|
3187 |
case ECustomCancelUssdSessionIPC: |
|
3188 |
{ |
|
3189 |
//no packed parameters |
|
3190 |
ret = SsGsmUssdSendReq( transId ); |
|
3191 |
break; |
|
3192 |
} |
|
3193 |
case ECustomClearCallBlackListIPC: |
|
3194 |
{ |
|
3195 |
//no packed parameters |
|
3196 |
ret = CallGsmBlackListClearReq( transId ); |
|
3197 |
break; |
|
3198 |
} |
|
3199 |
case ECustomCheckEmergencyNumberIPC: |
|
3200 |
{ |
|
3201 |
// packed parameter: a RMmCustomAPI::TEmerNumberCheckMode |
|
3202 |
RMmCustomAPI::TEmerNumberCheckMode checkMode; |
|
3203 |
aDataPackage->UnPackData( checkMode ); |
|
3204 |
ret = CallEmergencyNbrCheckReq( transId, checkMode.iNumber, |
|
3205 |
checkMode.iCheckMode ); |
|
3206 |
break; |
|
3207 |
} |
|
3208 |
case ECustomTerminateCallIPC: |
|
3209 |
{ |
|
3210 |
// packed parameters: pointer to an array of TInt (Call Id) |
|
3211 |
// and TBool isError |
|
3212 |
TInt callId; |
|
3213 |
TBool isError; |
|
3214 |
aDataPackage->UnPackData( callId, isError ); |
|
3215 |
||
3216 |
// map Custom API values to ISA values |
|
3217 |
// cause Value (error or user request) |
|
3218 |
TUint8 causeValue = |
|
3219 |
( isError ? CALL_MODEM_CAUSE_ERROR_REQUEST : CALL_MODEM_CAUSE_RELEASE_BY_USER ); |
|
3220 |
||
3221 |
// call Id |
|
3222 |
TUint8 callIdISA = 0; |
|
3223 |
// martpiir 27-May-2004: This cannot remain, must be checked |
|
3224 |
// jlof 29-Sep-2004: "all calls" id was originally -2, but now |
|
3225 |
// negative or zero |
|
3226 |
// call id means all calls. Taking absolute value of it gives |
|
3227 |
// alerting call id. |
|
3228 |
if ( 0 >= callId ) |
|
3229 |
{ |
|
3230 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ExtFuncL -- ECustomTerminateCallIPC -- (hold+active+alerting)"); |
|
3231 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_EXTFUNCL, "CMmCustomMessHandler::ExtFuncL - ECustomTerminateCallIPC - (hold+active+alerting)" ); |
|
3232 |
// alerting call (if any) is included as negated value.. |
|
3233 |
callIdISA = TUint8( CALL_MODEM_ID_HOLD | CALL_MODEM_ID_ACTIVE | ( -callId )); |
|
3234 |
} |
|
3235 |
else if ( 1 <= callId && 7 >= callId ) |
|
3236 |
{ |
|
3237 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::ExtFuncL -- ECustomTerminateCallIPC -- (%d)", TInt(callId) ); |
|
3238 |
OstTrace1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_EXTFUNCL, "CMmCustomMessHandler::ExtFuncL;callId=%d", callId ); |
|
3239 |
callIdISA = static_cast<TUint8>( callId ); |
|
3240 |
} |
|
3241 |
else |
|
3242 |
{ |
|
3243 |
// no call found |
|
3244 |
ret = KErrArgument; |
|
3245 |
} |
|
3246 |
||
3247 |
if ( KErrNone == ret ) |
|
3248 |
{ |
|
3249 |
ret = CallReleaseReq( transId, callIdISA, causeValue ); |
|
3250 |
} |
|
3251 |
break; |
|
3252 |
} |
|
3253 |
case ECustomGetAlsBlockedIPC: |
|
3254 |
{ |
|
3255 |
ret = UiccReadDynamic2FlagsReq(); |
|
3256 |
break; |
|
3257 |
} |
|
3258 |
case ECustomSetAlsBlockedIPC: |
|
3259 |
{ |
|
3260 |
// Packed parameter: TSetAlsBlock (block status) |
|
3261 |
RMmCustomAPI::TSetAlsBlock blockStatus; |
|
3262 |
aDataPackage->UnPackData( blockStatus ); |
|
3263 |
||
3264 |
// Map Custom API values to ISA values |
|
3265 |
TUint8 blockStatusISA = static_cast<TUint8>( blockStatus ); |
|
3266 |
ret = UiccWriteDynamic2FlagsReq( blockStatusISA ); |
|
3267 |
break; |
|
3268 |
} |
|
3269 |
case ECustomCheckAlsPpSupportIPC: |
|
3270 |
{ |
|
3271 |
//no packed parameters |
|
3272 |
// request type is used as transaction id. needed for |
|
3273 |
// completion. |
|
3274 |
ret = InfoPpReadReq( EGetAlsPPSupport ); |
|
3275 |
break; |
|
3276 |
} |
|
3277 |
case ECustomCheckTwoDigitDialSupportIPC: |
|
3278 |
{ |
|
3279 |
//no packed parameters |
|
3280 |
// request type is used as transaction id. needed for |
|
3281 |
// completion. |
|
3282 |
ret = InfoPpReadReq( ECheckTwoDigitDialSupport ); |
|
3283 |
break; |
|
3284 |
} |
|
3285 |
case ECustomGetCipheringInfoIPC: |
|
3286 |
{ |
|
3287 |
//no packed parameters |
|
3288 |
ret = UiccReadCiReq( ETrIdReadCipheringIndicatorStatusCustom ); |
|
3289 |
break; |
|
3290 |
} |
|
3291 |
case ECustomNetWakeupIPC: |
|
3292 |
{ |
|
3293 |
//no packed parameters |
|
3294 |
ret = NetCsWakeupReq( transId ); |
|
3295 |
break; |
|
3296 |
} |
|
3297 |
case ECustomGetOperatorNameIPC: |
|
3298 |
{ |
|
3299 |
//no packed parameters |
|
3300 |
ret = NetModemRegStatusGetReq( transId ); |
|
3301 |
break; |
|
3302 |
} |
|
3303 |
case ECustomResetNetServerIPC: |
|
3304 |
{ |
|
3305 |
//no packed parameters |
|
3306 |
ret = NetSetReq( transId ); |
|
3307 |
break; |
|
3308 |
} |
|
3309 |
case ECustomGetNetworkProviderNameIPC: |
|
3310 |
{ |
|
3311 |
ret = UiccOperatorReq(); |
|
3312 |
break; |
|
3313 |
} |
|
3314 |
case ECustomReadSimFileIPC: |
|
3315 |
{ |
|
3316 |
//packed parameter: RMmCustomAPI::TSimFileInfo |
|
3317 |
RMmCustomAPI::TSimFileInfo simFileInfo; |
|
3318 |
aDataPackage->UnPackData( simFileInfo ); |
|
3319 |
ret = UiccReadFieldReq( simFileInfo ); |
|
3320 |
break; |
|
3321 |
} |
|
3322 |
case EMobilePhoneIMSAuthenticate: |
|
3323 |
{ |
|
3324 |
ret = UiccHandleImsAuthentication( *aDataPackage ); |
|
3325 |
break; |
|
3326 |
} |
|
3327 |
case ECustomGetSimAuthenticationDataIPC: |
|
3328 |
{ |
|
3329 |
ret = UiccSendAuthenticateApdu( *aDataPackage ); |
|
3330 |
break; |
|
3331 |
} |
|
3332 |
// Supported network modes |
|
3333 |
case ECustomGetSystemNetworkModesIPC: |
|
3334 |
{ |
|
3335 |
TBool useCurrentRats; |
|
3336 |
aDataPackage->UnPackData( useCurrentRats ); |
|
3337 |
ret = NetRatReq( transId, useCurrentRats ); |
|
3338 |
break; |
|
3339 |
} |
|
3340 |
// Set system network mode |
|
3341 |
case ECustomSetSystemNetworkModeIPC: |
|
3342 |
{ |
|
3343 |
RMmCustomAPI::TNetworkModeCaps networkModeCaps; |
|
3344 |
aDataPackage->UnPackData( networkModeCaps ); |
|
3345 |
ret = GssCsServiceReq( transId, networkModeCaps ); |
|
3346 |
break; |
|
3347 |
} |
|
3348 |
// Current network modes |
|
3349 |
case ECustomGetCurrentSystemNetworkModesIPC: |
|
3350 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3351 |
ret = GssCsServiceReq( transId ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3352 |
break; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3353 |
} |
0 | 3354 |
// Get GSM/WCDMA cell info |
3355 |
case ECustomGetCellInfoIPC: |
|
3356 |
{ |
|
3357 |
iECIDInfoRequested = ETrue; |
|
3358 |
ret = NetNeighbourCellsReq( transId ); |
|
3359 |
break; |
|
3360 |
} |
|
3361 |
||
3362 |
case ECustomSimWarmResetIPC: |
|
3363 |
{ |
|
3364 |
ret = UiccSimWarmResetReq(); |
|
3365 |
break; |
|
3366 |
} |
|
3367 |
||
3368 |
case ECustomGetATRIPC: |
|
3369 |
{ |
|
3370 |
ret = UiccSimGetAtrReq(); |
|
3371 |
break; |
|
3372 |
} |
|
3373 |
||
3374 |
case ECustomGetSimCardReaderStatusIPC: |
|
3375 |
{ |
|
3376 |
ret = UiccCardReaderStatusReq(); |
|
3377 |
break; |
|
3378 |
} |
|
3379 |
||
3380 |
case ECustomSendAPDUReqV2IPC: |
|
3381 |
{ |
|
3382 |
// packed parameter: RMmCustomAPI::TApduParameters |
|
3383 |
RMmCustomAPI::TApduParameters apduParameters; |
|
3384 |
TInt traId( ETrIdSendAPDUv2 ); |
|
3385 |
||
3386 |
//Unpack aDataPackage |
|
3387 |
aDataPackage->UnPackData( apduParameters ); |
|
3388 |
||
3389 |
ret = UiccSendAPDUReq( apduParameters, traId); |
|
3390 |
break; |
|
3391 |
} |
|
3392 |
case ECustomPowerSimOnIPC: |
|
3393 |
{ |
|
3394 |
ret = UiccSimPowerOnReq(); |
|
3395 |
break; |
|
3396 |
} |
|
3397 |
case ECustomPowerSimOffIPC: |
|
3398 |
{ |
|
3399 |
ret = UiccSimPowerOffReq(); |
|
3400 |
break; |
|
3401 |
} |
|
3402 |
||
3403 |
case ECustomSendAPDUReqIPC: |
|
3404 |
{ |
|
3405 |
// packed parameter: RMmCustomAPI::TApdu |
|
3406 |
RMmCustomAPI::TApdu apduData; |
|
3407 |
RMmCustomAPI::TApduParameters apduParameters; |
|
3408 |
TInt traId( ETrIdSendAPDU ); |
|
3409 |
||
3410 |
//Unpack aDataPackage |
|
3411 |
aDataPackage->UnPackData( apduData ); |
|
3412 |
||
3413 |
apduParameters.iCmdData.Append(*apduData.iData); |
|
3414 |
||
3415 |
ret = UiccSendAPDUReq( apduParameters, traId ); |
|
3416 |
break; |
|
3417 |
} |
|
3418 |
||
3419 |
//from MmSIMMessHandler |
|
3420 |
case ECustomStartSimCbTopicBrowsingIPC: |
|
3421 |
{ |
|
3422 |
ret = UiccReadCbMsgIdsReq( ETrIdReadCbMsgIds ); |
|
3423 |
break; |
|
3424 |
} |
|
3425 |
case ECustomDeleteSimCbTopicIPC: |
|
3426 |
{ |
|
3427 |
// packed parameter: TUint with topic id |
|
3428 |
aDataPackage->UnPackData( iSimCBTopicToBeDeleted, |
|
3429 |
iTopicInSimMemoryDelete ); |
|
3430 |
ret = UiccReadCbMsgIdsReq( ETrIdUpdateCbMsgIdsPhase1 ); |
|
3431 |
break; |
|
3432 |
} |
|
3433 |
case EReadViagHomeZoneParamsIPC: |
|
3434 |
{ |
|
3435 |
ret = UiccReadViagHomeZoneParametersReq(); |
|
3436 |
break; |
|
3437 |
} |
|
3438 |
case EReadViagHomeZoneCacheIPC: |
|
3439 |
{ |
|
3440 |
// packed parameter: RMmCustomAPI::TViagCacheRecordId |
|
3441 |
RMmCustomAPI::TViagCacheRecordId recordId; |
|
3442 |
aDataPackage->UnPackData( recordId ); |
|
3443 |
ret = UiccReadViagHomeZoneCacheReq( recordId ); |
|
3444 |
break; |
|
3445 |
} |
|
3446 |
case EWriteViagHomeZoneCacheIPC: |
|
3447 |
{ |
|
3448 |
// packed parameters: RMmCustomAPI::TViagCacheRecordId |
|
3449 |
// and RMmCustomAPI::TViagCacheRecordContent |
|
3450 |
RMmCustomAPI::TViagCacheRecordId recordId; |
|
3451 |
RMmCustomAPI::TViagCacheRecordContent recordContent; |
|
3452 |
aDataPackage->UnPackData( recordId, recordContent ); |
|
3453 |
ret = UiccWriteViagHomeZoneCacheReq( recordId, recordContent ); |
|
3454 |
break; |
|
3455 |
} |
|
3456 |
//WCDMA HZ |
|
3457 |
case EWriteViagHomeZoneUHZIUESettingsIPC: |
|
3458 |
{ |
|
3459 |
//Unpack the packed settings data |
|
3460 |
RMmCustomAPI::TViagUHZIUESettings settingUhziui; |
|
3461 |
aDataPackage->UnPackData( settingUhziui ); |
|
3462 |
ret = UiccWriteViagHomeZoneUhziueSettingsReq( settingUhziui ); |
|
3463 |
break; |
|
3464 |
} |
|
3465 |
case ECustomWriteHSxPAStatusIPC: |
|
3466 |
{ |
|
3467 |
RMmCustomAPI::THSxPAStatus aStatus; |
|
3468 |
aDataPackage->UnPackData( aStatus ); |
|
3469 |
ret = WriteHSxPAStatusReq( transId, aStatus ); |
|
3470 |
break; |
|
3471 |
} |
|
3472 |
||
3473 |
case ECustomReadHSxPAStatusIPC: |
|
3474 |
{ |
|
3475 |
ret = ReadHSxPAStatusReq( transId ); |
|
3476 |
break; |
|
3477 |
} |
|
3478 |
||
3479 |
// not suppoted for S60 ver 3.2 |
|
3480 |
#if ( NCP_COMMON_S60_VERSION_SUPPORT != S60_VERSION_32 ) |
|
3481 |
||
3482 |
// Set custom band selection |
|
3483 |
case ECustomSetBandSelectionIPC: |
|
3484 |
{ |
|
3485 |
RMmCustomAPI::TNetworkModeCaps networkModeCaps; |
|
3486 |
RMmCustomAPI::TBandSelection bandSelection; |
|
3487 |
aDataPackage->UnPackData( bandSelection, networkModeCaps ); |
|
3488 |
||
3489 |
ret = GssCsServiceSetBandReq( transId, |
|
3490 |
networkModeCaps, |
|
3491 |
bandSelection ); |
|
3492 |
break; |
|
3493 |
} |
|
3494 |
||
3495 |
// Get custom band selection |
|
3496 |
case ECustomGetBandSelectionIPC: |
|
3497 |
{ |
|
3498 |
ret = GssCsServiceGetBandReq( transId ); |
|
3499 |
break; |
|
3500 |
} |
|
3501 |
||
3502 |
#endif // NCP_COMMON_S60_VERSION_SUPPORT |
|
3503 |
||
3504 |
case EMmTsyUpdateLifeTimeIPC: |
|
3505 |
{ |
|
3506 |
TTimeIntervalSeconds time; |
|
3507 |
aDataPackage->UnPackData( time ); |
|
3508 |
||
3509 |
ret = WriteLifeTimerToPermanentMemory( transId, time ); |
|
3510 |
||
3511 |
break; |
|
3512 |
} |
|
3513 |
||
3514 |
case ECustomGetLifeTimeIPC: |
|
3515 |
{ |
|
3516 |
//no packed parameters |
|
3517 |
ret = GetTotalLifeTimerValue(); |
|
3518 |
break; |
|
3519 |
} |
|
3520 |
||
3521 |
default: |
|
3522 |
{ |
|
3523 |
// this method should only be called for Custom Tsy cases |
|
3524 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::ExtFuncL - Unknown IPC: %d", aIpc); |
|
3525 |
OstTrace1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_EXTFUNCL, "CMmCustomMessHandler::ExtFuncL;aIpc=%d", aIpc ); |
|
3526 |
ret = KErrArgument; |
|
3527 |
break; |
|
3528 |
} |
|
3529 |
} |
|
3530 |
||
3531 |
return ret; |
|
3532 |
} |
|
3533 |
||
3534 |
||
3535 |
// ----------------------------------------------------------------------------- |
|
3536 |
// CMmCustomMessHandler::ProcessUiccMsg |
|
3537 |
// Handles data received from UICC server |
|
3538 |
// ----------------------------------------------------------------------------- |
|
3539 |
// |
|
3540 |
TInt CMmCustomMessHandler::ProcessUiccMsg( |
|
3541 |
TInt aTraId, |
|
3542 |
TInt aStatus, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
3543 |
TUint8 /*aDetails*/, |
0 | 3544 |
const TDesC8& aFileData ) |
3545 |
{ |
|
3546 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::ProcessUiccMsg, transaction ID: %d, status: %d", aTraId, aStatus ); |
|
3547 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_PROCESSUICCMSG, "CMmCustomMessHandler::ProcessUiccMsg" ); |
|
3548 |
||
3549 |
TInt ret( KErrNone ); |
|
3550 |
||
3551 |
switch( aTraId ) |
|
3552 |
{ |
|
3553 |
case ETrIdReadField: |
|
3554 |
{ |
|
3555 |
UiccReadFieldResp( aStatus, aFileData ); |
|
3556 |
break; |
|
3557 |
} |
|
3558 |
case ETrIdReadCbMsgIds: |
|
3559 |
case ETrIdUpdateCbMsgIdsPhase1: |
|
3560 |
{ |
|
3561 |
UiccReadCbMsgIdsResp( aStatus, aTraId, aFileData ); |
|
3562 |
break; |
|
3563 |
} |
|
3564 |
case ETrIdUpdateCbMsgIdsPhase2: |
|
3565 |
{ |
|
3566 |
UiccDeleteCbMsgIdResp( aStatus ); |
|
3567 |
break; |
|
3568 |
} |
|
3569 |
case ETrIdReadCipheringIndicatorStatusCustom: |
|
3570 |
case ETrIdNotifyCipheringIndicatorStatusCustom: |
|
3571 |
{ |
|
3572 |
UiccReadCiResp( aStatus, aTraId, aFileData ); |
|
3573 |
break; |
|
3574 |
} |
|
3575 |
case ETrIdReadOperatorNameCustom: |
|
3576 |
{ |
|
3577 |
UiccOperatorResp( aStatus, aFileData ); |
|
3578 |
break; |
|
3579 |
} |
|
3580 |
case ETrIdReadViagHomeZoneParamsCustom: |
|
3581 |
{ |
|
3582 |
UiccReadViagHomeZoneParametersResp( aStatus, aFileData ); |
|
3583 |
break; |
|
3584 |
} |
|
3585 |
case ETrIdReadViagHomeZoneCacheCustom: |
|
3586 |
{ |
|
3587 |
UiccReadViagHomeZoneCacheResp( aStatus, aFileData ); |
|
3588 |
break; |
|
3589 |
} |
|
3590 |
case ETrIdWriteViagHomeZoneCacheCustom: |
|
3591 |
{ |
|
3592 |
UiccWriteViagHomeZoneCacheResp( aStatus ); |
|
3593 |
break; |
|
3594 |
} |
|
3595 |
case ETrIdWriteViagHomeZoneUhziueSettingsCustom: |
|
3596 |
{ |
|
3597 |
UiccWriteViagHomeZoneUhziueSettingsResp( aStatus ); |
|
3598 |
break; |
|
3599 |
} |
|
3600 |
case ETrIdReadDynamic2Flags: |
|
3601 |
{ |
|
3602 |
UiccReadDynamic2FlagsResp( aStatus, aFileData ); |
|
3603 |
break; |
|
3604 |
} |
|
3605 |
case ETrIdWriteDynamic2Flags: |
|
3606 |
{ |
|
3607 |
UiccWriteDynamic2FlagsResp( aStatus ); |
|
3608 |
break; |
|
3609 |
} |
|
3610 |
||
3611 |
case ETrIdSimPowerOff: |
|
3612 |
{ |
|
3613 |
UiccSimPowerOffResp( aStatus ); |
|
3614 |
break; |
|
3615 |
} |
|
3616 |
||
3617 |
case ETrIdSimWarmReset: |
|
3618 |
{ |
|
3619 |
UiccSimWarmResetResp( aStatus ); |
|
3620 |
break; |
|
3621 |
} |
|
3622 |
||
3623 |
case ETrIdSimGetATR: |
|
3624 |
{ |
|
3625 |
UiccSimGetAtrResp( aStatus, aFileData ); |
|
3626 |
break; |
|
3627 |
} |
|
3628 |
||
3629 |
case ETrIdSimPowerOn: |
|
3630 |
{ |
|
3631 |
UiccSimPowerOnResp( aStatus ); |
|
3632 |
break; |
|
3633 |
} |
|
3634 |
||
3635 |
case ETrIdSendAPDUv2: |
|
3636 |
case ETrIdSendAPDU: |
|
3637 |
{ |
|
3638 |
UiccSendAPDUResp( aStatus, aFileData, aTraId ); |
|
3639 |
break; |
|
3640 |
} |
|
3641 |
||
3642 |
case ETrIdCardReaderStatus: |
|
3643 |
{ |
|
3644 |
UiccCardReaderStatusResp( aStatus, aFileData ); |
|
3645 |
break; |
|
3646 |
} |
|
3647 |
case ETrIdEEapSimAuthenticate: |
|
3648 |
{ |
|
3649 |
UiccGsmSecurityContextApduResp( aTraId, aStatus, aFileData ); |
|
3650 |
break; |
|
3651 |
} |
|
3652 |
case ETrIdEEapAkaAuthenticate: |
|
3653 |
case ETrIdEEapAkaAuthenticateIms: |
|
3654 |
{ |
|
3655 |
Uicc3GSecurityContextApduResp( aTraId, aStatus, aFileData ); |
|
3656 |
break; |
|
3657 |
} |
|
3658 |
case ETrIdEGbaBootstrap: |
|
3659 |
{ |
|
3660 |
UiccGBABootstrappingApduResp( aTraId, aStatus, aFileData ); |
|
3661 |
break; |
|
3662 |
} |
|
3663 |
case ETrIdEGbaBootstrapRead: |
|
3664 |
{ |
|
3665 |
UiccGBABootstrapReadResp( aStatus, aFileData ); |
|
3666 |
break; |
|
3667 |
} |
|
3668 |
case ETrIdEGbaBootstrapUpdate: |
|
3669 |
{ |
|
3670 |
UiccGBABootstrapUpdateResp( aStatus ); |
|
3671 |
break; |
|
3672 |
} |
|
3673 |
case ETrIdEGbaNafDerivation: |
|
3674 |
{ |
|
3675 |
UiccGBANafDerivationApduResp( aTraId, aStatus, aFileData ); |
|
3676 |
break; |
|
3677 |
} |
|
3678 |
case ETrIdEMbmsMskUpdate: |
|
3679 |
{ |
|
3680 |
UiccMbmsMskUpdateApduResp( aStatus, aFileData ); |
|
3681 |
break; |
|
3682 |
} |
|
3683 |
case ETrIdEMbmsMtkGeneration: |
|
3684 |
{ |
|
3685 |
UiccMbmsMtkGenerationApduResp( aStatus, aFileData ); |
|
3686 |
break; |
|
3687 |
} |
|
3688 |
case ETrIdEMbmsMskDeletion: |
|
3689 |
{ |
|
3690 |
UiccMbmsMskDeletionApduResp( aStatus, aFileData ); |
|
3691 |
break; |
|
3692 |
} |
|
3693 |
case ETrIdRunGsmAlgorithmSim: |
|
3694 |
case ETrIdRunGsmAlgorithmAka: |
|
3695 |
case ETrIdRunGsmAlgorithmIms: |
|
3696 |
{ |
|
3697 |
UiccRunGsmAlgorithmApduResp( aTraId, aStatus, aFileData ); |
|
3698 |
break; |
|
3699 |
} |
|
3700 |
case ETrIdActivateIsimApplication: |
|
3701 |
{ |
|
3702 |
UiccHandleIsimActivationResp( aStatus ); |
|
3703 |
break; |
|
3704 |
} |
|
3705 |
default: |
|
3706 |
{ |
|
3707 |
TFLOGSTRING("TSY: CMmNetMessHandler::ProcessUiccMsg - unknown transaction ID" ); |
|
3708 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_PROCESSUICCMSG, "CMmCustomMessHandler::ProcessUiccMsg - unknown transaction ID" ); |
|
3709 |
||
3710 |
break; |
|
3711 |
} |
|
3712 |
} |
|
3713 |
return ret; |
|
3714 |
} |
|
3715 |
||
3716 |
// ----------------------------------------------------------------------------- |
|
3717 |
// CMmCustomMessHandler::UiccReadViagHomeZoneParametersReq |
|
3718 |
// Read home zone parameters from UICC |
|
3719 |
// ----------------------------------------------------------------------------- |
|
3720 |
// |
|
3721 |
TInt CMmCustomMessHandler::UiccReadViagHomeZoneParametersReq() |
|
3722 |
{ |
|
3723 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadViagHomeZoneParametersReq" ); |
|
3724 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADVIAGHOMEZONEPARAMETERSREQ, "CMmCustomMessHandler::UiccReadViagHomeZoneParametersReq" ); |
|
3725 |
||
3726 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
3727 |
TUiccReadTransparent params; |
|
3728 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
3729 |
params.trId = ETrIdReadViagHomeZoneParamsCustom; |
|
3730 |
params.dataAmount = 0; |
|
3731 |
params.dataOffset = 0; |
|
3732 |
params.fileId = KElemFileHomeZone; |
|
3733 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
3734 |
||
3735 |
// File id path |
|
3736 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
3737 |
params.filePath.Append( KMasterFileId ); |
|
3738 |
params.filePath.Append( KO2DedicatedFile >> 8 ); |
|
3739 |
params.filePath.Append( KO2DedicatedFile ); |
|
3740 |
||
3741 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
3742 |
} |
|
3743 |
||
3744 |
// ----------------------------------------------------------------------------- |
|
3745 |
// CMmCustomMessHandler::UiccReadViagHomeZoneParametersResp |
|
3746 |
// Complete home zone parameters |
|
3747 |
// ----------------------------------------------------------------------------- |
|
3748 |
// |
|
3749 |
void CMmCustomMessHandler::UiccReadViagHomeZoneParametersResp( |
|
3750 |
TInt aStatus, |
|
3751 |
const TDesC8& aFileData ) |
|
3752 |
{ |
|
3753 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadViagHomeZoneParametersResp" ); |
|
3754 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADVIAGHOMEZONEPARAMETERSRESP, "CMmCustomMessHandler::UiccReadViagHomeZoneParametersResp" ); |
|
3755 |
||
3756 |
TInt error( KErrNone ); |
|
3757 |
if ( KErrNone == aStatus ) |
|
3758 |
{ |
|
3759 |
TUint8 length( 0 ); |
|
3760 |
TUint8 i( 0 ); |
|
3761 |
TUint8 j( 0 ); |
|
3762 |
TUint8 index( 2 ); |
|
3763 |
||
3764 |
// Viag params, reset |
|
3765 |
iViagParams.iScp.Zero(); |
|
3766 |
iViagParams.iSmsC.Zero(); |
|
3767 |
iViagParams.iSubscribedZoneAndVersion = 0; |
|
3768 |
||
3769 |
// Set homezone subscription and version ( byte 1 ) |
|
3770 |
iViagParams.iSubscribedZoneAndVersion = aFileData[0]; |
|
3771 |
||
3772 |
// Set SMSC number ( 7 bytes, not include length ) |
|
3773 |
length = aFileData[1]; |
|
3774 |
for ( i = 0; i < length; i++ ) |
|
3775 |
{ |
|
3776 |
iViagParams.iSmsC.Append( aFileData[index++] ); |
|
3777 |
} |
|
3778 |
||
3779 |
// Set SCP number |
|
3780 |
length = aFileData[9]; |
|
3781 |
index = 10; |
|
3782 |
for ( i = 0; i < length; i++ ) |
|
3783 |
{ |
|
3784 |
iViagParams.iScp.Append( aFileData[index++] ); |
|
3785 |
} |
|
3786 |
||
3787 |
// Viag elements |
|
3788 |
RMmCustomAPI::TViagElements* viagElems( |
|
3789 |
new (ELeave) RMmCustomAPI::TViagElements |
|
3790 |
( RMmCustomAPI::KViagElementCount ) ); |
|
3791 |
CleanupStack::PushL( viagElems ); |
|
3792 |
TUint8 elemDataIndex( 17 ); // Home zone elements stars from byte 18 |
|
3793 |
TUint32 tempCoordinate( 0 ); |
|
3794 |
||
3795 |
TUint8 byte1( 0 ); |
|
3796 |
TUint8 byte2( 0 ); |
|
3797 |
TUint8 byte3( 0 ); |
|
3798 |
TUint8 byte4( 0 ); |
|
3799 |
||
3800 |
// Set viag elements |
|
3801 |
for ( ; j < RMmCustomAPI::KViagElementCount; j++ ) |
|
3802 |
{ |
|
3803 |
RMmCustomAPI::TViagElement elem; |
|
3804 |
// Set zone id |
|
3805 |
elem.iCoordinates.iZoneId = aFileData[ elemDataIndex ]; |
|
3806 |
||
3807 |
// Next four bytes are for x coordinate |
|
3808 |
byte1 = aFileData[++elemDataIndex]; |
|
3809 |
byte2 = aFileData[++elemDataIndex]; |
|
3810 |
byte3 = aFileData[++elemDataIndex]; |
|
3811 |
byte4 = aFileData[++elemDataIndex]; |
|
3812 |
||
3813 |
tempCoordinate = ( byte1 << 24 ) | |
|
3814 |
( byte2 << 16 ) | |
|
3815 |
( byte3 << 8 ) | |
|
3816 |
( byte4 ); |
|
3817 |
elem.iCoordinates.iX = tempCoordinate; |
|
3818 |
||
3819 |
// Next four bytes are for y coordinate |
|
3820 |
byte1 = aFileData[++elemDataIndex]; |
|
3821 |
byte2 = aFileData[++elemDataIndex]; |
|
3822 |
byte3 = aFileData[++elemDataIndex]; |
|
3823 |
byte4 = aFileData[++elemDataIndex]; |
|
3824 |
||
3825 |
tempCoordinate = ( byte1 << 24 ) | |
|
3826 |
( byte2 << 16 ) | |
|
3827 |
( byte3 << 8 ) | |
|
3828 |
( byte4 ); |
|
3829 |
elem.iCoordinates.iY = tempCoordinate; |
|
3830 |
||
3831 |
// Next four bytes are for r2 |
|
3832 |
byte1 = aFileData[++elemDataIndex]; |
|
3833 |
byte2 = aFileData[++elemDataIndex]; |
|
3834 |
byte3 = aFileData[++elemDataIndex]; |
|
3835 |
byte4 = aFileData[++elemDataIndex]; |
|
3836 |
||
3837 |
tempCoordinate = ( byte1 << 24 ) | |
|
3838 |
( byte2 << 16 ) | |
|
3839 |
( byte3 << 8 ) | |
|
3840 |
( byte4 ); |
|
3841 |
elem.iCoordinates.iR2 = tempCoordinate; |
|
3842 |
||
3843 |
// Set active flag |
|
3844 |
// Bit 1 indicates homzone active |
|
3845 |
TBool isActive( |
|
3846 |
( aFileData[++elemDataIndex] & KHomeZoneActiveBit ) ); |
|
3847 |
||
3848 |
if ( isActive ) |
|
3849 |
{ |
|
3850 |
// Bit 2 indicates if an active homezone is marked as a cityzone |
|
3851 |
TBool isCityZone( |
|
3852 |
( aFileData[elemDataIndex] & KCityZoneActiveBit ) ); |
|
3853 |
if ( isCityZone ) |
|
3854 |
{ |
|
3855 |
elem.iActiveFlag = RMmCustomAPI::ECityZone; |
|
3856 |
} |
|
3857 |
else |
|
3858 |
{ |
|
3859 |
elem.iActiveFlag = RMmCustomAPI::EHomeZone; |
|
3860 |
} |
|
3861 |
} |
|
3862 |
else |
|
3863 |
{ |
|
3864 |
elem.iActiveFlag = RMmCustomAPI::ENotActive; |
|
3865 |
} |
|
3866 |
||
3867 |
// Set name (12 bytes) |
|
3868 |
elem.iName.Zero(); |
|
3869 |
for ( i = 0; i < 12; i++ ) |
|
3870 |
{ |
|
3871 |
elem.iName.Append( aFileData[++elemDataIndex] ); |
|
3872 |
} |
|
3873 |
||
3874 |
viagElems->AppendL( elem ); |
|
3875 |
elemDataIndex++; |
|
3876 |
} |
|
3877 |
||
3878 |
// Complete |
|
3879 |
CMmDataPackage dataPackage; |
|
3880 |
dataPackage.PackData( &iViagParams, &viagElems ); |
|
3881 |
iMessageRouter->Complete( EReadViagHomeZoneParamsIPC, |
|
3882 |
&dataPackage, error ); |
|
3883 |
||
3884 |
//delete iViagElems; |
|
3885 |
CleanupStack::PopAndDestroy(viagElems); |
|
3886 |
} |
|
3887 |
else |
|
3888 |
{ |
|
3889 |
// Complete with error value |
|
3890 |
iMessageRouter->Complete( |
|
3891 |
EReadViagHomeZoneParamsIPC, |
|
3892 |
KErrAccessDenied ); |
|
3893 |
} |
|
3894 |
} |
|
3895 |
||
3896 |
// ----------------------------------------------------------------------------- |
|
3897 |
// CMmCustomMessHandler::UiccReadVIAGHomeZoneCacheReq |
|
3898 |
// Read home zone cache |
|
3899 |
// ----------------------------------------------------------------------------- |
|
3900 |
// |
|
3901 |
TInt CMmCustomMessHandler::UiccReadViagHomeZoneCacheReq( |
|
3902 |
const RMmCustomAPI::TViagCacheRecordId& aRecordId ) |
|
3903 |
{ |
|
3904 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadViagHomeZoneCacheReq" ); |
|
3905 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADVIAGHOMEZONECACHEREQ, "CMmCustomMessHandler::UiccReadViagHomeZoneCacheReq" ); |
|
3906 |
||
3907 |
TUint8 cacheId( aRecordId.iCacheId ); |
|
3908 |
TUint8 recordId( aRecordId.iRecordId ); |
|
3909 |
TUint16 fileId( 0 ); |
|
3910 |
||
3911 |
// The record numbers in SIM Server range from 1 to 21. Client's record |
|
3912 |
// numbers range from 0 to 20. We have to increase the index by one. |
|
3913 |
recordId++; |
|
3914 |
||
3915 |
// Define file ID according to cache ID |
|
3916 |
switch( cacheId ) |
|
3917 |
{ |
|
3918 |
case 1: |
|
3919 |
{ |
|
3920 |
fileId = KElemFileHomeZoneCache1; |
|
3921 |
break; |
|
3922 |
} |
|
3923 |
case 2: |
|
3924 |
{ |
|
3925 |
fileId = KElemFileHomeZoneCache2; |
|
3926 |
break; |
|
3927 |
} |
|
3928 |
case 3: |
|
3929 |
{ |
|
3930 |
fileId = KElemFileHomeZoneCache3; |
|
3931 |
break; |
|
3932 |
} |
|
3933 |
case 4: |
|
3934 |
{ |
|
3935 |
fileId = KElemFileHomeZoneCache4; |
|
3936 |
break; |
|
3937 |
} |
|
3938 |
default: |
|
3939 |
{ |
|
3940 |
break; |
|
3941 |
} |
|
3942 |
} |
|
3943 |
||
3944 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
3945 |
TUiccReadLinearFixed params; |
|
3946 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
3947 |
params.trId = ETrIdReadViagHomeZoneCacheCustom; |
|
3948 |
params.dataOffset = 0; |
|
3949 |
params.dataAmount = 0; |
|
3950 |
params.record = recordId; |
|
3951 |
||
3952 |
params.fileId = fileId; |
|
3953 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
3954 |
params.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
|
3955 |
||
3956 |
// File id path |
|
3957 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
3958 |
params.filePath.Append( KMasterFileId ); |
|
3959 |
params.filePath.Append( KO2DedicatedFile >> 8 ); |
|
3960 |
params.filePath.Append( KO2DedicatedFile ); |
|
3961 |
||
3962 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
3963 |
} |
|
3964 |
||
3965 |
// ----------------------------------------------------------------------------- |
|
3966 |
// CMmCustomMessHandler::UiccReadViagHomeZoneCacheResp |
|
3967 |
// Complete home zone cache |
|
3968 |
// ----------------------------------------------------------------------------- |
|
3969 |
// |
|
3970 |
void CMmCustomMessHandler::UiccReadViagHomeZoneCacheResp( |
|
3971 |
TInt aStatus, |
|
3972 |
const TDesC8& aFileData ) |
|
3973 |
{ |
|
3974 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadViagHomeZoneCacheResp" ); |
|
3975 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADVIAGHOMEZONECACHERESP, "CMmCustomMessHandler::UiccReadViagHomeZoneCacheResp" ); |
|
3976 |
||
3977 |
TInt ret( KErrAccessDenied ); |
|
3978 |
||
3979 |
RMmCustomAPI::TViagCacheRecordContent viagRecord; |
|
3980 |
||
3981 |
if ( KErrNone == aStatus ) |
|
3982 |
{ |
|
3983 |
viagRecord.iLac = ( aFileData[0] << 8 ) | aFileData[1]; |
|
3984 |
viagRecord.iCellId = ( aFileData[2] << 8 ) | aFileData[3]; |
|
3985 |
ret = KErrNone; |
|
3986 |
} |
|
3987 |
else |
|
3988 |
{ |
|
3989 |
viagRecord.iLac = NULL; |
|
3990 |
viagRecord.iCellId = NULL; |
|
3991 |
} |
|
3992 |
||
3993 |
// Complete, packed parameter: RMmCustomAPI::TViagCacheRecordContent |
|
3994 |
CMmDataPackage dataPackage; |
|
3995 |
dataPackage.PackData( &viagRecord ); |
|
3996 |
iMessageRouter->Complete( EReadViagHomeZoneCacheIPC, &dataPackage, ret ); |
|
3997 |
||
3998 |
return; |
|
3999 |
} |
|
4000 |
||
4001 |
||
4002 |
// ----------------------------------------------------------------------------- |
|
4003 |
// CMmCustomMessHandler::UiccWriteVIAGHomeZoneCacheReq |
|
4004 |
// Write home zone cache |
|
4005 |
// ----------------------------------------------------------------------------- |
|
4006 |
// |
|
4007 |
TInt CMmCustomMessHandler::UiccWriteViagHomeZoneCacheReq( |
|
4008 |
const RMmCustomAPI::TViagCacheRecordId& aRecordId, |
|
4009 |
const RMmCustomAPI::TViagCacheRecordContent& aViagRecordContent ) |
|
4010 |
{ |
|
4011 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccWriteViagHomeZoneCacheReq" ); |
|
4012 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCWRITEVIAGHOMEZONECACHEREQ, "CMmCustomMessHandler::UiccWriteViagHomeZoneCacheReq" ); |
|
4013 |
||
4014 |
TUint8 cacheId( (TUint8)aRecordId.iCacheId ); |
|
4015 |
TUint8 recordId( (TUint8)aRecordId.iRecordId ); |
|
4016 |
TUint16 lac( (TUint16)aViagRecordContent.iLac ); |
|
4017 |
TUint16 cellId( (TUint16)aViagRecordContent.iCellId ); |
|
4018 |
TUint16 fileId( 0 ); |
|
4019 |
||
4020 |
// The record numbers in SIM Server range from 1 to 21. Client's record |
|
4021 |
// numbers range from 0 to 20. We have to shift the index by one. |
|
4022 |
recordId++; |
|
4023 |
||
4024 |
// Define file ID according to cache ID |
|
4025 |
switch( cacheId ) |
|
4026 |
{ |
|
4027 |
case 1: |
|
4028 |
{ |
|
4029 |
fileId = KElemFileHomeZoneCache1; |
|
4030 |
break; |
|
4031 |
} |
|
4032 |
case 2: |
|
4033 |
{ |
|
4034 |
fileId = KElemFileHomeZoneCache2; |
|
4035 |
break; |
|
4036 |
} |
|
4037 |
case 3: |
|
4038 |
{ |
|
4039 |
fileId = KElemFileHomeZoneCache3; |
|
4040 |
break; |
|
4041 |
} |
|
4042 |
case 4: |
|
4043 |
{ |
|
4044 |
fileId = KElemFileHomeZoneCache4; |
|
4045 |
break; |
|
4046 |
} |
|
4047 |
default: |
|
4048 |
{ |
|
4049 |
break; |
|
4050 |
} |
|
4051 |
} |
|
4052 |
||
4053 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
4054 |
TUiccWriteLinearFixed params; |
|
4055 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
4056 |
params.trId = ETrIdWriteViagHomeZoneCacheCustom; |
|
4057 |
params.dataOffset = 0; |
|
4058 |
params.dataAmount = 0; |
|
4059 |
params.record = recordId; |
|
4060 |
||
4061 |
params.fileId = fileId; |
|
4062 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
4063 |
params.serviceType = UICC_APPL_UPDATE_LINEAR_FIXED; |
|
4064 |
||
4065 |
// File id path |
|
4066 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
4067 |
params.filePath.Append( KMasterFileId ); |
|
4068 |
params.filePath.Append( KO2DedicatedFile >> 8 ); |
|
4069 |
params.filePath.Append( KO2DedicatedFile ); |
|
4070 |
||
4071 |
// File data to be updated. |
|
4072 |
TBuf8<4> fileDataBuf; |
|
4073 |
fileDataBuf.Append( lac >> 8 ); |
|
4074 |
fileDataBuf.Append( lac & 0x00FF ); |
|
4075 |
fileDataBuf.Append( cellId >> 8); |
|
4076 |
fileDataBuf.Append( cellId & 0x00FF ); |
|
4077 |
params.fileData.Append( fileDataBuf ); |
|
4078 |
||
4079 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
4080 |
} |
|
4081 |
||
4082 |
||
4083 |
// ----------------------------------------------------------------------------- |
|
4084 |
// CMmCustomMessHandler::UiccWriteViagHomeZoneCacheResp |
|
4085 |
// Complete home zone cache |
|
4086 |
// ----------------------------------------------------------------------------- |
|
4087 |
// |
|
4088 |
void CMmCustomMessHandler::UiccWriteViagHomeZoneCacheResp( TInt aStatus ) |
|
4089 |
{ |
|
4090 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccWriteViagHomeZoneCacheResp" ); |
|
4091 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCWRITEVIAGHOMEZONECACHERESP, "CMmCustomMessHandler::UiccWriteViagHomeZoneCacheResp" ); |
|
4092 |
||
4093 |
if ( KErrNone == aStatus ) |
|
4094 |
{ |
|
4095 |
iMessageRouter->Complete( EWriteViagHomeZoneCacheIPC, KErrNone ); |
|
4096 |
} |
|
4097 |
else |
|
4098 |
{ |
|
4099 |
iMessageRouter->Complete( EWriteViagHomeZoneCacheIPC, KErrGeneral ); |
|
4100 |
} |
|
4101 |
} |
|
4102 |
||
4103 |
// ----------------------------------------------------------------------------- |
|
4104 |
// CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsReq |
|
4105 |
// Write home zone settings to UICC |
|
4106 |
// ----------------------------------------------------------------------------- |
|
4107 |
// |
|
4108 |
TInt CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsReq( |
|
4109 |
const RMmCustomAPI::TViagUHZIUESettings& aUhziuiSettings ) |
|
4110 |
{ |
|
4111 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsReq" ); |
|
4112 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCWRITEVIAGHOMEZONEUHZIUESETTINGSREQ, "CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsReq" ); |
|
4113 |
||
4114 |
TUint8 settingsField( aUhziuiSettings.iSettings ); |
|
4115 |
TUint8 versionField( aUhziuiSettings.iVersion ); |
|
4116 |
||
4117 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
4118 |
TUiccWriteTransparent params; |
|
4119 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
4120 |
params.trId = ETrIdWriteViagHomeZoneUhziueSettingsCustom; |
|
4121 |
params.dataOffset = 0; |
|
4122 |
||
4123 |
params.fileId = KElemFileUhziueSettings; |
|
4124 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
4125 |
params.serviceType = UICC_APPL_UPDATE_TRANSPARENT; |
|
4126 |
||
4127 |
// File id path |
|
4128 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
4129 |
params.filePath.Append( KMasterFileId ); |
|
4130 |
params.filePath.Append( KO2DedicatedFile >> 8 ); |
|
4131 |
params.filePath.Append( KO2DedicatedFile ); |
|
4132 |
||
4133 |
// File data to be updated. |
|
4134 |
TBuf8<2> fileDataBuf; |
|
4135 |
fileDataBuf.Append( settingsField ); |
|
4136 |
fileDataBuf.Append( versionField); |
|
4137 |
params.fileData.Append( fileDataBuf ); |
|
4138 |
||
4139 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
4140 |
} |
|
4141 |
||
4142 |
// ----------------------------------------------------------------------------- |
|
4143 |
// CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsResp |
|
4144 |
// Complete home zone settings |
|
4145 |
// ----------------------------------------------------------------------------- |
|
4146 |
// |
|
4147 |
void CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsResp( |
|
4148 |
TInt aStatus ) |
|
4149 |
{ |
|
4150 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsResp" ); |
|
4151 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCWRITEVIAGHOMEZONEUHZIUESETTINGSRESP, "CMmCustomMessHandler::UiccWriteViagHomeZoneUhziueSettingsResp" ); |
|
4152 |
||
4153 |
TInt status( KErrAccessDenied ); |
|
4154 |
||
4155 |
if ( KErrNone == aStatus ) |
|
4156 |
{ |
|
4157 |
status = KErrNone; |
|
4158 |
} |
|
4159 |
iMessageRouter->Complete( EWriteViagHomeZoneUHZIUESettingsIPC, status ); |
|
4160 |
} |
|
4161 |
||
4162 |
// ----------------------------------------------------------------------------- |
|
4163 |
// CMmCustomMessHandler::UiccReadCbMsgIdsReq |
|
4164 |
// Read CB message IDs from UICC |
|
4165 |
// ----------------------------------------------------------------------------- |
|
4166 |
// |
|
4167 |
TInt CMmCustomMessHandler::UiccReadCbMsgIdsReq( TUiccTrId aTrId ) |
|
4168 |
{ |
|
4169 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadCbMsgIdsReq" ); |
|
4170 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADCBMSGIDSREQ, "CMmCustomMessHandler::UiccReadCbMsgIdsReq" ); |
|
4171 |
||
4172 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
4173 |
TUiccReadTransparent params; |
|
4174 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
4175 |
params.trId = aTrId; |
|
4176 |
params.dataOffset = 0; |
|
4177 |
params.dataAmount = 0; |
|
4178 |
params.fileId = KElemFileCellBroadcastMessId; |
|
4179 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
4180 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
4181 |
||
4182 |
// File id path |
|
4183 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
4184 |
params.filePath.Append( KMasterFileId ); |
|
4185 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
4186 |
||
4187 |
return iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
4188 |
} |
|
4189 |
||
4190 |
// ----------------------------------------------------------------------------- |
|
4191 |
// CMmCustomMessHandler::UiccReadCbMsgIdsResp |
|
4192 |
// Complete CB message IDs |
|
4193 |
// ----------------------------------------------------------------------------- |
|
4194 |
// |
|
4195 |
void CMmCustomMessHandler::UiccReadCbMsgIdsResp( |
|
4196 |
TInt aStatus, |
|
4197 |
TInt aTraId, |
|
4198 |
const TDesC8& aFileData ) |
|
4199 |
{ |
|
4200 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccReadCbMsgIdsResp" ); |
|
4201 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCREADCBMSGIDSRESP, "CMmCustomMessHandler::UiccReadCbMsgIdsResp" ); |
|
4202 |
||
4203 |
TInt numOfCbIds( 0 ); |
|
4204 |
// File data in bytes |
|
4205 |
TInt length( aFileData.Length() ); |
|
4206 |
// Divide by two to get number of 16-bit CB ids |
|
4207 |
numOfCbIds = length >> 1; |
|
4208 |
// Buffer for 16 bits CB identifiers |
|
4209 |
TBuf16<KSimNumberOfCbMsgIds> cbIds; |
|
4210 |
TInt i( 0 ); |
|
4211 |
TInt j( 0 ); |
|
4212 |
// Loop all the bytes and append 16 bit id to buffer |
|
4213 |
for ( ; i < length && j < numOfCbIds; i += 2, j++ ) |
|
4214 |
{ |
|
4215 |
TUint16 cbId ( ( aFileData[i] << 8 ) | ( aFileData[i+1] ) ); |
|
4216 |
cbIds.Append( cbId ); |
|
4217 |
} |
|
4218 |
// Read request, complete CB topic list to CTSY |
|
4219 |
if ( KErrNone == aStatus && ETrIdReadCbMsgIds == aTraId && numOfCbIds > 0 ) |
|
4220 |
{ |
|
4221 |
CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* simCbTopics = new ( ELeave ) |
|
4222 |
CArrayFixFlat<RMmCustomAPI::TSimCbTopic> ( numOfCbIds ); |
|
4223 |
||
4224 |
for ( i = 0; i < numOfCbIds; i++ ) |
|
4225 |
{ |
|
4226 |
if ( KUnusedCbMsgId != cbIds[i] ) |
|
4227 |
{ |
|
4228 |
RMmCustomAPI::TSimCbTopic simCbTopic; |
|
4229 |
// CB ID |
|
4230 |
simCbTopic.iNumber = cbIds[i]; |
|
4231 |
// Topic names are not stored on the SIM |
|
4232 |
simCbTopic.iName.Zero(); |
|
4233 |
// Add CB topic to array |
|
4234 |
simCbTopics->AppendL( simCbTopic ); |
|
4235 |
} |
|
4236 |
} |
|
4237 |
simCbTopics->Compress(); |
|
4238 |
||
4239 |
// Complete to SOS layer with packed parameter: |
|
4240 |
// pointer to array with CB topics |
|
4241 |
CMmDataPackage dataPackage; |
|
4242 |
dataPackage.PackData( &simCbTopics ); |
|
4243 |
||
4244 |
iMessageRouter->Complete( |
|
4245 |
ECustomStartSimCbTopicBrowsingIPC, |
|
4246 |
&dataPackage, |
|
4247 |
KErrNone ); |
|
4248 |
} |
|
4249 |
// Delete request, update EF CBMI with new topic list |
|
4250 |
else if ( KErrNone == aStatus && ETrIdUpdateCbMsgIdsPhase1 == aTraId && |
|
4251 |
numOfCbIds > 0 && iTopicInSimMemoryDelete ) |
|
4252 |
{ |
|
4253 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
4254 |
TUiccWriteTransparent params; |
|
4255 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
4256 |
params.trId = ETrIdUpdateCbMsgIdsPhase2; |
|
4257 |
params.dataOffset = 0; |
|
4258 |
params.fileId = KElemFileCellBroadcastMessId; |
|
4259 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
4260 |
params.serviceType = UICC_APPL_UPDATE_TRANSPARENT; |
|
4261 |
||
4262 |
// File id path |
|
4263 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
4264 |
params.filePath.Append( KMasterFileId ); |
|
4265 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
4266 |
||
4267 |
// File data to be updated. |
|
4268 |
TBuf8<KSimNumberOfCbMsgIds*2> fileDataBuf; |
|
4269 |
for ( i = 0; i < numOfCbIds; i++ ) |
|
4270 |
{ |
|
4271 |
if ( cbIds[ i ] != iSimCBTopicToBeDeleted ) |
|
4272 |
{ |
|
4273 |
fileDataBuf.Append( cbIds[ i ] >> 8 ); // MSB |
|
4274 |
fileDataBuf.Append( cbIds[ i ] & 0x00FF ); // LSB |
|
4275 |
} |
|
4276 |
else // This CB id is deleted-> set unused |
|
4277 |
{ |
|
4278 |
fileDataBuf.Append( 0xFF ); |
|
4279 |
fileDataBuf.Append( 0xFF ); |
|
4280 |
} |
|
4281 |
} |
|
4282 |
iSimCBTopicToBeDeleted = KUnusedCbMsgId; |
|
4283 |
params.fileData.Append( fileDataBuf ); |
|
4284 |
iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
4285 |
} |
|
4286 |
else // Complete error values |
|
4287 |
{ |
|
4288 |
if ( ETrIdReadCbMsgIds == aTraId ) |
|
4289 |
{ |
|
4290 |
iMessageRouter->Complete( |
|
4291 |
ECustomStartSimCbTopicBrowsingIPC, |
|
4292 |
KErrNotFound ); |
|
4293 |
} |
|
4294 |
else // Delete request |
|
4295 |
{ |
|
4296 |
iMessageRouter->Complete( |
|
4297 |
ECustomDeleteSimCbTopicIPC, |
|
4298 |
KErrNotFound ); |
|
4299 |
} |
|
4300 |
iTopicInSimMemoryDelete = ETrue; |
|
4301 |
} |
|
4302 |
} |
|
4303 |
||
4304 |
// ----------------------------------------------------------------------------- |
|
4305 |
// CMmCustomMessHandler::UiccDeleteCbMsgIdResp |
|
4306 |
// Delete CB message ID |
|
4307 |
// ----------------------------------------------------------------------------- |
|
4308 |
// |
|
4309 |
void CMmCustomMessHandler::UiccDeleteCbMsgIdResp( TInt aStatus ) |
|
4310 |
{ |
|
4311 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccDeleteCbMsgIdResp" ); |
|
4312 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCDELETECBMSGIDRESP, "CMmCustomMessHandler::UiccDeleteCbMsgIdResp" ); |
|
4313 |
||
4314 |
TInt err( KErrNone ); |
|
4315 |
if ( KErrNone != aStatus ) |
|
4316 |
{ |
|
4317 |
err = KErrAccessDenied; |
|
4318 |
} |
|
4319 |
||
4320 |
iMessageRouter->Complete( ECustomDeleteSimCbTopicIPC, err ); |
|
4321 |
} |
|
4322 |
||
4323 |
// ----------------------------------------------------------------------------- |
|
4324 |
// CMmCustomMessHandler::WriteHSxPAStatusReq |
|
4325 |
// |
|
4326 |
// (other items were commented in a header). |
|
4327 |
// ----------------------------------------------------------------------------- |
|
4328 |
// |
|
4329 |
TInt CMmCustomMessHandler::WriteHSxPAStatusReq |
|
4330 |
( |
|
4331 |
TUint8 aTraId, // Transaction identification |
|
4332 |
RMmCustomAPI::THSxPAStatus status // HSxPA status |
|
4333 |
) |
|
4334 |
{ |
|
4335 |
TFLOGSTRING("TSY: CMmCustomMessHandler::WriteHSxPAStatusReq"); |
|
4336 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_WRITEHSXPASTATUSREQ, "CMmCustomMessHandler::WriteHSxPAStatusReq" ); |
|
4337 |
||
4338 |
TBuf8<KHSxPAMaxMessageSize> data; |
|
4339 |
TUint8 value(0); |
|
4340 |
||
4341 |
if ( RMmCustomAPI::EHSxPAEnabled == status ) |
|
4342 |
{ |
|
4343 |
value = GSS_HSXPA_ALLOWED; |
|
4344 |
} |
|
4345 |
else // ( RMmCustomAPI::EHSxPADisabled == status ) |
|
4346 |
{ |
|
4347 |
value = GSS_HSXPA_DISABLED; |
|
4348 |
} |
|
4349 |
||
4350 |
data.Append( value ); |
|
4351 |
data.Append( KCustomPadding ); //Filler |
|
4352 |
||
4353 |
return iPhoNetSender->Send( PN_GSS, |
|
4354 |
aTraId, |
|
4355 |
GSS_HSXPA_USER_SETTING_WRITE_REQ, |
|
4356 |
data ); |
|
4357 |
} |
|
4358 |
||
4359 |
// ----------------------------------------------------------------------------- |
|
4360 |
// CMmCustomMessHandler::WriteHSxPAStatusResp |
|
4361 |
// |
|
4362 |
// (other items were commented in a header). |
|
4363 |
// ----------------------------------------------------------------------------- |
|
4364 |
// |
|
4365 |
void CMmCustomMessHandler::WriteHSxPAStatusResp |
|
4366 |
( |
|
4367 |
const TIsiReceiveC& aIsiMessage // an ISI message |
|
4368 |
) |
|
4369 |
{ |
|
4370 |
TFLOGSTRING("TSY: CMmCustomMessHandler::WriteHSxPAStatusResp"); |
|
4371 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_WRITEHSXPASTATUSRESP, "CMmCustomMessHandler::WriteHSxPAStatusResp" ); |
|
4372 |
||
4373 |
TInt epocError( KErrWrite ); |
|
4374 |
||
4375 |
TUint8 writeStatus = aIsiMessage.Get8bit( |
|
4376 |
ISI_HEADER_SIZE + GSS_HSXPA_USER_SETTING_WRITE_RESP_OFFSET_WRITESTATUS ); |
|
4377 |
||
4378 |
TUint8 reason = aIsiMessage.Get8bit( |
|
4379 |
ISI_HEADER_SIZE + GSS_HSXPA_USER_SETTING_WRITE_RESP_OFFSET_FAILCAUSE ); |
|
4380 |
||
4381 |
if ( GSS_OK == writeStatus ) |
|
4382 |
{ |
|
4383 |
epocError = KErrNone; |
|
4384 |
} |
|
4385 |
// GSS_FAIL == writeStatus and PP bit is disabled |
|
4386 |
else if ( GSS_HSXPA_DISABLED_VIA_PP == reason ) |
|
4387 |
{ |
|
4388 |
TFLOGSTRING("TSY: CMmCustomMessHandler::WriteHSxPAStatusResp. KErrNotSupported"); |
|
4389 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_WRITEHSXPASTATUSRESP, "CMmCustomMessHandler::WriteHSxPAStatusResp, KErrNotSupported" ); |
|
4390 |
epocError = KErrNotSupported; |
|
4391 |
} |
|
4392 |
||
4393 |
iMessageRouter->Complete( ECustomWriteHSxPAStatusIPC, epocError ); |
|
4394 |
} |
|
4395 |
||
4396 |
// ----------------------------------------------------------------------------- |
|
4397 |
// CMmCustomMessHandler::ReadHSxPAStatusReq |
|
4398 |
// |
|
4399 |
// (other items were commented in a header). |
|
4400 |
// ----------------------------------------------------------------------------- |
|
4401 |
// |
|
4402 |
TInt CMmCustomMessHandler::ReadHSxPAStatusReq |
|
4403 |
( |
|
4404 |
TUint8 aTraId // Transaction identification |
|
4405 |
) |
|
4406 |
{ |
|
4407 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReadHSxPAStatusReq"); |
|
4408 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_READHSXPASTATUSREQ, "CMmCustomMessHandler::ReadHSxPAStatusReq" ); |
|
4409 |
||
4410 |
TBuf8<KHSxPAMaxMessageSize> data; |
|
4411 |
data.Append( KCustomPadding ); //Filler |
|
4412 |
data.Append( KCustomPadding ); //Filler |
|
4413 |
||
4414 |
return iPhoNetSender->Send( PN_GSS, |
|
4415 |
aTraId, |
|
4416 |
GSS_HSXPA_USER_SETTING_READ_REQ, |
|
4417 |
data ); |
|
4418 |
} |
|
4419 |
||
4420 |
// ----------------------------------------------------------------------------- |
|
4421 |
// CMmCustomMessHandler::ReadHSxPAStatusResp |
|
4422 |
// |
|
4423 |
// (other items were commented in a header). |
|
4424 |
// ----------------------------------------------------------------------------- |
|
4425 |
// |
|
4426 |
void CMmCustomMessHandler::ReadHSxPAStatusResp |
|
4427 |
( |
|
4428 |
const TIsiReceiveC& aIsiMessage // an ISI message |
|
4429 |
) |
|
4430 |
{ |
|
4431 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReadHSxPAStatusResp"); |
|
4432 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_READHSXPASTATUSRESP, "CMmCustomMessHandler::ReadHSxPAStatusResp" ); |
|
4433 |
||
4434 |
CMmDataPackage dataPackage; |
|
4435 |
||
4436 |
TUint8 state = aIsiMessage.Get8bit( |
|
4437 |
ISI_HEADER_SIZE + GSS_HSXPA_USER_SETTING_READ_RESP_OFFSET_HSXPAUSERSETTING ); |
|
4438 |
TUint8 causeBit = aIsiMessage.Get8bit( |
|
4439 |
ISI_HEADER_SIZE + GSS_HSXPA_USER_SETTING_READ_RESP_OFFSET_CAUSE ); |
|
4440 |
||
4441 |
RMmCustomAPI::THSxPAStatus hsxpaStatus; |
|
4442 |
TInt epocError( KErrNone ); |
|
4443 |
||
4444 |
if ( GSS_HSXPA_DISABLED_VIA_PP != causeBit ) |
|
4445 |
{ |
|
4446 |
||
4447 |
if ( GSS_HSXPA_ALLOWED == state ) |
|
4448 |
{ |
|
4449 |
hsxpaStatus = RMmCustomAPI::EHSxPAEnabled; |
|
4450 |
} |
|
4451 |
else if ( GSS_HSXPA_DISABLED == state ) |
|
4452 |
{ |
|
4453 |
hsxpaStatus = RMmCustomAPI::EHSxPADisabled; |
|
4454 |
} |
|
4455 |
else //default -> general error occurs |
|
4456 |
{ |
|
4457 |
epocError = KErrGeneral; |
|
4458 |
} |
|
4459 |
||
4460 |
// complete with packed parameter |
|
4461 |
dataPackage.PackData( &hsxpaStatus ); |
|
4462 |
} |
|
4463 |
else // PPbit is disabled -> not supported |
|
4464 |
{ |
|
4465 |
epocError = KErrNotSupported; |
|
4466 |
} |
|
4467 |
||
4468 |
iMessageRouter->Complete( ECustomReadHSxPAStatusIPC, &dataPackage, epocError ); |
|
4469 |
} |
|
4470 |
||
4471 |
// ----------------------------------------------------------------------------- |
|
4472 |
// CMmCustomMessHandler::HSxPASettingInd |
|
4473 |
// This method breaks the GSS_HSXPA_SETTING_IND ISI. |
|
4474 |
// (other items were commented in a header). |
|
4475 |
// ----------------------------------------------------------------------------- |
|
4476 |
// |
|
4477 |
void CMmCustomMessHandler::HSxPASettingInd |
|
4478 |
( |
|
4479 |
const TIsiReceiveC& aIsiMessage // an ISI message |
|
4480 |
) |
|
4481 |
{ |
|
4482 |
TFLOGSTRING("TSY: CMmCustomMessHandler::HSxPASettingInd"); |
|
4483 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_HSXPASETTINGIND, "CMmCustomMessHandler::HSxPASettingInd" ); |
|
4484 |
||
4485 |
CMmDataPackage dataPackage; |
|
4486 |
RMmCustomAPI::THSxPAStatus hsxpaStatus; |
|
4487 |
||
4488 |
TUint8 currentState = aIsiMessage.Get8bit( |
|
4489 |
ISI_HEADER_SIZE + GSS_HSXPA_USER_SETTING_IND_OFFSET_HSXPAUSERSETTING ); |
|
4490 |
||
4491 |
if ( GSS_HSXPA_ALLOWED == currentState ) |
|
4492 |
{ |
|
4493 |
hsxpaStatus = RMmCustomAPI::EHSxPAEnabled; |
|
4494 |
} |
|
4495 |
else // ( GSS_HSXPA_DISABLED == currentState ) |
|
4496 |
{ |
|
4497 |
hsxpaStatus = RMmCustomAPI::EHSxPADisabled; |
|
4498 |
} |
|
4499 |
||
4500 |
// complete with packed parameter |
|
4501 |
dataPackage.PackData( &hsxpaStatus ); |
|
4502 |
iMessageRouter->Complete( ECustomNotifyHSxPAStatusIPC, &dataPackage, KErrNone ); |
|
4503 |
} |
|
4504 |
||
4505 |
// ----------------------------------------------------------------------------- |
|
4506 |
// CMmCustomMessHandler::NetNeighbourCellsReq |
|
4507 |
// (other items were commented in a header). |
|
4508 |
// ----------------------------------------------------------------------------- |
|
4509 |
// |
|
4510 |
TInt CMmCustomMessHandler::NetNeighbourCellsReq( const TUint8 aTraId ) |
|
4511 |
{ |
|
4512 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetNeighbourCellsReq"); |
|
4513 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETNEIGHBOURCELLSREQ, "CMmCustomMessHandler::NetNeighbourCellsReq" ); |
|
4514 |
||
4515 |
// Add NET_NEIGHBOUR_CELL_INFO_TYPE |
|
4516 |
// (data size is allways 1) |
|
4517 |
TBuf8<1> data; |
|
4518 |
data.Append( NET_ECID_INFORMATION ); |
|
4519 |
||
4520 |
return iPhoNetSender->Send( |
|
4521 |
PN_MODEM_NETWORK, |
|
4522 |
aTraId, |
|
4523 |
NET_NEIGHBOUR_CELLS_REQ, |
|
4524 |
data ); |
|
4525 |
} |
|
4526 |
||
4527 |
// ----------------------------------------------------------------------------- |
|
4528 |
// CMmCustomMessHandler::NetNeighbourCellsResp |
|
4529 |
// This method breaks the NET_NEIGHBOUR_CELLS_RESP message. |
|
4530 |
// (other items were commented in a header). |
|
4531 |
// ----------------------------------------------------------------------------- |
|
4532 |
// |
|
4533 |
void CMmCustomMessHandler::NetNeighbourCellsResp( |
|
4534 |
const TIsiReceiveC& aIsiMessage ) |
|
4535 |
{ |
|
4536 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetNeighbourCellsResp"); |
|
4537 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_NETNEIGHBOURCELLSRESP, "CMmCustomMessHandler::NetNeighbourCellsResp" ); |
|
4538 |
||
4539 |
TECIDInfo tempECIDInfo; |
|
4540 |
TInt ret( KErrNone ); |
|
4541 |
||
4542 |
// Get the success code. |
|
4543 |
TUint8 successCode( aIsiMessage.Get8bit( |
|
4544 |
ISI_HEADER_SIZE + |
|
4545 |
NET_NEIGHBOUR_CELLS_RESP_OFFSET_SUCCESSCODE ) ); |
|
4546 |
||
4547 |
if ( NET_CAUSE_OK == successCode ) |
|
4548 |
{ |
|
4549 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetNeighbourCellsResp - NET_CAUSE_OK"); |
|
4550 |
OstTrace0( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_NETNEIGHBOURCELLSRESP, "CMmCustomMessHandler::NetNeighbourCellsResp, NET_CAUSE_OK" ); |
|
4551 |
||
4552 |
TUint sbOffset( 0 ); |
|
4553 |
||
4554 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
4555 |
ISI_HEADER_SIZE + SIZE_NET_NEIGHBOUR_CELLS_RESP, |
|
4556 |
NET_ECID_GERAN_INFO, |
|
4557 |
EIsiSubBlockTypeId8Len8, |
|
4558 |
sbOffset ) ) |
|
4559 |
{ |
|
4560 |
// GSM cell info. |
|
4561 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetNeighbourCellsResp - NET_ECID_GERAN_INFO found"); |
|
4562 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_NETNEIGHBOURCELLSRESP, "CMmCustomMessHandler::NetNeighbourCellsResp - NET_ECID_GERAN_INFO found" ); |
|
4563 |
// Set mode |
|
4564 |
tempECIDInfo.iCellInfo.iMode = RMmCustomAPI::TMmCellInfo::EGSM; |
|
4565 |
||
4566 |
// Set Current MCC. |
|
4567 |
tempECIDInfo.iMCC = aIsiMessage.Get16bit( |
|
4568 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_CURRENTMCC ); |
|
4569 |
||
4570 |
// Set Current MNC. |
|
4571 |
tempECIDInfo.iMNC = aIsiMessage.Get16bit( |
|
4572 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_CURRENTMNC ); |
|
4573 |
||
4574 |
// Set Current LAC. |
|
4575 |
tempECIDInfo.iLAC = aIsiMessage.Get16bit( |
|
4576 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_CURRENTLAC ); |
|
4577 |
||
4578 |
// Set Current Cell ID. |
|
4579 |
tempECIDInfo.iCID = aIsiMessage.Get16bit( |
|
4580 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_CURRENTCELLID ); |
|
4581 |
||
4582 |
// Set Current TA. |
|
4583 |
TUint8 temp8bitUVal( aIsiMessage.Get8bit( |
|
4584 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_CURRENTTA ) ); |
|
4585 |
||
4586 |
if ( NET_ECID_TA_UNDEFINED != temp8bitUVal ) |
|
4587 |
{ |
|
4588 |
tempECIDInfo.iCellInfo.iGsmCellInfo.iTA = temp8bitUVal; |
|
4589 |
} |
|
4590 |
// No else. |
|
4591 |
||
4592 |
// Get Number of Neighbours included. |
|
4593 |
TUint8 nmrCount( aIsiMessage.Get8bit( |
|
4594 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_NNMR ) ); |
|
4595 |
||
4596 |
// Set NMR list. |
|
4597 |
for ( TUint8 i = 0; i < nmrCount; i++ ) |
|
4598 |
{ |
|
4599 |
// Set Carrier number. |
|
4600 |
tempECIDInfo.iCellInfo.iGsmCellInfo.iNmr[ i ].iARFCN = |
|
4601 |
aIsiMessage.Get16bit( |
|
4602 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_GSMNMRLIST + |
|
4603 |
( i * SIZE_NET_GSM_NMR_LIST_SEQ ) + |
|
4604 |
NET_GSM_NMR_LIST_SEQ_OFFSET_ARFCN ); |
|
4605 |
// Set BSIC. |
|
4606 |
tempECIDInfo.iCellInfo.iGsmCellInfo.iNmr[ i ].iBSIC = |
|
4607 |
aIsiMessage.Get8bit( |
|
4608 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_GSMNMRLIST + |
|
4609 |
( i * SIZE_NET_GSM_NMR_LIST_SEQ ) + |
|
4610 |
NET_GSM_NMR_LIST_SEQ_OFFSET_BSIC ); |
|
4611 |
// Set RX level. |
|
4612 |
tempECIDInfo.iCellInfo.iGsmCellInfo.iNmr[ i ].iRxLEV = |
|
4613 |
aIsiMessage.Get8bit( |
|
4614 |
sbOffset + NET_ECID_GERAN_INFO_OFFSET_GSMNMRLIST + |
|
4615 |
( i * SIZE_NET_GSM_NMR_LIST_SEQ ) + |
|
4616 |
NET_GSM_NMR_LIST_SEQ_OFFSET_RXLEVEL ); |
|
4617 |
} |
|
4618 |
} |
|
4619 |
else if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
4620 |
ISI_HEADER_SIZE + SIZE_NET_NEIGHBOUR_CELLS_RESP, |
|
4621 |
NET_ECID_UTRAN_FDD_INFO, |
|
4622 |
EIsiSubBlockTypeId8Len16, |
|
4623 |
sbOffset ) ) |
|
4624 |
{ |
|
4625 |
// WCDMA cell info. |
|
4626 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetNeighbourCellsResp - NET_ECID_UTRAN_FDD_INFO found"); |
|
4627 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_NETNEIGHBOURCELLSRESP, "CMmCustomMessHandler::NetNeighbourCellsResp - NET_ECID_UTRAN_FDD_INFO found" ); |
|
4628 |
// Set mode. |
|
4629 |
tempECIDInfo.iCellInfo.iMode = RMmCustomAPI::TMmCellInfo::EWCDMA; |
|
4630 |
||
4631 |
// Set UCID. |
|
4632 |
tempECIDInfo.iCID = aIsiMessage.Get32bit( |
|
4633 |
sbOffset + NET_ECID_UTRAN_FDD_INFO_OFFSET_UCID ); |
|
4634 |
||
4635 |
// Set current MCC. |
|
4636 |
tempECIDInfo.iMCC = aIsiMessage.Get16bit( |
|
4637 |
sbOffset + NET_ECID_UTRAN_FDD_INFO_OFFSET_CURRENTMCC ); |
|
4638 |
||
4639 |
// Set current MNC. |
|
4640 |
tempECIDInfo.iMNC = aIsiMessage.Get16bit( |
|
4641 |
sbOffset + NET_ECID_UTRAN_FDD_INFO_OFFSET_CURRENTMNC ); |
|
4642 |
||
4643 |
// Set current LAC (new value not received here). |
|
4644 |
tempECIDInfo.iLAC = iECIDInfo.iLAC; |
|
4645 |
||
4646 |
// Set primary scrambling code. |
|
4647 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo.iPrimaryScrambilingCode = |
|
4648 |
aIsiMessage.Get16bit( |
|
4649 |
sbOffset + NET_ECID_UTRAN_FDD_INFO_OFFSET_PRISCRAMBLING ); |
|
4650 |
||
4651 |
// Set Frequency Info. |
|
4652 |
// Set frequency Info (Uplink UARFCN and UARFCN-Nt not available) |
|
4653 |
// Downlink UARFCN. |
|
4654 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo.iFrequencyInfo.iFddDL = |
|
4655 |
aIsiMessage.Get16bit( |
|
4656 |
sbOffset + NET_ECID_UTRAN_FDD_INFO_OFFSET_UARFCNDL ); |
|
4657 |
||
4658 |
// Get number of neighbours included. |
|
4659 |
TUint8 nmrCount( aIsiMessage.Get8bit( |
|
4660 |
sbOffset + NET_ECID_UTRAN_FDD_INFO_OFFSET_NNMR ) ); |
|
4661 |
||
4662 |
// Set nmrListOffset to starting position of first NMR list. |
|
4663 |
TUint nmrListOffset( |
|
4664 |
sbOffset + NET_ECID_UTRAN_FDD_INFO_OFFSET_WCDMANMRLIST ); |
|
4665 |
||
4666 |
// Handle NMR lists. |
|
4667 |
for ( TUint8 i( 0 ); i < nmrCount; i++ ) |
|
4668 |
{ |
|
4669 |
// Set Frequency Info: Downlink UARFCN. |
|
4670 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4671 |
iNwkMeasureReport[i].iFrequencyInfo.iFddDL = |
|
4672 |
aIsiMessage.Get16bit( nmrListOffset ); |
|
4673 |
||
4674 |
// Uplink UARFCN and UARFCN-Nt not available, set to -1. |
|
4675 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4676 |
iNwkMeasureReport[i].iFrequencyInfo.iFddUL = -1; |
|
4677 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4678 |
iNwkMeasureReport[i].iFrequencyInfo.iTddNt = -1; |
|
4679 |
||
4680 |
// Set UTRA Carrier RSSI. |
|
4681 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4682 |
iNwkMeasureReport[i].iCarrierRSSI = |
|
4683 |
aIsiMessage.Get8bit( |
|
4684 |
nmrListOffset + |
|
4685 |
NET_UTRAN_NEIGH_LIST_SEQ_OFFSET_UCRSSI ); |
|
4686 |
||
4687 |
// Get number of cells included. |
|
4688 |
TUint8 cellCount( aIsiMessage.Get8bit( |
|
4689 |
nmrListOffset + NET_UTRAN_NEIGH_LIST_SEQ_OFFSET_NCELL ) ); |
|
4690 |
||
4691 |
// Set nmrListOffset to starting position of first 'detailed |
|
4692 |
// cell information'. |
|
4693 |
nmrListOffset += 4; |
|
4694 |
||
4695 |
// Handle detailed cell information. |
|
4696 |
for ( TUint8 f( 0 ); f < cellCount; f++ ) |
|
4697 |
{ |
|
4698 |
// Set UCID. |
|
4699 |
TUint32 temp32bitUVal( |
|
4700 |
aIsiMessage.Get32bit( nmrListOffset ) ); |
|
4701 |
||
4702 |
if ( NET_ECID_UCID_UNDEFINED != temp32bitUVal ) |
|
4703 |
{ |
|
4704 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4705 |
iNwkMeasureReport[i].iCellMeasuredResult[f].iCID = |
|
4706 |
temp32bitUVal; |
|
4707 |
} |
|
4708 |
// No else. |
|
4709 |
||
4710 |
// Set Primary CPICH. |
|
4711 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4712 |
iNwkMeasureReport[i].iCellMeasuredResult[f]. |
|
4713 |
iFddInfo.iPrimaryCPICH = aIsiMessage.Get16bit( |
|
4714 |
nmrListOffset + |
|
4715 |
NET_UTRAN_CELL_LIST_SEQ_OFFSET_PCPICH ); |
|
4716 |
||
4717 |
// Set CPICH Ec NO. |
|
4718 |
TUint8 temp8bitUVal( aIsiMessage.Get8bit( |
|
4719 |
nmrListOffset + |
|
4720 |
NET_UTRAN_CELL_LIST_SEQ_OFFSET_CPICHECNO ) ); |
|
4721 |
||
4722 |
if ( NET_ECID_CPICH_ECNO_UNDEFINED != temp8bitUVal ) |
|
4723 |
{ |
|
4724 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4725 |
iNwkMeasureReport[i].iCellMeasuredResult[f]. |
|
4726 |
iFddInfo.iCpichEcN0 = temp8bitUVal; |
|
4727 |
} |
|
4728 |
// No else. |
|
4729 |
||
4730 |
// Set CPICH RSCP. |
|
4731 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4732 |
iNwkMeasureReport[i].iCellMeasuredResult[f]. |
|
4733 |
iFddInfo.iCpichRscp = aIsiMessage.Get8bit( |
|
4734 |
nmrListOffset + |
|
4735 |
NET_UTRAN_CELL_LIST_SEQ_OFFSET_CPICHRSCP ); |
|
4736 |
||
4737 |
// Set Pathloss. |
|
4738 |
temp8bitUVal = aIsiMessage.Get8bit( |
|
4739 |
nmrListOffset + |
|
4740 |
NET_UTRAN_CELL_LIST_SEQ_OFFSET_PATHLOSS ); |
|
4741 |
||
4742 |
if ( NET_ECID_PATHLOSS_UNDEFINED != temp8bitUVal ) |
|
4743 |
{ |
|
4744 |
tempECIDInfo.iCellInfo.iWcdmaCellInfo. |
|
4745 |
iNwkMeasureReport[i].iCellMeasuredResult[f]. |
|
4746 |
iFddInfo.iPathloss = temp8bitUVal; |
|
4747 |
} |
|
4748 |
// No else. |
|
4749 |
||
4750 |
// Increase nmrListOffset to starting point of the next |
|
4751 |
// element of 'detailed cell information'. |
|
4752 |
nmrListOffset += SIZE_NET_UTRAN_CELL_LIST_SEQ; |
|
4753 |
} |
|
4754 |
} |
|
4755 |
} |
|
4756 |
else |
|
4757 |
{ |
|
4758 |
TFLOGSTRING("TSY: CMmCustomMessHandler::NetNeighbourCellsResp - No ECID data found"); |
|
4759 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_NETNEIGHBOURCELLSRESP, "CMmCustomMessHandler::NetNeighbourCellsResp - No ECID data found" ); |
|
4760 |
ret = KErrNotFound; |
|
4761 |
} |
|
4762 |
} |
|
4763 |
else |
|
4764 |
{ |
|
4765 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::NetNeighbourCellsResp - NET Server Error, Success Code: %d", successCode); |
|
4766 |
OstTraceExt1( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_NETNEIGHBOURCELLSRESP, "CMmCustomMessHandler::NetNeighbourCellsResp;NET Server Error, Success Code=%hhu", successCode ); |
|
4767 |
||
4768 |
// Map cause to symbian error value. |
|
4769 |
ret = CMmStaticUtility::CSCauseToEpocError( |
|
4770 |
PN_MODEM_NETWORK, |
|
4771 |
KTsyNetCauseCommon, |
|
4772 |
successCode ); |
|
4773 |
} |
|
4774 |
||
4775 |
// Complete get request. |
|
4776 |
if ( iECIDInfoRequested ) |
|
4777 |
{ |
|
4778 |
iECIDInfoRequested = EFalse; |
|
4779 |
||
4780 |
// Complete with packed parameter. |
|
4781 |
CMmDataPackage dataPackage; |
|
4782 |
dataPackage.PackData( &tempECIDInfo.iCellInfo ); |
|
4783 |
||
4784 |
iMessageRouter->Complete( |
|
4785 |
ECustomGetCellInfoIPC, |
|
4786 |
&dataPackage, |
|
4787 |
ret ); |
|
4788 |
} |
|
4789 |
// No else. |
|
4790 |
||
4791 |
// If info received, save and complete change notification. |
|
4792 |
if ( KErrNone == ret ) |
|
4793 |
{ |
|
4794 |
if ( iECIDInfo.iCellInfo.iMode != tempECIDInfo.iCellInfo.iMode || |
|
4795 |
iECIDInfo.iMCC != tempECIDInfo.iMCC || |
|
4796 |
iECIDInfo.iMNC != tempECIDInfo.iMNC || |
|
4797 |
iECIDInfo.iCID != tempECIDInfo.iCID || |
|
4798 |
iECIDInfo.iLAC != tempECIDInfo.iLAC ) |
|
4799 |
{ |
|
4800 |
// Complete with packed parameter. |
|
4801 |
CMmDataPackage dataPackage; |
|
4802 |
dataPackage.PackData( &tempECIDInfo.iCellInfo ); |
|
4803 |
||
4804 |
iMessageRouter->Complete( |
|
4805 |
ECustomNotifyCellInfoChangeIPC, |
|
4806 |
&dataPackage, |
|
4807 |
KErrNone ); |
|
4808 |
} |
|
4809 |
// No else. |
|
4810 |
||
4811 |
// Save ECID information. |
|
4812 |
iECIDInfo = tempECIDInfo; |
|
4813 |
} |
|
4814 |
// No else. |
|
4815 |
} |
|
4816 |
||
4817 |
// ----------------------------------------------------------------------------- |
|
4818 |
// CMmCustomMessHandler::CheckECIDInfo |
|
4819 |
// This method breaks received NET_MODEM_REG_STATUS_IND or |
|
4820 |
// NET_MODEM_REG_STATUS_GET_RESP message and checks if enhanced cell |
|
4821 |
// information is chaged ( => needs to be requested/updated ). |
|
4822 |
// (other items were commented in a header). |
|
4823 |
// ----------------------------------------------------------------------------- |
|
4824 |
// |
|
4825 |
void CMmCustomMessHandler::CheckECIDInfo( |
|
4826 |
const TIsiReceiveC& aIsiMessage ) |
|
4827 |
{ |
|
4828 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CheckECIDInfo"); |
|
4829 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_CHECKECIDINFO, "CMmCustomMessHandler::CheckECIDInfo" ); |
|
4830 |
||
4831 |
TUint8 msgId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
4832 |
||
4833 |
if ( NET_MODEM_REG_STATUS_IND == msgId || |
|
4834 |
NET_MODEM_REG_STATUS_GET_RESP == msgId ) |
|
4835 |
{ |
|
4836 |
// Check if cell information needs to be updated. |
|
4837 |
TBool isNetRetStatusInd( NET_MODEM_REG_STATUS_IND == msgId ); |
|
4838 |
||
4839 |
TFLOGSTRING("TSY:CMmCustomMessHandler::CheckECIDInfo - Find NET_MODEM_CURRENT_CELL_INFO SubBlock"); |
|
4840 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_CHECKECIDINFO, "CMmCustomMessHandler::CheckECIDInfo - Find NET_MODEM_CURRENT_CELL_INFO SubBlock" ); |
|
4841 |
// Get NET_MODEM_CURRENT_CELL_INFO sub block |
|
4842 |
// (should be always used when exists (coming when in 3G/RRC |
|
4843 |
// connected mode), otherwise NET_MODEM_GSM_REG_INFO is used). |
|
4844 |
||
4845 |
TUint sbStartOffSet( 0 ); |
|
4846 |
TInt retValue( KErrNone ); |
|
4847 |
||
4848 |
if ( isNetRetStatusInd ) |
|
4849 |
{ |
|
4850 |
retValue = aIsiMessage.FindSubBlockOffsetById( |
|
4851 |
ISI_HEADER_SIZE + SIZE_NET_MODEM_REG_STATUS_IND, |
|
4852 |
NET_MODEM_CURRENT_CELL_INFO, |
|
4853 |
EIsiSubBlockTypeId8Len8, |
|
4854 |
sbStartOffSet ); |
|
4855 |
} |
|
4856 |
else |
|
4857 |
{ |
|
4858 |
retValue = aIsiMessage.FindSubBlockOffsetById( |
|
4859 |
ISI_HEADER_SIZE + SIZE_NET_MODEM_REG_STATUS_GET_RESP, |
|
4860 |
NET_MODEM_CURRENT_CELL_INFO, |
|
4861 |
EIsiSubBlockTypeId8Len8, |
|
4862 |
sbStartOffSet ); |
|
4863 |
} |
|
4864 |
||
4865 |
// Get NET_MODEM_GSM_REG_INFO sub block. |
|
4866 |
if ( KErrNone != retValue ) |
|
4867 |
{ |
|
4868 |
TFLOGSTRING("TSY:CMmCustomMessHandler::CheckECIDInfo - Find NET_MODEM_GSM_REG_INFO SubBlock"); |
|
4869 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_CHECKECIDINFO, "CMmCustomMessHandler::CheckECIDInfo - Find NET_MODEM_GSM_REG_INFO SubBlock" ); |
|
4870 |
||
4871 |
sbStartOffSet = 0; |
|
4872 |
||
4873 |
if ( isNetRetStatusInd ) |
|
4874 |
{ |
|
4875 |
retValue = aIsiMessage.FindSubBlockOffsetById( |
|
4876 |
ISI_HEADER_SIZE + SIZE_NET_MODEM_REG_STATUS_IND, |
|
4877 |
NET_MODEM_GSM_REG_INFO, |
|
4878 |
EIsiSubBlockTypeId8Len8, |
|
4879 |
sbStartOffSet ); |
|
4880 |
} |
|
4881 |
else |
|
4882 |
{ |
|
4883 |
retValue = aIsiMessage.FindSubBlockOffsetById( |
|
4884 |
ISI_HEADER_SIZE + SIZE_NET_MODEM_REG_STATUS_GET_RESP, |
|
4885 |
NET_MODEM_GSM_REG_INFO, |
|
4886 |
EIsiSubBlockTypeId8Len8, |
|
4887 |
sbStartOffSet ); |
|
4888 |
} |
|
4889 |
} |
|
4890 |
// No else. |
|
4891 |
||
4892 |
// If subblock found. |
|
4893 |
if ( KErrNone == retValue ) |
|
4894 |
{ |
|
4895 |
TFLOGSTRING("TSY:CMmCustomMessHandler::CheckECIDInfo - SubBlock Found"); |
|
4896 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_CHECKECIDINFO, "CMmCustomMessHandler::CheckECIDInfo, SubBlock Found" ); |
|
4897 |
TUint tempMCC( 0 ); // Mobile Country Code. |
|
4898 |
TUint tempMNC( 0 ); // Mobile Network Code. |
|
4899 |
TUint tempCID( 0 ); // Cell identity. |
|
4900 |
TUint tempLAC( 0 ); // Location area code. |
|
4901 |
||
4902 |
// Get the Location Area Code. |
|
4903 |
tempLAC = aIsiMessage.Get16bit( |
|
4904 |
sbStartOffSet + |
|
4905 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_CURRENTLAC ); |
|
4906 |
// Get the Cell Id. |
|
4907 |
tempCID = aIsiMessage.Get32bit( |
|
4908 |
sbStartOffSet + |
|
4909 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_CURRENTCELLID ); |
|
4910 |
||
4911 |
// Get the operator code. Size is 3 bytes. |
|
4912 |
TPtrC8 operatorCode( aIsiMessage.GetData( |
|
4913 |
sbStartOffSet + |
|
4914 |
NET_MODEM_CURRENT_CELL_INFO_OFFSET_OPERATORCODE, |
|
4915 |
3 ) ); |
|
4916 |
||
4917 |
// Map the operator code to symbian values (MCC and MNC). |
|
4918 |
RMobilePhone::TMobilePhoneNetworkIdentity networkId; |
|
4919 |
RMobilePhone::TMobilePhoneNetworkCountryCode countryCode; |
|
4920 |
iNetMessHandler->MapOperatorAndCountryCode( |
|
4921 |
operatorCode, |
|
4922 |
networkId, |
|
4923 |
countryCode ); |
|
4924 |
// Convert descriptor contained number to integer. |
|
4925 |
CMmStaticUtility::GetIntFromDescriptor( |
|
4926 |
tempMCC, |
|
4927 |
countryCode ); |
|
4928 |
CMmStaticUtility::GetIntFromDescriptor( |
|
4929 |
tempMNC, |
|
4930 |
networkId ); |
|
4931 |
||
4932 |
// If changed, request new ECID information. |
|
4933 |
if ( iECIDInfo.iMCC != tempMCC || |
|
4934 |
iECIDInfo.iMNC != tempMNC || |
|
4935 |
iECIDInfo.iCID != tempCID || |
|
4936 |
iECIDInfo.iLAC != tempLAC ) |
|
4937 |
{ |
|
4938 |
TUint8 transId( KCustomTransId ); |
|
4939 |
NetNeighbourCellsReq( transId ); |
|
4940 |
// Save current LAC. |
|
4941 |
// (not received in NetNeighbourCellsResp when in 3G). |
|
4942 |
iECIDInfo.iLAC = tempLAC; |
|
4943 |
} |
|
4944 |
// No else. |
|
4945 |
} |
|
4946 |
// No else. |
|
4947 |
} |
|
4948 |
// No else. |
|
4949 |
} |
|
4950 |
||
4951 |
// ----------------------------------------------------------------------------- |
|
4952 |
// CMmCustomMessHandler::HandleError |
|
4953 |
// Handles CMmCustomMessHandler's errors that comes |
|
4954 |
// via PhoNetReceiver RunError method. |
|
4955 |
// (other items were commented in a header). |
|
4956 |
// ----------------------------------------------------------------------------- |
|
4957 |
// |
|
4958 |
void CMmCustomMessHandler::HandleError |
|
4959 |
( |
|
4960 |
const TIsiReceiveC& aIsiMessage, TInt aError |
|
4961 |
) |
|
4962 |
{ |
|
4963 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::HandleError - Error: %d", aError ); |
|
4964 |
OstTrace1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_HANDLEERROR, "CMmCustomMessHandler::HandleError;aError=%d", aError ); |
|
4965 |
||
4966 |
TInt resource( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) ); |
|
4967 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
4968 |
TUint8 transId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ); |
|
4969 |
TUint8 serviceType( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_SUBMESSAGEID ) ); |
|
4970 |
||
4971 |
switch( resource ) |
|
4972 |
{ |
|
4973 |
default: |
|
4974 |
{ |
|
4975 |
TFLOGSTRING("TSY: CMmCustomMessHandler::HandleError, switch resource - default.\n" ); |
|
4976 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_HANDLEERROR, "CMmCustomMessHandler::HandleError, switch resource - default" ); |
|
4977 |
// Nothing to do here. |
|
4978 |
break; |
|
4979 |
} |
|
4980 |
} // end switch ( resource ) |
|
4981 |
} |
|
4982 |
||
4983 |
// not suppoted for S60 ver 3.2 |
|
4984 |
#if ( NCP_COMMON_S60_VERSION_SUPPORT != S60_VERSION_32 ) |
|
4985 |
||
4986 |
// ----------------------------------------------------------------------------- |
|
4987 |
// CMmCustomMessHandler::GssCsServiceSetBandReq |
|
4988 |
// Creates and sends via phonet a GSS_CS_SERVICE_REQ including |
|
4989 |
// selected band mode (ENetworkBandAny, ENetworkBandUmts850, ENetworkBandUmts2100). |
|
4990 |
// Affects only in Umts or Dual mode. |
|
4991 |
// ----------------------------------------------------------------------------- |
|
4992 |
// |
|
4993 |
TInt CMmCustomMessHandler::GssCsServiceSetBandReq( TUint8 aTransId, // transaction Id |
|
4994 |
RMmCustomAPI::TNetworkModeCaps aNetworkModeCaps, // network mode caps |
|
4995 |
RMmCustomAPI::TBandSelection aBandSelection ) // band selection |
|
4996 |
{ |
|
4997 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::GssCsServiceSetBandReq - aTransId: %d", aTransId ); |
|
4998 |
OstTraceExt1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_GSSCSSERVICESETBANDREQ, "CMmCustomMessHandler::GssCsServiceSetBandReq;aTransId=%hhu", aTransId ); |
|
4999 |
||
5000 |
if ( RMmCustomAPI::KCapsNetworkModeUmts == aNetworkModeCaps || |
|
5001 |
RMmCustomAPI::KCapsNetworkModeDual == aNetworkModeCaps ) |
|
5002 |
{ |
|
5003 |
TFLOGSTRING3( "TSY: CMmCustomMessHandler::GssCsServiceSetBandReq - NWModeCaps: %d - Band: %d", |
|
5004 |
aNetworkModeCaps, aBandSelection ); |
|
5005 |
OstTraceExt2( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_GSSCSSERVICESETBANDREQ, "CMmCustomMessHandler::GssCsServiceSetBandReq; - NWModeCaps=%d - Band=%d", aNetworkModeCaps, aBandSelection ); |
|
5006 |
||
5007 |
// create message data buffer |
|
5008 |
TBuf8< 20 > messageData; |
|
5009 |
messageData.Append( GSS_SELECTED_BANDS_WRITE ); // append service type |
|
5010 |
messageData.Append( 1 ); // number of subblocks |
|
5011 |
||
5012 |
// subblock |
|
5013 |
messageData.Append( GSS_SELECTED_UMTS_BAND_INFO ); // append band info |
|
5014 |
messageData.Append( 0x08 ); // subblock length |
|
5015 |
messageData.Append( KCustomPadding ); |
|
5016 |
messageData.Append( KCustomPadding ); |
|
5017 |
||
5018 |
if ( RMmCustomAPI::ENetworkBandUmts850 == aBandSelection ) |
|
5019 |
{ |
|
5020 |
messageData.Append( TUint8( GSS_UMTS_BAND_V_MASK >> 24 ) ); |
|
5021 |
messageData.Append( TUint8( GSS_UMTS_BAND_V_MASK >> 16 ) ); |
|
5022 |
messageData.Append( TUint8( GSS_UMTS_BAND_V_MASK >> 8 ) ); |
|
5023 |
messageData.Append( TUint8( GSS_UMTS_BAND_V_MASK ) ); |
|
5024 |
} |
|
5025 |
else if ( RMmCustomAPI::ENetworkBandUmts2100 == aBandSelection ) |
|
5026 |
{ |
|
5027 |
messageData.Append( TUint8( GSS_UMTS_BAND_I_MASK >> 24 ) ); |
|
5028 |
messageData.Append( TUint8( GSS_UMTS_BAND_I_MASK >> 16 ) ); |
|
5029 |
messageData.Append( TUint8( GSS_UMTS_BAND_I_MASK >> 8 ) ); |
|
5030 |
messageData.Append( TUint8( GSS_UMTS_BAND_I_MASK ) ); |
|
5031 |
} |
|
5032 |
else // ENetworkBandAny |
|
5033 |
{ |
|
5034 |
messageData.Append( TUint8( GSS_UMTS_ALL_BANDS >> 24 ) ); |
|
5035 |
messageData.Append( TUint8( GSS_UMTS_ALL_BANDS >> 16 ) ); |
|
5036 |
messageData.Append( TUint8( GSS_UMTS_ALL_BANDS >> 8 ) ); |
|
5037 |
messageData.Append( TUint8( GSS_UMTS_ALL_BANDS ) ); |
|
5038 |
} |
|
5039 |
||
5040 |
return iPhoNetSender->Send( PN_GSS, aTransId, GSS_CS_SERVICE_REQ, messageData ); |
|
5041 |
} |
|
5042 |
||
5043 |
return KErrNotSupported; |
|
5044 |
} |
|
5045 |
||
5046 |
// ----------------------------------------------------------------------------- |
|
5047 |
// CMmCustomMessHandler::GssCsServiceGetBandReq |
|
5048 |
// Creates request to get current band. |
|
5049 |
// ----------------------------------------------------------------------------- |
|
5050 |
// |
|
5051 |
TInt CMmCustomMessHandler::GssCsServiceGetBandReq( TUint8 aTransId ) //transaction Id |
|
5052 |
{ |
|
5053 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::GssCsServiceGetBandReq - aTransId: %d", aTransId ); |
|
5054 |
OstTraceExt1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_GSSCSSERVICEGETBANDREQ, "CMmCustomMessHandler::GssCsServiceGetBandReq;aTransId=%hhu", aTransId ); |
|
5055 |
||
5056 |
// create message data buffer |
|
5057 |
TBuf8< 4 > messageData; |
|
5058 |
messageData.Append( GSS_SELECTED_BANDS_READ ); // append service type |
|
5059 |
messageData.Append( 0 ); // No subblocks |
|
5060 |
||
5061 |
return iPhoNetSender->Send( PN_GSS, aTransId, GSS_CS_SERVICE_REQ, messageData ); |
|
5062 |
} |
|
5063 |
||
5064 |
||
5065 |
// ----------------------------------------------------------------------------- |
|
5066 |
// CMmCustomMessHandler::CompleteGetBandSelection |
|
5067 |
// Completes and breaks Get band selection request via PhoNetReceiver method. |
|
5068 |
// ----------------------------------------------------------------------------- |
|
5069 |
// |
|
5070 |
void CMmCustomMessHandler::CompleteGetBandSelection( const TIsiReceiveC& aIsiMessage ) |
|
5071 |
{ |
|
5072 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection"); |
|
5073 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection" ); |
|
5074 |
||
5075 |
RMmCustomAPI::TNetworkModeCaps nwModeCaps; // network mode caps |
|
5076 |
RMmCustomAPI::TBandSelection bandSelection; // band selection |
|
5077 |
bandSelection = RMmCustomAPI::ENetworkBandAny; // set "any" as a default |
|
5078 |
||
5079 |
TUint8 nrOfSubblocks ( aIsiMessage.Get8bit( ISI_HEADER_SIZE + |
|
5080 |
GSS_CS_SERVICE_RESP_OFFSET_NBROFSUBBLOCKS ) ); |
|
5081 |
||
5082 |
// first subblocks start from 'GSS_CS_SERVICE_RESP_OFFSET_NBROFSUBBLOCKS' + 1 |
|
5083 |
TUint8 sbOffset ( ISI_HEADER_SIZE + |
|
5084 |
GSS_CS_SERVICE_RESP_OFFSET_NBROFSUBBLOCKS + 1 ); |
|
5085 |
||
5086 |
TUint8 firstSubblock ( aIsiMessage.Get8bit( sbOffset ) ); |
|
5087 |
||
5088 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::CompleteGetBandSelection - ECustomGetBandSelectionIPC. NrOfSubblocks:%d", nrOfSubblocks); |
|
5089 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection;nrOfSubblocks=%hhu", nrOfSubblocks ); |
|
5090 |
||
5091 |
// In 2G only products only sub block GSS_SELECTED_GSM_BANDS_INFO is returned. |
|
5092 |
if ( 1 == nrOfSubblocks && firstSubblock == GSS_SELECTED_GSM_BAND_INFO ) |
|
5093 |
{ |
|
5094 |
nwModeCaps = RMmCustomAPI::KCapsNetworkModeGsm; |
|
5095 |
} |
|
5096 |
else // 1 < nrOfSubblocks || GSS_SELECTED_UMTS_BAND_INFO |
|
5097 |
{ |
|
5098 |
//Band info offsets for reading |
|
5099 |
TUint8 gsmBandInfoOffset = 0; |
|
5100 |
TUint8 umtsBandInfoOffset = 0; |
|
5101 |
||
5102 |
// first SB is GSS_SELECTED_GSM_BAND_INFO |
|
5103 |
if ( GSS_SELECTED_GSM_BAND_INFO == firstSubblock ) |
|
5104 |
{ |
|
5105 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection - 1st SB = GSM BAND INFO"); |
|
5106 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection - 1st SB = GSM BAND INFO" ); |
|
5107 |
||
5108 |
// calculate offsets |
|
5109 |
gsmBandInfoOffset = sbOffset + |
|
5110 |
GSS_SELECTED_GSM_BAND_INFO_OFFSET_SELECTEDGSMBANDS; |
|
5111 |
||
5112 |
// if there are more than one subblock read offset for second one |
|
5113 |
if ( 1 < nrOfSubblocks ) |
|
5114 |
{ |
|
5115 |
umtsBandInfoOffset = sbOffset + |
|
5116 |
SIZE_GSS_SELECTED_GSM_BAND_INFO + |
|
5117 |
GSS_SELECTED_UMTS_BAND_INFO_OFFSET_SELECTEDUMTSBANDS; |
|
5118 |
} |
|
5119 |
} |
|
5120 |
else if ( GSS_SELECTED_UMTS_BAND_INFO == firstSubblock ) |
|
5121 |
{ |
|
5122 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection - 1st SB = UMTS BAND INFO"); |
|
5123 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection - 1st SB = UMTS BAND INFO" ); |
|
5124 |
||
5125 |
// calculate offsets |
|
5126 |
umtsBandInfoOffset = sbOffset + |
|
5127 |
GSS_SELECTED_UMTS_BAND_INFO_OFFSET_SELECTEDUMTSBANDS; |
|
5128 |
||
5129 |
// if there are more than one subblock read offset for second one |
|
5130 |
if ( 1 < nrOfSubblocks ) |
|
5131 |
{ |
|
5132 |
gsmBandInfoOffset = sbOffset + |
|
5133 |
SIZE_GSS_SELECTED_UMTS_BAND_INFO + |
|
5134 |
GSS_SELECTED_GSM_BAND_INFO_OFFSET_SELECTEDGSMBANDS; |
|
5135 |
} |
|
5136 |
} |
|
5137 |
||
5138 |
//If phone is forced to GSM, value in GSS_SELECTED_UMTS_BAND_INFO shall be GSS_UMTS_NO_BANDS |
|
5139 |
if ( GSS_UMTS_NO_BANDS == aIsiMessage.Get32bit( umtsBandInfoOffset ) ) // forced GSM |
|
5140 |
{ |
|
5141 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection - umtsBandInfo==GSS_UMTS_NO_BANDS => Forced GSM"); |
|
5142 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection - umtsBandInfo==GSS_UMTS_NO_BANDS => Forced GSM" ); |
|
5143 |
nwModeCaps = RMmCustomAPI::KCapsNetworkModeGsm; |
|
5144 |
} |
|
5145 |
else |
|
5146 |
{ |
|
5147 |
//If phone is forced to GSM, value in GSS_SELECTED_UMTS_BAND_INFO shall be GSS_UMTS_NO_BANDS. |
|
5148 |
if ( 0 < gsmBandInfoOffset && GSS_GSM_NO_BANDS == aIsiMessage.Get8bit( gsmBandInfoOffset ) ) // forced UMTS |
|
5149 |
{ |
|
5150 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection - gsmBandInfo==GSS_GSM_NO_BANDS => Forced UMTS"); |
|
5151 |
OstTrace0( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection - gsmBandInfo==GSS_GSM_NO_BANDS => Forced UMTS" ); |
|
5152 |
nwModeCaps = RMmCustomAPI::KCapsNetworkModeUmts; |
|
5153 |
} |
|
5154 |
else // dual mode |
|
5155 |
{ |
|
5156 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection - Dual mode"); |
|
5157 |
OstTrace0( TRACE_NORMAL, DUP6_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection - Dual mode" ); |
|
5158 |
nwModeCaps = RMmCustomAPI::KCapsNetworkModeDual; |
|
5159 |
} |
|
5160 |
||
5161 |
// Set network band |
|
5162 |
if ( GSS_UMTS_BAND_V_MASK == aIsiMessage.Get32bit( umtsBandInfoOffset ) ) |
|
5163 |
{ |
|
5164 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection - UMTS850"); |
|
5165 |
OstTrace0( TRACE_NORMAL, DUP7_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection - UMTS850" ); |
|
5166 |
bandSelection = RMmCustomAPI::ENetworkBandUmts850; |
|
5167 |
} |
|
5168 |
else if( GSS_UMTS_BAND_I_MASK == aIsiMessage.Get32bit( umtsBandInfoOffset ) ) |
|
5169 |
{ |
|
5170 |
TFLOGSTRING("TSY: CMmCustomMessHandler::CompleteGetBandSelection - UMTS2100"); |
|
5171 |
OstTrace0( TRACE_NORMAL, DUP8_CMMCUSTOMMESSHANDLER_COMPLETEGETBANDSELECTION, "CMmCustomMessHandler::CompleteGetBandSelection - UMTS2100" ); |
|
5172 |
bandSelection = RMmCustomAPI::ENetworkBandUmts2100; |
|
5173 |
} |
|
5174 |
} |
|
5175 |
} |
|
5176 |
||
5177 |
CMmDataPackage dataPackage; |
|
5178 |
dataPackage.PackData( &bandSelection, &nwModeCaps ); |
|
5179 |
return iMessageRouter->Complete( ECustomGetBandSelectionIPC, &dataPackage, KErrNone ); |
|
5180 |
} |
|
5181 |
||
5182 |
#endif // NCP_COMMON_S60_VERSION_SUPPORT |
|
5183 |
||
5184 |
// ----------------------------------------------------------------------------- |
|
5185 |
// CMmCustomMessHandler::ReadLifeTimerFromPermanentMemory |
|
5186 |
// Constructs PERM_PM_RECORD_READ_REQ ISI message from input parameters and send |
|
5187 |
// it through phonet. |
|
5188 |
// ----------------------------------------------------------------------------- |
|
5189 |
// |
|
5190 |
TInt CMmCustomMessHandler::ReadLifeTimerFromPermanentMemory |
|
5191 |
( |
|
5192 |
const TUint8 //aTransId |
|
5193 |
) |
|
5194 |
{ |
|
5195 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ReadLifeTimerFromPermanentMemory.\n" ); |
|
5196 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_READLIFETIMERFROMPERMANENTMEMORY, "CMmCustomMessHandler::ReadLifeTimerFromPermanentMemory" ); |
|
5197 |
||
5198 |
// Group ID 2 + Index 2 + Filler 2 + Offset 4 + Data amount to be read 4 = 14 |
|
5199 |
TBuf8<14> data; |
|
5200 |
||
5201 |
// Append Group ID |
|
5202 |
data.Append( static_cast<TUint8>( KPmmGroupNokiaTsy >> 8 ) ); |
|
5203 |
data.Append( static_cast<TUint8>( KPmmGroupNokiaTsy ) ); |
|
5204 |
||
5205 |
// Append Call Life Timer Index |
|
5206 |
data.Append( static_cast<TUint8>( KCallLifeTimerPmmIndexValue >> 8 ) ); |
|
5207 |
data.Append( static_cast<TUint8>( KCallLifeTimerPmmIndexValue ) ); |
|
5208 |
||
5209 |
// Append Filler |
|
5210 |
data.AppendFill( KCustomPadding, KTwo ); |
|
5211 |
||
5212 |
// Append Offset |
|
5213 |
data.AppendFill( KCustomPadding, KFour ); |
|
5214 |
||
5215 |
// Append Data amount to be read |
|
5216 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount >> 24 ) ); |
|
5217 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount >> 16 ) ); |
|
5218 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount >> 8 ) ); |
|
5219 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount ) ); |
|
5220 |
||
5221 |
/* To be done in CPS |
|
5222 |
return iPhoNetSender->Send( PN_PERMANENT_DATA, |
|
5223 |
aTransId, |
|
5224 |
PERM_PM_RECORD_READ_REQ, |
|
5225 |
data );*/ |
|
5226 |
return KErrNone; |
|
5227 |
} |
|
5228 |
||
5229 |
// ----------------------------------------------------------------------------- |
|
5230 |
// CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse |
|
5231 |
// Breaks PERM_PM_RECORD_READ_RESP message. |
|
5232 |
// ----------------------------------------------------------------------------- |
|
5233 |
// |
|
5234 |
/* To be done in CPS |
|
5235 |
void CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse |
|
5236 |
( |
|
5237 |
const TIsiReceiveC& aIsiMessage // an ISI message |
|
5238 |
) |
|
5239 |
{ |
|
5240 |
TFLOGSTRING("TSY: CCMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse.\n" ); |
|
5241 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_LIFETIMERFROMPERMANENTMEMORYREADRESPONSE, "CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse" ); |
|
5242 |
||
5243 |
TInt ret( KErrNone ); |
|
5244 |
||
5245 |
TUint8 pmmStatus = aIsiMessage.Get8bit( |
|
5246 |
ISI_HEADER_SIZE + |
|
5247 |
PERM_PM_RECORD_READ_RESP_OFFSET_PMMSTATUS ); |
|
5248 |
||
5249 |
if ( PMM_OK == pmmStatus ) |
|
5250 |
{ |
|
5251 |
iPMMReadRetryCounter = 0; // NUL trial counter |
|
5252 |
TUint sbStartOffSet( 0 ); |
|
5253 |
ret = aIsiMessage.FindSubBlockOffsetById( |
|
5254 |
ISI_HEADER_SIZE + SIZE_PERM_PM_RECORD_READ_RESP, |
|
5255 |
PERM_SB_PM_DATA, |
|
5256 |
EIsiSubBlockTypeId8Len8, sbStartOffSet ); |
|
5257 |
||
5258 |
if ( KErrNone == ret ) |
|
5259 |
{ |
|
5260 |
TUint32 dataSize( aIsiMessage.Get32bit( sbStartOffSet + |
|
5261 |
PERM_SB_PM_DATA_OFFSET_SIZE ) ); |
|
5262 |
// Timer value size in message is 4 bytes. If some else length |
|
5263 |
// has been returned error code KErrGeneral is set and |
|
5264 |
// assert is done. |
|
5265 |
if ( KCallLifeTimerDataAmount == dataSize ) |
|
5266 |
{ |
|
5267 |
iCallLifeTimer = aIsiMessage.Get32bit( sbStartOffSet + |
|
5268 |
PERM_SB_PM_DATA_OFFSET_DATA ); |
|
5269 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - iCallLifeTimer: %d", iCallLifeTimer ); |
|
5270 |
OstTrace1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_LIFETIMERFROMPERMANENTMEMORYREADRESPONSE, "CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse;iCallLifeTimer=%d", iCallLifeTimer ); |
|
5271 |
} |
|
5272 |
else |
|
5273 |
{ |
|
5274 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - Incorrect data size: %d", dataSize ); |
|
5275 |
OstTrace1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_LIFETIMERFROMPERMANENTMEMORYREADRESPONSE, "CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - Incorrect data size=%u", dataSize ); |
|
5276 |
TF_ASSERT( KCallLifeTimerDataAmount != dataSize ); |
|
5277 |
ret = KErrGeneral; |
|
5278 |
} |
|
5279 |
} |
|
5280 |
} |
|
5281 |
else |
|
5282 |
{ |
|
5283 |
if ( PMM_NOT_READY == pmmStatus ) |
|
5284 |
{ |
|
5285 |
// Send request again max 3 times |
|
5286 |
TFLOGSTRING("TSY: CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - PMM not ready. Send request again\n" ); |
|
5287 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_LIFETIMERFROMPERMANENTMEMORYREADRESPONSE, "CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - PMM not ready. Send request again" ); |
|
5288 |
iPMMReadRetryCounter++; |
|
5289 |
if ( KMaxPMMReadRequests > iPMMReadRetryCounter ) |
|
5290 |
{ |
|
5291 |
ReadLifeTimerFromPermanentMemory ( KCustomTransId ); |
|
5292 |
} |
|
5293 |
} |
|
5294 |
else if ( PMM_RECORD_NOT_FOUND == pmmStatus ) |
|
5295 |
{ |
|
5296 |
// The first boot of the phone. |
|
5297 |
TFLOGSTRING("TSY: CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - The first boot. Set iCallLifeTimer 0\n" ); |
|
5298 |
OstTrace0( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_LIFETIMERFROMPERMANENTMEMORYREADRESPONSE, "CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - The first boot. Set iCallLifeTimer 0" ); |
|
5299 |
iCallLifeTimer = 0; |
|
5300 |
} |
|
5301 |
else |
|
5302 |
{ |
|
5303 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - PMM Status NOT OK: %d", pmmStatus ); |
|
5304 |
OstTraceExt1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_LIFETIMERFROMPERMANENTMEMORYREADRESPONSE, "CMmCustomMessHandler::LifeTimerFromPermanentMemoryReadResponse - PMM Status NOT OK=%hhu", pmmStatus ); |
|
5305 |
} |
|
5306 |
} |
|
5307 |
}*/ |
|
5308 |
||
5309 |
// ----------------------------------------------------------------------------- |
|
5310 |
// CMmCustomMessHandler::WriteLifeTimerToPermanentMemory |
|
5311 |
// Constructs PERM_PM_RECORD_WRITE_REQ ISI message from input parameters and send |
|
5312 |
// it through phonet. |
|
5313 |
// ----------------------------------------------------------------------------- |
|
5314 |
// |
|
5315 |
TInt CMmCustomMessHandler::WriteLifeTimerToPermanentMemory |
|
5316 |
( |
|
5317 |
const TUint8 /*aTransId*/, |
|
5318 |
TTimeIntervalSeconds aTime |
|
5319 |
) |
|
5320 |
{ |
|
5321 |
TFLOGSTRING("TSY: CMmCustomMessHandler::WriteLifeTimerToPermanentMemory.\n" ); |
|
5322 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_WRITELIFETIMERTOPERMANENTMEMORY, "CMmCustomMessHandler::WriteLifeTimerToPermanentMemory" ); |
|
5323 |
||
5324 |
// Group ID 2 + Index 2 + Filler 2 + Offset 4 + Data amount to be read 4 = 14 |
|
5325 |
TBuf8<14> data; |
|
5326 |
||
5327 |
// Append Group ID |
|
5328 |
data.Append( static_cast<TUint8>( KPmmGroupNokiaTsy >> 8 ) ); |
|
5329 |
data.Append( static_cast<TUint8>( KPmmGroupNokiaTsy ) ); |
|
5330 |
||
5331 |
// Append Call Life Timer Index |
|
5332 |
data.Append( static_cast<TUint8>( KCallLifeTimerPmmIndexValue >> 8 ) ); |
|
5333 |
data.Append( static_cast<TUint8>( KCallLifeTimerPmmIndexValue ) ); |
|
5334 |
||
5335 |
// Append Filler |
|
5336 |
data.AppendFill( KCustomPadding, KTwo ); |
|
5337 |
||
5338 |
// Append Data amount to be written |
|
5339 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount >> 24 ) ); |
|
5340 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount >> 16 ) ); |
|
5341 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount >> 8 ) ); |
|
5342 |
data.Append( static_cast<TUint8>( KCallLifeTimerDataAmount ) ); |
|
5343 |
||
5344 |
if ( KCallLifeTimerNotSet == iCallLifeTimer ) |
|
5345 |
{ |
|
5346 |
TFLOGSTRING( "TSY: CMmCustomMessHandler::WriteLifeTimerToPermanentMemory - Call Life Timer is not set from PMM ret KErrNotReady\n" ); |
|
5347 |
TFLOGSTRING("TSY: CMmCustomMessHandler::WriteLifeTimerToPermanentMemory - PERM_PM_RECORD_WRITE_REQ is NOT send\n" ); |
|
5348 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_WRITELIFETIMERTOPERMANENTMEMORY, "CMmCustomMessHandler::WriteLifeTimerToPermanentMemory - Call Life Timer is not set from PMM ret KErrNotReady" ); |
|
5349 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_WRITELIFETIMERTOPERMANENTMEMORY, "CMmCustomMessHandler::WriteLifeTimerToPermanentMemory - PERM_PM_RECORD_WRITE_REQ is NOT send" ); |
|
5350 |
||
5351 |
// Return request with KErrNotReady |
|
5352 |
return ( KErrNotReady ); |
|
5353 |
} |
|
5354 |
else |
|
5355 |
{ |
|
5356 |
// Update Life Timer Value |
|
5357 |
iCallLifeTimer += aTime.Int(); |
|
5358 |
||
5359 |
// Append Data |
|
5360 |
data.Append( static_cast<TUint8>( iCallLifeTimer >> 24 ) ); |
|
5361 |
data.Append( static_cast<TUint8>( iCallLifeTimer >> 16 ) ); |
|
5362 |
data.Append( static_cast<TUint8>( iCallLifeTimer >> 8 ) ); |
|
5363 |
data.Append( static_cast<TUint8>( iCallLifeTimer ) ); |
|
5364 |
||
5365 |
/* To be done in CPS |
|
5366 |
return iPhoNetSender->Send( PN_PERMANENT_DATA, |
|
5367 |
aTransId, |
|
5368 |
PERM_PM_RECORD_WRITE_REQ, |
|
5369 |
data );*/ |
|
5370 |
return KErrNone; |
|
5371 |
} |
|
5372 |
} |
|
5373 |
||
5374 |
// ----------------------------------------------------------------------------- |
|
5375 |
// CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse |
|
5376 |
// Breaks PERM_PM_RECORD_WRITE_RESP message. |
|
5377 |
// ----------------------------------------------------------------------------- |
|
5378 |
// |
|
5379 |
/* To be done in CPS |
|
5380 |
void CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse |
|
5381 |
( |
|
5382 |
const TIsiReceiveC& aIsiMessage // an ISI message |
|
5383 |
) |
|
5384 |
{ |
|
5385 |
TFLOGSTRING("TSY: CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse.\n" ); |
|
5386 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_LIFETIMERTOPERMANENTMEMORYWRITERESPONSE, "CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse" ); |
|
5387 |
||
5388 |
TInt ret( KErrNone ); |
|
5389 |
||
5390 |
TUint8 pmmStatus = aIsiMessage.Get8bit( |
|
5391 |
ISI_HEADER_SIZE + |
|
5392 |
PERM_PM_RECORD_WRITE_RESP_OFFSET_PMMSTATUS ); |
|
5393 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse - pmmStatus: %d", pmmStatus ); |
|
5394 |
OstTraceExt1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_LIFETIMERTOPERMANENTMEMORYWRITERESPONSE, "CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse;pmmStatus=%hhu", pmmStatus ); |
|
5395 |
||
5396 |
if ( PMM_OK != pmmStatus ) |
|
5397 |
{ |
|
5398 |
ret = KErrNotReady; |
|
5399 |
TF_ASSERT( PMM_OK != pmmStatus ); |
|
5400 |
TFLOGSTRING2( "TSY: CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse - Call Life Timer is not updated / error from PMM ret: %d", ret ); |
|
5401 |
OstTrace1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_LIFETIMERTOPERMANENTMEMORYWRITERESPONSE, "CMmCustomMessHandler::LifeTimerToPermanentMemoryWriteResponse - Call Life Timer is not updated / error from PMM ret=%d", ret ); |
|
5402 |
} |
|
5403 |
||
5404 |
return iMessageRouter->Complete( EMmTsyUpdateLifeTimeIPC, ret ); |
|
5405 |
}*/ |
|
5406 |
||
5407 |
// ----------------------------------------------------------------------------- |
|
5408 |
// CMmCustomMessHandler::GetTotalLifeTimerValue |
|
5409 |
// Breaks PERM_PM_RECORD_WRITE_RESP message. |
|
5410 |
// ----------------------------------------------------------------------------- |
|
5411 |
// |
|
5412 |
TInt CMmCustomMessHandler::GetTotalLifeTimerValue |
|
5413 |
( |
|
5414 |
) |
|
5415 |
{ |
|
5416 |
TFLOGSTRING("TSY: CMmCustomMessHandler::GetTotalLifeTimerValue.\n" ); |
|
5417 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_GETTOTALLIFETIMERVALUE, "CMmCustomMessHandler::GetTotalLifeTimerValue" ); |
|
5418 |
||
5419 |
TInt ret( KErrNone ); |
|
5420 |
RMmCustomAPI::TLifeTimeData timeInfo; |
|
5421 |
||
5422 |
timeInfo.iHours = 0; |
|
5423 |
timeInfo.iMinutes = 0; |
|
5424 |
||
5425 |
if ( KCallLifeTimerNotSet == iCallLifeTimer ) |
|
5426 |
{ |
|
5427 |
ret = KErrNotReady; |
|
5428 |
TFLOGSTRING( "TSY: CMmCustomMessHandler::GetTotalLifeTimerValue - PMM has not been able to be read ret: KErrNotReady\n" ); |
|
5429 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_GETTOTALLIFETIMERVALUE, "CMmCustomMessHandler::GetTotalLifeTimerValue - PMM has not been able to be read ret: KErrNotReady" ); |
|
5430 |
} |
|
5431 |
else |
|
5432 |
{ |
|
5433 |
//set the data into timeInfo class, one hour is 3600 seconds. |
|
5434 |
timeInfo.iHours = iCallLifeTimer / KSecsInHour ; |
|
5435 |
timeInfo.iMinutes = |
|
5436 |
static_cast<TUint8>( ( iCallLifeTimer % KSecsInHour ) / |
|
5437 |
KMinsInHour ); |
|
5438 |
//update the caps |
|
5439 |
timeInfo.iCaps |= |
|
5440 |
RMmCustomAPI::TLifeTimeData::ELifeTimeDataCapsLifeTime; |
|
5441 |
TFLOGSTRING2( "TSY: TSY: CMmCustomMessHandler::GetTotalLifeTimerValue - iCallLifeTimer: %d", iCallLifeTimer ); |
|
5442 |
TFLOGSTRING2( "TSY: TSY: CMmCustomMessHandler::GetTotalLifeTimerValue - timeInfo.iHours: %d", timeInfo.iHours ); |
|
5443 |
TFLOGSTRING2( "TSY: TSY: CMmCustomMessHandler::GetTotalLifeTimerValue - timeInfo.iMinutes: %d", timeInfo.iMinutes ); |
|
5444 |
OstTrace1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_GETTOTALLIFETIMERVALUE, "CMmCustomMessHandler::GetTotalLifeTimerValue;iCallLifeTimer=%d", iCallLifeTimer ); |
|
5445 |
OstTrace1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_GETTOTALLIFETIMERVALUE, "CMmCustomMessHandler::GetTotalLifeTimerValue;timeInfo.iHours=%u", timeInfo.iHours ); |
|
5446 |
OstTraceExt1( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_GETTOTALLIFETIMERVALUE, "CMmCustomMessHandler::GetTotalLifeTimerValue;timeInfo.iMinutes=%hhu", timeInfo.iMinutes ); |
|
5447 |
} |
|
5448 |
||
5449 |
CMmDataPackage dataPackage; |
|
5450 |
dataPackage.PackData( &timeInfo ); |
|
5451 |
iMessageRouter->Complete( ECustomGetLifeTimeIPC, &dataPackage, ret ); |
|
5452 |
||
5453 |
return( ret ); |
|
5454 |
} |
|
5455 |
||
5456 |
// ----------------------------------------------------------------------------- |
|
5457 |
// CMmCustomMessHandler::UiccSimPowerOffReq |
|
5458 |
// Disconnects UICC server from smartcard and activates UICC SAP APDU interface |
|
5459 |
// ----------------------------------------------------------------------------- |
|
5460 |
// |
|
5461 |
TInt CMmCustomMessHandler::UiccSimPowerOffReq() |
|
5462 |
{ |
|
5463 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimPowerOffReq.\n"); |
|
5464 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMPOWEROFFREQ, "CMmCustomMessHandler::UiccSimPowerOffReq" ); |
|
5465 |
||
5466 |
iSapApduIfState = EUiccSapIfStatus1; |
|
5467 |
// Set parameters for UICC_CONNECTION_REQ message |
|
5468 |
TUiccParamsBase params; |
|
5469 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
5470 |
params.trId = ETrIdSimPowerOff; |
|
5471 |
params.serviceType = UICC_DISCONNECT; |
|
5472 |
||
5473 |
return iMmUiccMessHandler->CreateUiccConnectorReq( params ); |
|
5474 |
} |
|
5475 |
||
5476 |
// ----------------------------------------------------------------------------- |
|
5477 |
// CMmCustomMessHandler::UiccSimPowerOffResp |
|
5478 |
// |
|
5479 |
// ----------------------------------------------------------------------------- |
|
5480 |
// |
|
5481 |
void CMmCustomMessHandler::UiccSimPowerOffResp( TInt aStatus ) |
|
5482 |
{ |
|
5483 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimPowerOffResp.\n" ); |
|
5484 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMPOWEROFFRESP, "CMmCustomMessHandler::UiccSimPowerOffResp" ); |
|
5485 |
||
5486 |
TInt err ( KErrNone ); |
|
5487 |
||
5488 |
if( aStatus == UICC_STATUS_OK ) |
|
5489 |
{ |
|
5490 |
switch( iSapApduIfState ) |
|
5491 |
{ |
|
5492 |
case EUiccSapIfStatus1: |
|
5493 |
{ |
|
5494 |
// Set parameters for UICC_APDU_REQ message |
|
5495 |
TUiccParamsApduReq params; |
|
5496 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( |
|
5497 |
this ); |
|
5498 |
params.trId = ETrIdSimPowerOff; |
|
5499 |
params.serviceType = UICC_APDU_CONTROL; |
|
5500 |
params.action = UICC_CONTROL_CARD_ACTIVATE; |
|
5501 |
||
5502 |
err = iMmUiccMessHandler->CreateUiccApduReq( params ); |
|
5503 |
||
5504 |
iSapApduIfState = EUiccSapIfStatus2; |
|
5505 |
break; |
|
5506 |
} |
|
5507 |
||
5508 |
case EUiccSapIfStatus2: |
|
5509 |
{ |
|
5510 |
// No handling for UICC_APDU_RESP, |
|
5511 |
// wait for UICC_APDU_RESET_IND |
|
5512 |
iSapApduIfState = EUiccSapIfStatus3; |
|
5513 |
break; |
|
5514 |
} |
|
5515 |
||
5516 |
case EUiccSapIfStatus3: |
|
5517 |
{ |
|
5518 |
// UICC_APDU_RESET_IND, UICC_READY, SAP IF active |
|
5519 |
iMessageRouter->Complete( ECustomPowerSimOffIPC, err ); |
|
5520 |
break; |
|
5521 |
} |
|
5522 |
} |
|
5523 |
} |
|
5524 |
else |
|
5525 |
{ |
|
5526 |
if( aStatus == UICC_STATUS_SHUTTING_DOWN ) |
|
5527 |
{ |
|
5528 |
err = CMmStaticUtility::EpocErrorCode( KErrNotReady, KErrNotFound ); |
|
5529 |
} |
|
5530 |
else |
|
5531 |
{ |
|
5532 |
// UICC_STATUS_FAIL |
|
5533 |
err = CMmStaticUtility::EpocErrorCode( KErrGeneral, KErrNotFound ); |
|
5534 |
} |
|
5535 |
iMessageRouter->Complete( ECustomPowerSimOffIPC, err ); |
|
5536 |
} |
|
5537 |
} |
|
5538 |
||
5539 |
// ----------------------------------------------------------------------------- |
|
5540 |
// CMmCustomMessHandler::UiccSimWarmResetReq |
|
5541 |
// |
|
5542 |
// ----------------------------------------------------------------------------- |
|
5543 |
// |
|
5544 |
TInt CMmCustomMessHandler::UiccSimWarmResetReq() |
|
5545 |
{ |
|
5546 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimWarmResetReq.\n" ); |
|
5547 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMWARMRESETREQ, "CMmCustomMessHandler::UiccSimWarmResetReq" ); |
|
5548 |
||
5549 |
TUiccParamsApduReq params; |
|
5550 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
5551 |
params.trId = ETrIdSimWarmReset; |
|
5552 |
params.serviceType = UICC_APDU_CONTROL; |
|
5553 |
params.action = UICC_CONTROL_WARM_RESET; |
|
5554 |
||
5555 |
return iMmUiccMessHandler->CreateUiccApduReq( params ); |
|
5556 |
} |
|
5557 |
||
5558 |
// ----------------------------------------------------------------------------- |
|
5559 |
// CMmCustomMessHandler::UiccSimWarmResetResp |
|
5560 |
// |
|
5561 |
// ----------------------------------------------------------------------------- |
|
5562 |
// |
|
5563 |
void CMmCustomMessHandler::UiccSimWarmResetResp( TInt aStatus ) |
|
5564 |
{ |
|
5565 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimWarmResetResp.\n" ); |
|
5566 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMWARMRESETRESP, "CMmCustomMessHandler::UiccSimWarmResetResp" ); |
|
5567 |
||
5568 |
TInt err ( KErrNone ); |
|
5569 |
||
5570 |
if( aStatus != UICC_STATUS_OK ) |
|
5571 |
{ |
|
5572 |
if( aStatus == UICC_STATUS_SHUTTING_DOWN ) |
|
5573 |
{ |
|
5574 |
err = CMmStaticUtility::EpocErrorCode( KErrNotReady, KErrNotFound ); |
|
5575 |
} |
|
5576 |
else |
|
5577 |
{ |
|
5578 |
// UICC_STATUS_FAIL |
|
5579 |
err = CMmStaticUtility::EpocErrorCode( KErrGeneral, KErrNotFound ); |
|
5580 |
} |
|
5581 |
} |
|
5582 |
iMessageRouter->Complete( ECustomSimWarmResetIPC, err ); |
|
5583 |
||
5584 |
} |
|
5585 |
||
5586 |
// ----------------------------------------------------------------------------- |
|
5587 |
// CMmCustomMessHandler::UiccSimGetAtrReq |
|
5588 |
// |
|
5589 |
// ----------------------------------------------------------------------------- |
|
5590 |
// |
|
5591 |
TInt CMmCustomMessHandler::UiccSimGetAtrReq() |
|
5592 |
{ |
|
5593 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimGetAtrReq.\n" ); |
|
5594 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMGETATRREQ, "CMmCustomMessHandler::UiccSimGetAtrReq" ); |
|
5595 |
||
5596 |
TUiccParamsApduReq params; |
|
5597 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
5598 |
params.trId = ETrIdSimGetATR; |
|
5599 |
params.serviceType = UICC_APDU_ATR_GET; |
|
5600 |
||
5601 |
return iMmUiccMessHandler->CreateUiccApduReq( params ); |
|
5602 |
} |
|
5603 |
||
5604 |
// ----------------------------------------------------------------------------- |
|
5605 |
// CMmCustomMessHandler::UiccSimGetAtrResp |
|
5606 |
// |
|
5607 |
// ----------------------------------------------------------------------------- |
|
5608 |
// |
|
5609 |
void CMmCustomMessHandler::UiccSimGetAtrResp( |
|
5610 |
TInt aStatus, |
|
5611 |
const TDesC8& aFileData ) |
|
5612 |
{ |
|
5613 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimGetAtrResp.\n" ); |
|
5614 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMGETATRRESP, "CMmCustomMessHandler::UiccSimGetAtrResp" ); |
|
5615 |
||
5616 |
TInt err( KErrNone ); |
|
5617 |
const TDesC8* dataPtr = &aFileData; |
|
5618 |
CMmDataPackage dataPackage; |
|
5619 |
dataPackage.PackData( &dataPtr ); |
|
5620 |
||
5621 |
if( aStatus != UICC_STATUS_OK ) |
|
5622 |
{ |
|
5623 |
if( aStatus == UICC_STATUS_SHUTTING_DOWN ) |
|
5624 |
{ |
|
5625 |
err = CMmStaticUtility::EpocErrorCode( KErrNotReady, KErrNotFound ); |
|
5626 |
} |
|
5627 |
else |
|
5628 |
{ |
|
5629 |
// UICC_STATUS_FAIL |
|
5630 |
err = CMmStaticUtility::EpocErrorCode( KErrGeneral, KErrNotFound ); |
|
5631 |
} |
|
5632 |
} |
|
5633 |
||
5634 |
iMessageRouter->Complete( ECustomGetATRIPC, &dataPackage, err ); |
|
5635 |
} |
|
5636 |
||
5637 |
// ----------------------------------------------------------------------------- |
|
5638 |
// CMmCustomMessHandler::UiccSimPowerOnReq |
|
5639 |
// Connects UICC server to smartcard and deactivates UICC SAP APDU interface |
|
5640 |
// ----------------------------------------------------------------------------- |
|
5641 |
// |
|
5642 |
TInt CMmCustomMessHandler::UiccSimPowerOnReq() |
|
5643 |
{ |
|
5644 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimPowerOnReq.\n" ); |
|
5645 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMPOWERONREQ, "CMmCustomMessHandler::UiccSimPowerOnReq" ); |
|
5646 |
||
5647 |
//Set APDU interface state |
|
5648 |
iSapApduIfState = EUiccSapIfStatus1; |
|
5649 |
||
5650 |
// Set parameters for UICC_CONNECTION_REQ message |
|
5651 |
TUiccParamsBase params; |
|
5652 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
5653 |
params.trId = ETrIdSimPowerOn; |
|
5654 |
params.serviceType = UICC_CONNECT; |
|
5655 |
||
5656 |
return iMmUiccMessHandler->CreateUiccConnectorReq( params ); |
|
5657 |
} |
|
5658 |
||
5659 |
// ----------------------------------------------------------------------------- |
|
5660 |
// CMmCustomMessHandler::UiccSimPowerOnResp |
|
5661 |
// |
|
5662 |
// ----------------------------------------------------------------------------- |
|
5663 |
// |
|
5664 |
void CMmCustomMessHandler::UiccSimPowerOnResp( TInt aStatus ) |
|
5665 |
{ |
|
5666 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimPowerOnResp.\n" ); |
|
5667 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMPOWERONRESP, "CMmCustomMessHandler::UiccSimPowerOnResp" ); |
|
5668 |
||
5669 |
TInt err( KErrNone ); |
|
5670 |
||
5671 |
if( aStatus == UICC_STATUS_OK ) |
|
5672 |
{ |
|
5673 |
switch( iSapApduIfState ) |
|
5674 |
{ |
|
5675 |
case EUiccSapIfStatus1: |
|
5676 |
{ |
|
5677 |
// No handling for UICC_CONNECTOR_RESP |
|
5678 |
// wait for UICC_APPLICATION_IND |
|
5679 |
iSapApduIfState = EUiccSapIfStatus2; |
|
5680 |
break; |
|
5681 |
} |
|
5682 |
||
5683 |
case EUiccSapIfStatus2: |
|
5684 |
{ |
|
5685 |
// UICC_APPLICATION_IND (UICC_APPL_ACTIVATED) received |
|
5686 |
// SAP IF deactivated |
|
5687 |
iMessageRouter->Complete( ECustomPowerSimOnIPC, err ); |
|
5688 |
break; |
|
5689 |
} |
|
5690 |
} |
|
5691 |
} |
|
5692 |
else |
|
5693 |
{ |
|
5694 |
if( aStatus == UICC_STATUS_SHUTTING_DOWN ) |
|
5695 |
{ |
|
5696 |
err = CMmStaticUtility::EpocErrorCode( KErrNotReady, KErrNotFound ); |
|
5697 |
} |
|
5698 |
else |
|
5699 |
{ |
|
5700 |
// UICC_STATUS_FAIL |
|
5701 |
err = CMmStaticUtility::EpocErrorCode( KErrGeneral, KErrNotFound ); |
|
5702 |
} |
|
5703 |
iMessageRouter->Complete( ECustomPowerSimOnIPC, err ); |
|
5704 |
} |
|
5705 |
} |
|
5706 |
||
5707 |
// ----------------------------------------------------------------------------- |
|
5708 |
// CMmCustomMessHandler::UiccSimSendAPDUReq |
|
5709 |
// |
|
5710 |
// ----------------------------------------------------------------------------- |
|
5711 |
// |
|
5712 |
TInt CMmCustomMessHandler::UiccSendAPDUReq( |
|
5713 |
const RMmCustomAPI::TApduParameters& aApduParameters, |
|
5714 |
TInt aTraId ) |
|
5715 |
{ |
|
5716 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSimSendAPDUReq.\n" ); |
|
5717 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMSENAPDUREQ, "CMmCustomMessHandler::UiccSendAPDUReq" ); |
|
5718 |
||
5719 |
TUiccParamsApduReq params; |
|
5720 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
5721 |
params.trId = ( TUiccTrId )aTraId; |
|
5722 |
params.serviceType = UICC_APDU_SEND; |
|
5723 |
params.apduData.Append( aApduParameters.iCmdData ); |
|
5724 |
||
5725 |
return iMmUiccMessHandler->CreateUiccApduReq( params ); |
|
5726 |
} |
|
5727 |
||
5728 |
// ----------------------------------------------------------------------------- |
|
5729 |
// CMmCustomMessHandler::UiccSendAPDUResp |
|
5730 |
// |
|
5731 |
// ----------------------------------------------------------------------------- |
|
5732 |
// |
|
5733 |
void CMmCustomMessHandler::UiccSendAPDUResp( |
|
5734 |
TInt aStatus, |
|
5735 |
const TDesC8& aFileData, |
|
5736 |
TInt aTraId ) |
|
5737 |
{ |
|
5738 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSendAPDUResp.\n" ); |
|
5739 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSIMSENAPDURESP, "CMmCustomMessHandler::UiccSendAPDUResp" ); |
|
5740 |
||
5741 |
TInt err( KErrNone ); |
|
5742 |
const TDesC8* dataPtr = &aFileData; |
|
5743 |
CMmDataPackage dataPackage; |
|
5744 |
dataPackage.PackData( &dataPtr ); |
|
5745 |
||
5746 |
if( aStatus != UICC_STATUS_OK ) |
|
5747 |
{ |
|
5748 |
if( aStatus == UICC_STATUS_SHUTTING_DOWN ) |
|
5749 |
{ |
|
5750 |
err = CMmStaticUtility::EpocErrorCode( KErrNotReady, KErrNotFound ); |
|
5751 |
} |
|
5752 |
else |
|
5753 |
{ |
|
5754 |
// UICC_STATUS_FAIL |
|
5755 |
err = CMmStaticUtility::EpocErrorCode( KErrGeneral, KErrNotFound ); |
|
5756 |
} |
|
5757 |
} |
|
5758 |
||
5759 |
if( aTraId == ETrIdSendAPDUv2 ) |
|
5760 |
{ |
|
5761 |
iMessageRouter->Complete( |
|
5762 |
ECustomSendAPDUReqV2IPC, |
|
5763 |
&dataPackage, |
|
5764 |
err ); |
|
5765 |
} |
|
5766 |
else |
|
5767 |
{ |
|
5768 |
iMessageRouter->Complete( |
|
5769 |
ECustomSendAPDUReqIPC, |
|
5770 |
&dataPackage, |
|
5771 |
err ); |
|
5772 |
} |
|
5773 |
||
5774 |
} |
|
5775 |
||
5776 |
// ----------------------------------------------------------------------------- |
|
5777 |
// CMmCustomMessHandler::UiccCardReaderStatusReq |
|
5778 |
// |
|
5779 |
// ----------------------------------------------------------------------------- |
|
5780 |
// |
|
5781 |
TInt CMmCustomMessHandler::UiccCardReaderStatusReq() |
|
5782 |
{ |
|
5783 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCardReaderStatusReq.\n" ); |
|
5784 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCARDREADERSTATUSREQ, "CMmCustomMessHandler::UiccCardReaderStatusReq" ); |
|
5785 |
||
5786 |
TUiccParamsApduReq params; |
|
5787 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
5788 |
params.trId = ETrIdCardReaderStatus; |
|
5789 |
params.serviceType = UICC_CARD_STATUS_GET; |
|
5790 |
||
5791 |
// Current UICC IF implementatation does not support getting |
|
5792 |
// READER_STATUS_BYTE. However, apdu server uses hard coded values |
|
5793 |
// for READER STATUS BYTE bits 1 to 6 |
|
5794 |
// and information contained in bits 7 and 8 can be acquired with |
|
5795 |
// UICC_CARD_REQ request. |
|
5796 |
||
5797 |
return iMmUiccMessHandler->CreateUiccCardReq( params ); |
|
5798 |
} |
|
5799 |
||
5800 |
// ----------------------------------------------------------------------------- |
|
5801 |
// CMmCustomMessHandler::UiccCardReaderStatusResp |
|
5802 |
// |
|
5803 |
// ----------------------------------------------------------------------------- |
|
5804 |
// |
|
5805 |
void CMmCustomMessHandler::UiccCardReaderStatusResp( |
|
5806 |
TInt aStatus, |
|
5807 |
const TDesC8& aFileData ) |
|
5808 |
{ |
|
5809 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCardReaderStatusResp.\n" ); |
|
5810 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCARDREADERSTATUSRESP, "CMmCustomMessHandler::UiccCardReaderStatusResp" ); |
|
5811 |
||
5812 |
TInt err ( KErrNone ); |
|
5813 |
CMmDataPackage dataPackage; |
|
5814 |
TUint8 cardStatus( 0 ); |
|
5815 |
TBuf8<1> statusByte; |
|
5816 |
||
5817 |
cardStatus = aFileData[0]; |
|
5818 |
||
5819 |
if( aStatus == UICC_STATUS_OK ) |
|
5820 |
{ |
|
5821 |
switch( cardStatus ) |
|
5822 |
{ |
|
5823 |
case UICC_STATUS_CARD_READY: |
|
5824 |
{ |
|
5825 |
// UICC Card Status: UICC_STATUS_CARD_READY -> |
|
5826 |
// Card reader status byte: B1101_0000 |
|
5827 |
statusByte.Append(KUiccCardStatusCardPresentAndPoweredOn); |
|
5828 |
break; |
|
5829 |
} |
|
5830 |
||
5831 |
case UICC_STATUS_CARD_DISCONNECTED: |
|
5832 |
case UICC_STATUS_CARD_NOT_PRESENT: |
|
5833 |
{ |
|
5834 |
// UICC Card Status: UICC_STATUS_CARD_DISCONNECTED or |
|
5835 |
// UICC_STATUS_CARD_NOT_PRESENT -> |
|
5836 |
// Card reader status byte: B0001_0000 |
|
5837 |
statusByte.Append(KUiccCardStatusCardNotPresentOrPoweredOff); |
|
5838 |
break; |
|
5839 |
} |
|
5840 |
||
5841 |
default: |
|
5842 |
break; |
|
5843 |
} |
|
5844 |
dataPackage.PackData( &statusByte ); |
|
5845 |
||
5846 |
} |
|
5847 |
else |
|
5848 |
{ |
|
5849 |
if( aStatus == UICC_STATUS_SHUTTING_DOWN ) |
|
5850 |
{ |
|
5851 |
err = CMmStaticUtility::EpocErrorCode( KErrNotReady, KErrNotFound ); |
|
5852 |
} |
|
5853 |
else |
|
5854 |
{ |
|
5855 |
// UICC_STATUS_FAIL |
|
5856 |
err = CMmStaticUtility::EpocErrorCode( KErrGeneral, KErrNotFound ); |
|
5857 |
} |
|
5858 |
} |
|
5859 |
||
5860 |
iMessageRouter->Complete( |
|
5861 |
ECustomGetSimCardReaderStatusIPC, |
|
5862 |
&dataPackage, |
|
5863 |
err ); |
|
5864 |
} |
|
5865 |
||
5866 |
// ----------------------------------------------------------------------------- |
|
5867 |
// CMmCustomMessHandler::UiccCardInd |
|
5868 |
// Breaks UICC_CARD_IND ISI-message and completes " Notify SimCard Status" |
|
5869 |
// to CommonTSY. |
|
5870 |
// ----------------------------------------------------------------------------- |
|
5871 |
// |
|
5872 |
void CMmCustomMessHandler::UiccCardInd( const TIsiReceiveC& aIsiMessage ) |
|
5873 |
{ |
|
5874 |
// Get service type |
|
5875 |
TUint8 serviceType( aIsiMessage.Get8bit( |
|
5876 |
ISI_HEADER_SIZE + UICC_IND_OFFSET_SERVICETYPE ) ); |
|
5877 |
||
5878 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccCardInd, service type: %d", serviceType ); |
|
5879 |
OstTraceExt1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCIND, "CMmCustomMessHandler::UiccCardInd;serviceType=%hhu", serviceType ); |
|
5880 |
||
5881 |
RMmCustomAPI::TSIMCardStatus returnStatus; |
|
5882 |
returnStatus = RMmCustomAPI::SimCardUnknowError; |
|
5883 |
||
5884 |
switch ( serviceType ) |
|
5885 |
{ |
|
5886 |
case UICC_CARD_READY : |
|
5887 |
{ |
|
5888 |
returnStatus = RMmCustomAPI::SimCardInserted; |
|
5889 |
break; |
|
5890 |
} |
|
5891 |
case UICC_CARD_DISCONNECTED: |
|
5892 |
{ |
|
5893 |
returnStatus = RMmCustomAPI::SimCardRemoved; |
|
5894 |
break; |
|
5895 |
} |
|
5896 |
default: |
|
5897 |
{ |
|
5898 |
break; |
|
5899 |
} |
|
5900 |
} |
|
5901 |
||
5902 |
CMmDataPackage dataPackage; |
|
5903 |
dataPackage.PackData( &returnStatus ); |
|
5904 |
iMessageRouter->Complete( |
|
5905 |
ECustomNotifySimCardStatusIPC, |
|
5906 |
&dataPackage, |
|
5907 |
KErrNone ); |
|
5908 |
} |
|
5909 |
||
5910 |
||
5911 |
// ----------------------------------------------------------------------------- |
|
5912 |
// CMmCustomMessHandler::UiccSendAuthenticateApdu |
|
5913 |
// Constructs and sends AUTHENTICATE APDU to the UICC server |
|
5914 |
// ----------------------------------------------------------------------------- |
|
5915 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
5916 |
TInt CMmCustomMessHandler::UiccSendAuthenticateApdu( |
0 | 5917 |
const CMmDataPackage& aDataPackage ) |
5918 |
{ |
|
5919 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu.\n" ); |
|
5920 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu" ); |
|
5921 |
||
5922 |
TInt ret( KErrNone ); |
|
5923 |
TBool apduSendNeeded( EFalse ); |
|
5924 |
||
5925 |
// Let's construct AUTHENTICATE APDU based on authenticate type |
|
5926 |
RMmCustomAPI::TSimAuthenticationBase authBase; |
|
5927 |
aDataPackage.UnPackData( authBase ); |
|
5928 |
TUint8 simAuthType( authBase.ExtensionId() ); |
|
5929 |
||
5930 |
// Fill parameters to instance created from TUiccSendApdu |
|
5931 |
// needed for APDU sending |
|
5932 |
TUiccSendApdu params; |
|
5933 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
5934 |
params.serviceType = UICC_APPL_APDU_SEND; |
|
5935 |
params.fileId = UICC_EF_ID_NOT_PRESENT; |
|
5936 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
5937 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
5938 |
params.filePath.Append( KMasterFileId ); |
|
5939 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
5940 |
||
5941 |
TUint8 cardType( iMmUiccMessHandler->GetCardType() ); |
|
5942 |
TBool serviceStatus( EFalse ); |
|
5943 |
||
5944 |
switch( simAuthType ) |
|
5945 |
{ |
|
5946 |
case RMmCustomAPI::TSimAuthenticationBase::EEapSim: |
|
5947 |
{ |
|
5948 |
if( UICC_CARD_TYPE_ICC == cardType ) |
|
5949 |
{ |
|
5950 |
RMmCustomAPI::TSimAuthenticationEapSim eapSim; |
|
5951 |
aDataPackage.UnPackData( eapSim ); |
|
5952 |
||
5953 |
// In 2G we need to send command RUN GSM ALGORITHM to the ICC |
|
5954 |
UiccCreateRunGsmAlgorithmApdu( params, eapSim.iRandomParameters, ETrIdRunGsmAlgorithmSim ); |
|
5955 |
apduSendNeeded = ETrue; |
|
5956 |
} |
|
5957 |
else if( UICC_CARD_TYPE_UICC == cardType ) |
|
5958 |
{ |
|
5959 |
// In 3G we need to send command AUTHENTICATE to the UICC |
|
5960 |
UiccCreateGsmSecurityContextApdu( params, aDataPackage ); |
|
5961 |
apduSendNeeded = ETrue; |
|
5962 |
} |
|
5963 |
break; |
|
5964 |
} |
|
5965 |
case RMmCustomAPI::TSimAuthenticationBase::EEapAka: |
|
5966 |
{ |
|
5967 |
RMmCustomAPI::TSimAuthenticationEapAka eapAka; |
|
5968 |
aDataPackage.UnPackData( eapAka ); |
|
5969 |
||
5970 |
if( UICC_CARD_TYPE_ICC == cardType ) |
|
5971 |
{ |
|
5972 |
// In 2G we need to send command RUN GSM ALGORITHM to the ICC |
|
5973 |
UiccCreateRunGsmAlgorithmApdu( params, eapAka.iRandomParameters, ETrIdRunGsmAlgorithmAka ); |
|
5974 |
apduSendNeeded = ETrue; |
|
5975 |
} |
|
5976 |
else if( UICC_CARD_TYPE_UICC == cardType ) |
|
5977 |
{ |
|
5978 |
// In 3G we need to send command AUTHENTICATE to the UICC |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
5979 |
UiccCreate3GSecurityContextApdu( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
5980 |
params, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
5981 |
eapAka.iRandomParameters, |
0 | 5982 |
eapAka.iAUTN, |
5983 |
ETrIdEEapAkaAuthenticate ); |
|
5984 |
apduSendNeeded = ETrue; |
|
5985 |
} |
|
5986 |
break; |
|
5987 |
} |
|
5988 |
case RMmCustomAPI::TSimAuthenticationBase::EGbaBootstrap: |
|
5989 |
{ |
|
5990 |
serviceStatus = iMmUiccMessHandler->GetServiceStatus( KServiceGBA ); |
|
5991 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
5992 |
if( UICC_CARD_TYPE_UICC == cardType && |
0 | 5993 |
EFalse != serviceStatus ) |
5994 |
{ |
|
5995 |
UiccCreateGBABootstrappingApdu( params, aDataPackage ); |
|
5996 |
apduSendNeeded = ETrue; |
|
5997 |
} |
|
5998 |
else |
|
5999 |
{ |
|
6000 |
// GBA not supported if card type is ICC or GBA not supported in EFust |
|
6001 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: GBA not supported (card type: 0x%x, ss: 0x%x)\n", cardType, serviceStatus ); |
|
6002 |
OstTraceExt2( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu: GBA not supported (card type: %x, ss: 0x%x)", cardType, serviceStatus ); |
|
6003 |
ret = KErrGeneral; |
|
6004 |
} |
|
6005 |
break; |
|
6006 |
} |
|
6007 |
case RMmCustomAPI::TSimAuthenticationBase::EGbaBootstrapUpdate: |
|
6008 |
{ |
|
6009 |
serviceStatus = iMmUiccMessHandler->GetServiceStatus( KServiceGBA ); |
|
6010 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6011 |
if( UICC_CARD_TYPE_UICC == cardType && |
0 | 6012 |
EFalse != serviceStatus ) |
6013 |
{ |
|
6014 |
UiccGBABootstrapUpdate( aDataPackage ); |
|
6015 |
} |
|
6016 |
else |
|
6017 |
{ |
|
6018 |
// GBA not supported if card type is ICC or GBA not supported in EFust |
|
6019 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: GBA not supported (card type: 0x%x, ss: 0x%x)\n", cardType, serviceStatus ); |
|
6020 |
OstTraceExt2( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu: GBA not supported (card type: 0x%x, ss: 0x%x)", cardType, serviceStatus ); |
|
6021 |
ret = KErrGeneral; |
|
6022 |
} |
|
6023 |
break; |
|
6024 |
} |
|
6025 |
case RMmCustomAPI::TSimAuthenticationBase::EGbaBootstrapNafDerivation: |
|
6026 |
{ |
|
6027 |
serviceStatus = iMmUiccMessHandler->GetServiceStatus( KServiceGBA ); |
|
6028 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6029 |
if( UICC_CARD_TYPE_UICC == cardType && |
0 | 6030 |
EFalse != serviceStatus ) |
6031 |
{ |
|
6032 |
UiccCreateGBABootstrapNafDerivationApdu( params, aDataPackage ); |
|
6033 |
apduSendNeeded = ETrue; |
|
6034 |
} |
|
6035 |
else |
|
6036 |
{ |
|
6037 |
// GBA not supported if card type is ICC or GBA not supported in EFust |
|
6038 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: GBA not supported (card type: 0x%x, ss: 0x%x)\n", cardType, serviceStatus ); |
|
6039 |
OstTraceExt2( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu: GBA not supported (card type: 0x%x, ss: 0x%x)", cardType, serviceStatus ); |
|
6040 |
ret = KErrGeneral; |
|
6041 |
} |
|
6042 |
break; |
|
6043 |
} |
|
6044 |
case RMmCustomAPI::TSimAuthenticationBase::EMgvMskUpdate: |
|
6045 |
{ |
|
6046 |
serviceStatus = iMmUiccMessHandler->GetServiceStatus( KServiceMBMSsecurity ); |
|
6047 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6048 |
if( UICC_CARD_TYPE_UICC == cardType && |
0 | 6049 |
EFalse != serviceStatus ) |
6050 |
{ |
|
6051 |
UiccCreateMbmsMskUpdateApdu( params, aDataPackage ); |
|
6052 |
apduSendNeeded = ETrue; |
|
6053 |
} |
|
6054 |
else |
|
6055 |
{ |
|
6056 |
// MBMS not supported if card type is ICC or MBMS not supported in EFust |
|
6057 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: MBMS security not supported (card type: 0x%x, ss: 0x%x)\n", cardType, serviceStatus ); |
|
6058 |
OstTraceExt2( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu: MBMS security not supported (card type: 0x%x, ss: 0x%x)", cardType, serviceStatus ); |
|
6059 |
ret = KErrGeneral; |
|
6060 |
} |
|
6061 |
break; |
|
6062 |
} |
|
6063 |
case RMmCustomAPI::TSimAuthenticationBase::EMgvMtkGeneration: |
|
6064 |
{ |
|
6065 |
serviceStatus = iMmUiccMessHandler->GetServiceStatus( KServiceMBMSsecurity ); |
|
6066 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6067 |
if( UICC_CARD_TYPE_UICC == cardType && |
0 | 6068 |
EFalse != serviceStatus ) |
6069 |
{ |
|
6070 |
UiccCreateMbmsMtkGenerationApdu( params, aDataPackage ); |
|
6071 |
apduSendNeeded = ETrue; |
|
6072 |
} |
|
6073 |
else |
|
6074 |
{ |
|
6075 |
// MBMS not supported if card type is ICC or MBMS not supported in EFust |
|
6076 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: MBMS security not supported (card type: 0x%x, ss: 0x%x)\n", cardType, serviceStatus ); |
|
6077 |
OstTraceExt2( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu: MBMS security not supported (card type: 0x%x, ss: 0x%x)", cardType, serviceStatus ); |
|
6078 |
ret = KErrGeneral; |
|
6079 |
} |
|
6080 |
break; |
|
6081 |
} |
|
6082 |
case RMmCustomAPI::TSimAuthenticationBase::EMgvMskDeletion: |
|
6083 |
{ |
|
6084 |
serviceStatus = iMmUiccMessHandler->GetServiceStatus( KServiceMBMSsecurity ); |
|
6085 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6086 |
if( UICC_CARD_TYPE_UICC == cardType && |
0 | 6087 |
EFalse != serviceStatus ) |
6088 |
{ |
|
6089 |
UiccCreateMbmsMskDeletionApdu( params, aDataPackage ); |
|
6090 |
apduSendNeeded = ETrue; |
|
6091 |
} |
|
6092 |
else |
|
6093 |
{ |
|
6094 |
// MBMS not supported if card type is ICC or MBMS not supported in EFust |
|
6095 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: MBMS security not supported (card type: 0x%x, ss: 0x%x)\n", cardType, serviceStatus ); |
|
6096 |
OstTraceExt2( TRACE_NORMAL, DUP6_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu: MBMS security not supported (card type: 0x%x, ss: 0x%x)", cardType, serviceStatus ); |
|
6097 |
ret = KErrGeneral; |
|
6098 |
} |
|
6099 |
break; |
|
6100 |
} |
|
6101 |
default: |
|
6102 |
{ |
|
6103 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: Unknown APDU\n" ); |
|
6104 |
OstTrace0( TRACE_NORMAL, DUP7_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApdu: Unknown APDU" ); |
|
6105 |
break; |
|
6106 |
} |
|
6107 |
} |
|
6108 |
||
6109 |
if( EFalse != apduSendNeeded ) |
|
6110 |
{ |
|
6111 |
// send the apdu to the UICC server |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6112 |
ret = iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
0 | 6113 |
} |
6114 |
else |
|
6115 |
{ |
|
6116 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccSendAuthenticateApdu: APDU not sent\n" ); |
|
6117 |
OstTrace0( TRACE_NORMAL, DUP8_CMMCUSTOMMESSHANDLER_UICCSENDAUTHENTICATEAPDU, "CMmCustomMessHandler::UiccSendAuthenticateApduu: APDU not sent" ); |
|
6118 |
} |
|
6119 |
return ret; |
|
6120 |
} |
|
6121 |
||
6122 |
||
6123 |
// ----------------------------------------------------------------------------- |
|
6124 |
// CMmCustomMessHandler::UiccCreateRunGsmAlgorithmApdu |
|
6125 |
// Constructs GSM context AUTHENTICATE APDU |
|
6126 |
// ----------------------------------------------------------------------------- |
|
6127 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6128 |
void CMmCustomMessHandler::UiccCreateRunGsmAlgorithmApdu( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6129 |
TUiccSendApdu& aParams, |
0 | 6130 |
const TDesC8& aRand, |
6131 |
TUiccTrId aTraId ) |
|
6132 |
{ |
|
6133 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateRunGsmAlgorithmApdu.\n" ); |
|
6134 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATERUNGSMALGORITHMAPDU, "CMmCustomMessHandler::UiccCreateRunGsmAlgorithmApdu" ); |
|
6135 |
||
6136 |
aParams.trId = aTraId; |
|
6137 |
aParams.apdu.Append( KClaIcc ); // CLA |
|
6138 |
aParams.apdu.Append( KEvenInstructionCode ); // INS |
|
6139 |
aParams.apdu.Append( 0 ); // P1 is set to 0 in case of RUN GSM ALGORITH |
|
6140 |
aParams.apdu.Append( 0 ); // P2 is set to 0 in case of RUN GSM ALGORITH |
|
6141 |
aParams.apdu.Append( aRand.Size() ); // Lc |
|
6142 |
aParams.apdu.Append( aRand ); // Data |
|
6143 |
aParams.apdu.Append( KRunGsmAlgorithmRespLen ); // Le |
|
6144 |
} |
|
6145 |
||
6146 |
||
6147 |
// ----------------------------------------------------------------------------- |
|
6148 |
// CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp |
|
6149 |
// Handles response APDU for RUN GSM ALGORITHM |
|
6150 |
// ----------------------------------------------------------------------------- |
|
6151 |
// |
|
6152 |
void CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp( |
|
6153 |
TInt aTraId, |
|
6154 |
TInt aStatus, |
|
6155 |
const TDesC8& aFileData ) |
|
6156 |
{ |
|
6157 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp.\n" ); |
|
6158 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCRUNGSMALGORITHMAPDURESP, "CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp" ); |
|
6159 |
||
6160 |
TInt ret( KErrNone ); |
|
6161 |
TInt ipc( ETrIdRunGsmAlgorithmIms == aTraId ? EMobilePhoneIMSAuthenticate : ECustomGetSimAuthenticationDataIPC ); |
|
6162 |
RMmCustomAPI::TSimAuthenticationEapSim eapSim; |
|
6163 |
RMmCustomAPI::TSimAuthenticationEapAka eapAka; |
|
6164 |
RMobilePhone::TImsAuthenticateDataV5 ims; |
|
6165 |
||
6166 |
if( UICC_STATUS_OK == aStatus ) |
|
6167 |
{ |
|
6168 |
// get SW1 and SW2 |
|
6169 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
6170 |
TUint8 sw2( aFileData[aFileData.Length() - KSw2Position] ); |
|
6171 |
||
6172 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
6173 |
||
6174 |
if( KNormalCommandEnding == result ) |
|
6175 |
{ |
|
6176 |
if( KApduOk == ValidateReceivedAuthenticateApdu( aTraId, aFileData ) ) |
|
6177 |
{ |
|
6178 |
// At the momen UICC server get the response from ICC, but in the |
|
6179 |
// future it may be removed from UICC. So then we should get the |
|
6180 |
// response from ICC. |
|
6181 |
TUint8 index = 0; |
|
6182 |
||
6183 |
if( ETrIdRunGsmAlgorithmSim == aTraId ) // EAP SIM |
|
6184 |
{ |
|
6185 |
// get the SRES |
|
6186 |
eapSim.iSRES.Copy( aFileData.Mid(index, KLenOfSRes) ); |
|
6187 |
index += KLenOfSRes; |
|
6188 |
||
6189 |
// get the Kc |
|
6190 |
eapSim.iKC.Copy( aFileData.Mid(index, KLenOfKc ) ); |
|
6191 |
} |
|
6192 |
else if( ETrIdRunGsmAlgorithmIms == aTraId ) // IMS |
|
6193 |
{ |
|
6194 |
// get the SRES |
|
6195 |
ims.iRES.Copy( aFileData.Mid(index, KLenOfSRes) ); |
|
6196 |
index += KLenOfSRes; |
|
6197 |
||
6198 |
// let's calculate ck and ik from kc |
|
6199 |
DeriveCkFromKc( ims.iCK, aFileData.Mid(index, KLenOfKc ) ); |
|
6200 |
DeriveIkFromKc( ims.iIK, aFileData.Mid(index, KLenOfKc ) ); |
|
6201 |
} |
|
6202 |
else // EAP AKA |
|
6203 |
{ |
|
6204 |
// get the SRES |
|
6205 |
eapAka.iRES.Copy( aFileData.Mid(index, KLenOfSRes) ); |
|
6206 |
index += KLenOfSRes; |
|
6207 |
||
6208 |
// let's calculate ck and ik from kc |
|
6209 |
DeriveCkFromKc( eapAka.iCK, aFileData.Mid(index, KLenOfKc ) ); |
|
6210 |
DeriveIkFromKc( eapAka.iIK, aFileData.Mid(index, KLenOfKc ) ); |
|
6211 |
} |
|
6212 |
} |
|
6213 |
else |
|
6214 |
{ |
|
6215 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp. APDU validation fails\n" ); |
|
6216 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCRUNGSMALGORITHMAPDURESP, "CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp. APDU validation fails" ); |
|
6217 |
ret = KErrMMEtelAuthenticateFailed; |
|
6218 |
} |
|
6219 |
} |
|
6220 |
else if( KCmdNotAllowedSecurityStatusNotSatisfied == result ) |
|
6221 |
{ |
|
6222 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp: Security conditions not satisfied\n" ); |
|
6223 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_UICCRUNGSMALGORITHMAPDURESP, "CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp: Security conditions not satisfied" ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6224 |
ret = CMmStaticUtility::EpocErrorCode( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6225 |
KErrAccessDenied, |
0 | 6226 |
KErrGsm0707SimPin1Required ); |
6227 |
} |
|
6228 |
else |
|
6229 |
{ |
|
6230 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp. unknown result: 0x%X\n", result ); |
|
6231 |
OstTrace1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_UICCRUNGSMALGORITHMAPDURESP, "CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp. unknown result: 0x%x", result ); |
|
6232 |
ret = KErrMMEtelAuthenticateFailed; |
|
6233 |
} |
|
6234 |
} |
|
6235 |
else |
|
6236 |
{ |
|
6237 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
6238 |
OstTrace1( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_UICCRUNGSMALGORITHMAPDURESP, "CMmCustomMessHandler::UiccRunGsmAlgorithmApduResp: UICC status not ok: 0x%x", aStatus ); |
|
6239 |
ret = KErrMMEtelAuthenticateFailed; |
|
6240 |
} |
|
6241 |
||
6242 |
if( KErrNone != ret ) |
|
6243 |
{ |
|
6244 |
iMessageRouter->Complete( |
|
6245 |
ipc, |
|
6246 |
ret ); |
|
6247 |
} |
|
6248 |
else |
|
6249 |
{ |
|
6250 |
CMmDataPackage dataPackage; |
|
6251 |
if( ETrIdRunGsmAlgorithmSim == aTraId ) // EAP SIM |
|
6252 |
{ |
|
6253 |
dataPackage.PackData( &eapSim ); |
|
6254 |
} |
|
6255 |
else if( ETrIdRunGsmAlgorithmIms == aTraId ) |
|
6256 |
{ |
|
6257 |
dataPackage.PackData( &ims ); |
|
6258 |
} |
|
6259 |
else |
|
6260 |
{ |
|
6261 |
dataPackage.PackData( &eapAka ); |
|
6262 |
} |
|
6263 |
||
6264 |
iMessageRouter->Complete( |
|
6265 |
ipc, |
|
6266 |
&dataPackage, |
|
6267 |
ret ); |
|
6268 |
} |
|
6269 |
} |
|
6270 |
||
6271 |
// ----------------------------------------------------------------------------- |
|
6272 |
// CMmCustomMessHandler::UiccCreateGsmSecurityContextApdu |
|
6273 |
// Constructs GSM context AUTHENTICATE APDU |
|
6274 |
// ----------------------------------------------------------------------------- |
|
6275 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6276 |
void CMmCustomMessHandler::UiccCreateGsmSecurityContextApdu( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6277 |
TUiccSendApdu& params, |
0 | 6278 |
const CMmDataPackage& aDataPackage ) |
6279 |
{ |
|
6280 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateGsmSecurityContextApdu.\n" ); |
|
6281 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATEGSMSECURITYCONTEXTAPDU, "CMmCustomMessHandler::UiccCreateGsmSecurityContextApdu" ); |
|
6282 |
||
6283 |
RMmCustomAPI::TSimAuthenticationEapSim eapSim; |
|
6284 |
aDataPackage.UnPackData( eapSim ); |
|
6285 |
||
6286 |
params.trId = ETrIdEEapSimAuthenticate; |
|
6287 |
params.apdu.Append( KClaNoSm ); // CLA |
|
6288 |
params.apdu.Append( KEvenInstructionCode ); // INS |
|
6289 |
params.apdu.Append( 0 ); // P1 is set to 0 in case of even instruction |
|
6290 |
params.apdu.Append( KGsmAuthenticationContext ); // P2 |
|
6291 |
params.apdu.Append( eapSim.iRandomParameters.Size() + 1 ); // Lc |
|
6292 |
params.apdu.Append( eapSim.iRandomParameters.Size() ); // Data |
|
6293 |
params.apdu.Append( eapSim.iRandomParameters ); // Data |
|
6294 |
params.apdu.Append( KMaximumLenOfDataExpected ); // Le |
|
6295 |
} |
|
6296 |
||
6297 |
// ----------------------------------------------------------------------------- |
|
6298 |
// CMmCustomMessHandler::UiccGsmSecurityContextApduResp |
|
6299 |
// Handles response APDU for GSM context AUTHENTICATE APDU |
|
6300 |
// ----------------------------------------------------------------------------- |
|
6301 |
// |
|
6302 |
void CMmCustomMessHandler::UiccGsmSecurityContextApduResp( |
|
6303 |
TInt aTraId, |
|
6304 |
TInt aStatus, |
|
6305 |
const TDesC8& aFileData ) |
|
6306 |
{ |
|
6307 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGsmSecurityContextApduResp.\n" ); |
|
6308 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCGSMSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::UiccGsmSecurityContextApduResp" ); |
|
6309 |
||
6310 |
TInt ret( KErrNone ); |
|
6311 |
RMmCustomAPI::TSimAuthenticationEapSim eapSim; |
|
6312 |
||
6313 |
if( UICC_STATUS_OK == aStatus ) |
|
6314 |
{ |
|
6315 |
// get SW1 and SW2 |
|
6316 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
6317 |
TUint8 sw2( aFileData[aFileData.Length() - KSw2Position] ); |
|
6318 |
||
6319 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
6320 |
||
6321 |
if( KNormalCommandEnding == result ) |
|
6322 |
{ |
|
6323 |
if( KApduOk == ValidateReceivedAuthenticateApdu( aTraId, aFileData ) ) |
|
6324 |
{ |
|
6325 |
// get the SRES |
|
6326 |
TUint8 index( 0 ); |
|
6327 |
TUint8 len( aFileData[index++] ); |
|
6328 |
eapSim.iSRES.Copy( aFileData.Mid( index , len ) ); |
|
6329 |
index += len; |
|
6330 |
||
6331 |
// get the Kc |
|
6332 |
len = aFileData[index++]; |
|
6333 |
eapSim.iKC.Copy( aFileData.Mid( index , len ) ); |
|
6334 |
} |
|
6335 |
else |
|
6336 |
{ |
|
6337 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGsmSecurityContextApduResp: APDU validation failed\n" ); |
|
6338 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCGSMSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::UiccGsmSecurityContextApduResp: APDU validation failed" ); |
|
6339 |
ret = KErrMMEtelAuthenticateFailed; |
|
6340 |
} |
|
6341 |
} |
|
6342 |
else |
|
6343 |
{ |
|
6344 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGsmSecurityContextApduResp: unknown result\n" ); |
|
6345 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_UICCGSMSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::UiccGsmSecurityContextApduResp: unknown result" ); |
|
6346 |
ret = KErrMMEtelAuthenticateFailed; |
|
6347 |
} |
|
6348 |
} |
|
6349 |
else |
|
6350 |
{ |
|
6351 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccGsmSecurityContextApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
6352 |
OstTrace1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_UICCGSMSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::UiccGsmSecurityContextApduResp: UICC status not ok: 0x%x", aStatus ); |
|
6353 |
ret = KErrMMEtelAuthenticateFailed; |
|
6354 |
} |
|
6355 |
||
6356 |
if( KErrNone != ret ) |
|
6357 |
{ |
|
6358 |
iMessageRouter->Complete( |
|
6359 |
ECustomGetSimAuthenticationDataIPC, |
|
6360 |
ret ); |
|
6361 |
} |
|
6362 |
else |
|
6363 |
{ |
|
6364 |
CMmDataPackage dataPackage; |
|
6365 |
dataPackage.PackData( &eapSim ); |
|
6366 |
||
6367 |
iMessageRouter->Complete( |
|
6368 |
ECustomGetSimAuthenticationDataIPC, |
|
6369 |
&dataPackage, |
|
6370 |
ret ); |
|
6371 |
} |
|
6372 |
} |
|
6373 |
||
6374 |
// ----------------------------------------------------------------------------- |
|
6375 |
// CMmCustomMessHandler::UiccCreate3GSecurityContextApdu |
|
6376 |
// Constructs 3G security context AUTHENTICATE APDU |
|
6377 |
// ----------------------------------------------------------------------------- |
|
6378 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6379 |
void CMmCustomMessHandler::UiccCreate3GSecurityContextApdu( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6380 |
TUiccSendApdu& aParams, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6381 |
const TDesC8& aRand, |
0 | 6382 |
const TDesC8& aAuth, |
6383 |
TUiccTrId aTraId ) |
|
6384 |
{ |
|
6385 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreate3GSecurityContextApdu.\n" ); |
|
6386 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATE3GSECURITYCONTEXTAPDU, "CMmCustomMessHandler::UiccCreate3GSecurityContextApdu" ); |
|
6387 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6388 |
// len of data is sizeof RAND + sizeof AUTN + two length fields |
0 | 6389 |
// (one for RAND len and one for AUTN len) |
6390 |
TUint8 lc( aRand.Size() + aAuth.Size() + 2 ); |
|
6391 |
||
6392 |
aParams.trId = aTraId; |
|
6393 |
aParams.apdu.Append( KClaNoSm ); // CLA |
|
6394 |
aParams.apdu.Append( KEvenInstructionCode ); // INS |
|
6395 |
aParams.apdu.Append( 0 ); // P1 is set to 0 in case of even instruction |
|
6396 |
aParams.apdu.Append( K3GAuthenticationContext ); // P2 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6397 |
aParams.apdu.Append( lc ); // Lc |
0 | 6398 |
aParams.apdu.Append( aRand.Size() ); // len of RAND |
6399 |
aParams.apdu.Append( aRand ); // RAND |
|
6400 |
aParams.apdu.Append( aAuth.Size() ); // len of AUTN |
|
6401 |
aParams.apdu.Append( aAuth ); // AUTN |
|
6402 |
aParams.apdu.Append( KMaximumLenOfDataExpected ); // Le |
|
6403 |
} |
|
6404 |
||
6405 |
// ----------------------------------------------------------------------------- |
|
6406 |
// CMmCustomMessHandler::Uicc3GSecurityContextApduResp |
|
6407 |
// Handles response APDU for 3G security context AUTHENTICATE APDU |
|
6408 |
// ----------------------------------------------------------------------------- |
|
6409 |
// |
|
6410 |
void CMmCustomMessHandler::Uicc3GSecurityContextApduResp( |
|
6411 |
TInt aTraId, |
|
6412 |
TInt aStatus, |
|
6413 |
const TDesC8& aFileData ) |
|
6414 |
{ |
|
6415 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Uicc3GSecurityContextApduResp.\n" ); |
|
6416 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICC3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Uicc3GSecurityContextApduResp" ); |
|
6417 |
||
6418 |
TInt ret( KErrNone ); |
|
6419 |
TInt ipc( ETrIdEEapAkaAuthenticateIms == aTraId ? EMobilePhoneIMSAuthenticate : ECustomGetSimAuthenticationDataIPC ); |
|
6420 |
RMmCustomAPI::TSimAuthenticationEapAka eapAka; |
|
6421 |
RMobilePhone::TImsAuthenticateDataV5 ims; |
|
6422 |
||
6423 |
if( UICC_STATUS_OK == aStatus ) |
|
6424 |
{ |
|
6425 |
// get SW1 and SW2 |
|
6426 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
6427 |
TUint8 sw2( aFileData[aFileData.Length() - KSw2Position] ); |
|
6428 |
||
6429 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
6430 |
||
6431 |
if( KNormalCommandEnding == result ) |
|
6432 |
{ |
|
6433 |
if( KApduOk == ValidateReceivedAuthenticateApdu( aTraId, aFileData ) ) |
|
6434 |
{ |
|
6435 |
TUint32 index( 0 ); |
|
6436 |
||
6437 |
if( KSuccessfull3GAuthTag == aFileData[index] ) |
|
6438 |
{ |
|
6439 |
index++; |
|
6440 |
||
6441 |
if( ETrIdEEapAkaAuthenticate == aTraId ) |
|
6442 |
{ |
|
6443 |
// get the RES |
|
6444 |
TUint8 len( aFileData[index++] ); |
|
6445 |
eapAka.iRES.Copy( aFileData.Mid( index, len ) ); |
|
6446 |
index += len; |
|
6447 |
||
6448 |
// get the CK |
|
6449 |
len = aFileData[index++]; |
|
6450 |
eapAka.iCK.Copy( aFileData.Mid( index, len ) ); |
|
6451 |
index += len; |
|
6452 |
||
6453 |
// get the IK |
|
6454 |
len = aFileData[index++]; |
|
6455 |
eapAka.iIK.Copy( aFileData.Mid( index, len ) ); |
|
6456 |
index += len; |
|
6457 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6458 |
// Kc is not supported at the moment because of |
0 | 6459 |
// RMmCustomAPI::TSimAuthenticationEapAka doesn't |
6460 |
// have parameter for that |
|
6461 |
} |
|
6462 |
else |
|
6463 |
{ |
|
6464 |
// get the RES |
|
6465 |
TUint8 len( aFileData[index++] ); |
|
6466 |
ims.iRES.Copy( aFileData.Mid( index, len ) ); |
|
6467 |
index += len; |
|
6468 |
||
6469 |
// get the CK |
|
6470 |
len = aFileData[index++]; |
|
6471 |
ims.iCK.Copy( aFileData.Mid( index, len ) ); |
|
6472 |
index += len; |
|
6473 |
||
6474 |
// get the IK |
|
6475 |
len = aFileData[index++]; |
|
6476 |
ims.iIK.Copy( aFileData.Mid( index, len ) ); |
|
6477 |
index += len; |
|
6478 |
} |
|
6479 |
} |
|
6480 |
else if( KSyncFailureTag == aFileData[index] ) |
|
6481 |
{ |
|
6482 |
index++; |
|
6483 |
||
6484 |
if( ETrIdEEapAkaAuthenticate == aTraId ) |
|
6485 |
{ |
|
6486 |
// get the AUTS |
|
6487 |
TUint8 len( aFileData[index++] ); |
|
6488 |
eapAka.iAUTS.Copy( aFileData.Mid( index, len ) ); |
|
6489 |
} |
|
6490 |
else |
|
6491 |
{ |
|
6492 |
// get the AUTS |
|
6493 |
TUint8 len( aFileData[index++] ); |
|
6494 |
ims.iAUTS.Copy( aFileData.Mid( index, len ) ); |
|
6495 |
} |
|
6496 |
ret = KErrMMEtelSqnVerificationFailed; |
|
6497 |
} |
|
6498 |
} |
|
6499 |
else |
|
6500 |
{ |
|
6501 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Uicc3GSecurityContextApduResp: APDU validation failed\n" ); |
|
6502 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICC3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Uicc3GSecurityContextApduResp: APDU validation failed" ); |
|
6503 |
ret = KErrMMEtelAuthenticateFailed; |
|
6504 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6505 |
} |
0 | 6506 |
else if( KAppAuthErrorIncorrectMac == result ) |
6507 |
{ |
|
6508 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Uicc3GSecurityContextApduResp: incorrect MAC\n" ); |
|
6509 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_UICC3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Uicc3GSecurityContextApduResp: incorrect MAC" ); |
|
6510 |
// no parameters in this case |
|
6511 |
ret = KErrMMEtelMacVerificationFailed; |
|
6512 |
} |
|
6513 |
else if( KCmdNotAllowedSecurityStatusNotSatisfied == result ) |
|
6514 |
{ |
|
6515 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Uicc3GSecurityContextApduResp: Security conditions not satisfied\n" ); |
|
6516 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_UICC3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Uicc3GSecurityContextApduResp: Security conditions not satisfied" ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6517 |
ret = CMmStaticUtility::EpocErrorCode( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6518 |
KErrAccessDenied, |
0 | 6519 |
KErrGsm0707SimPin1Required ); |
6520 |
} |
|
6521 |
else |
|
6522 |
{ |
|
6523 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Uicc3GSecurityContextApduResp: unknown result\n" ); |
|
6524 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_UICC3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Uicc3GSecurityContextApduResp: unknown result" ); |
|
6525 |
ret = KErrMMEtelAuthenticateFailed; |
|
6526 |
} |
|
6527 |
} |
|
6528 |
else |
|
6529 |
{ |
|
6530 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::Uicc3GSecurityContextApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
6531 |
OstTrace1( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_UICC3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Uicc3GSecurityContextApduResp: UICC status not ok: 0x%x", aStatus ); |
|
6532 |
ret = ETrIdEEapAkaAuthenticateIms == aTraId ? KErrGeneral : KErrMMEtelAuthenticateFailed; |
|
6533 |
} |
|
6534 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6535 |
if( KErrNone == ret || |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6536 |
KErrMMEtelSqnVerificationFailed == ret || |
0 | 6537 |
KErrMMEtelMacVerificationFailed == ret ) |
6538 |
{ |
|
6539 |
CMmDataPackage dataPackage; |
|
6540 |
||
6541 |
if( ETrIdEEapAkaAuthenticate == aTraId ) |
|
6542 |
{ |
|
6543 |
dataPackage.PackData( &eapAka ); |
|
6544 |
} |
|
6545 |
else |
|
6546 |
{ |
|
6547 |
dataPackage.PackData( &ims ); |
|
6548 |
} |
|
6549 |
||
6550 |
iMessageRouter->Complete( |
|
6551 |
ipc, |
|
6552 |
&dataPackage, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6553 |
ret ); |
0 | 6554 |
} |
6555 |
else |
|
6556 |
{ |
|
6557 |
iMessageRouter->Complete( |
|
6558 |
ipc, |
|
6559 |
ret ); |
|
6560 |
} |
|
6561 |
} |
|
6562 |
||
6563 |
||
6564 |
// ----------------------------------------------------------------------------- |
|
6565 |
// CMmCustomMessHandler::UiccCreateGBABootstrappingApdu |
|
6566 |
// Constructs GBA security context AUTHENTICATE APDU (bootstrapping mode) |
|
6567 |
// ----------------------------------------------------------------------------- |
|
6568 |
// |
|
6569 |
void CMmCustomMessHandler::UiccCreateGBABootstrappingApdu( |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6570 |
TUiccSendApdu& aParams, |
0 | 6571 |
const CMmDataPackage& aDataPackage ) |
6572 |
{ |
|
6573 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateGBABootstrappingApdu.\n" ); |
|
6574 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATEGBABOOTSTRAPPINGAPDU, "CMmCustomMessHandler::UiccCreateGBABootstrappingApdu" ); |
|
6575 |
||
6576 |
RMmCustomAPI::TSimAuthenticationGbaBootstrap gbaBootstrap; |
|
6577 |
aDataPackage.UnPackData( gbaBootstrap ); |
|
6578 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6579 |
// len of data is GBA bootstrapping mode tag (1 byte) + sizeof RAND |
0 | 6580 |
// + sizeof AUTN + two length fields (one for RAND len and one for AUTN len) |
6581 |
TUint8 lc( 1 + gbaBootstrap.iRandomParameters.Size() + gbaBootstrap.iAUTN.Size() + 2 ); |
|
6582 |
||
6583 |
aParams.trId = ETrIdEGbaBootstrap; |
|
6584 |
aParams.apdu.Append( KClaNoSm ); // CLA |
|
6585 |
aParams.apdu.Append( KEvenInstructionCode ); // INS |
|
6586 |
aParams.apdu.Append( 0 ); // P1 is set to 0 in case of even instruction |
|
6587 |
aParams.apdu.Append( KGBAAuthenticationContext ); // P2 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6588 |
aParams.apdu.Append( lc ); // Lc |
0 | 6589 |
aParams.apdu.Append( KGBABootstappingModeTag ); // GBA bootstrapping mode tag |
6590 |
aParams.apdu.Append( gbaBootstrap.iRandomParameters.Size() ); // len of RAND |
|
6591 |
aParams.apdu.Append( gbaBootstrap.iRandomParameters ); // RAND |
|
6592 |
aParams.apdu.Append( gbaBootstrap.iAUTN.Size() ); // len of AUTN |
|
6593 |
aParams.apdu.Append( gbaBootstrap.iAUTN ); // AUTN |
|
6594 |
aParams.apdu.Append( KMaximumLenOfDataExpected ); // Le |
|
6595 |
} |
|
6596 |
||
6597 |
// ----------------------------------------------------------------------------- |
|
6598 |
// CMmCustomMessHandler::UiccGBABootstrappingApduResp |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6599 |
// Handles response APDU for GBA security context AUTHENTICATE APDU |
0 | 6600 |
// (bootstrapping mode) |
6601 |
// ----------------------------------------------------------------------------- |
|
6602 |
// |
|
6603 |
void CMmCustomMessHandler::UiccGBABootstrappingApduResp( |
|
6604 |
TInt aTraId, |
|
6605 |
TInt aStatus, |
|
6606 |
const TDesC8& aFileData ) |
|
6607 |
{ |
|
6608 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrappingApduResp.\n" ); |
|
6609 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPPINGAPDURESP, "CMmCustomMessHandler::UiccGBABootstrappingApduResp" ); |
|
6610 |
||
6611 |
TInt ret( KErrNone ); |
|
6612 |
RMmCustomAPI::TSimAuthenticationGbaBootstrap gbaBootstrap; |
|
6613 |
||
6614 |
if( UICC_STATUS_OK == aStatus ) |
|
6615 |
{ |
|
6616 |
// get SW1 and SW2 |
|
6617 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
6618 |
TUint8 sw2( aFileData[aFileData.Length() - KSw2Position] ); |
|
6619 |
||
6620 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
6621 |
||
6622 |
if( KNormalCommandEnding == result ) |
|
6623 |
{ |
|
6624 |
if( KApduOk == ValidateReceivedAuthenticateApdu( aTraId, aFileData ) ) |
|
6625 |
{ |
|
6626 |
TUint32 index( 0 ); |
|
6627 |
||
6628 |
if( KSuccessfull3GAuthTag == aFileData[index] ) |
|
6629 |
{ |
|
6630 |
index++; |
|
6631 |
||
6632 |
// get the RES |
|
6633 |
TUint8 len( aFileData[index++] ); |
|
6634 |
gbaBootstrap.iRES.Copy( aFileData.Mid( index, len ) ); |
|
6635 |
} |
|
6636 |
||
6637 |
else if( KSyncFailureTag == aFileData[index] ) |
|
6638 |
{ |
|
6639 |
index++; |
|
6640 |
||
6641 |
// get the AUTS |
|
6642 |
TUint8 len( aFileData[index++] ); |
|
6643 |
gbaBootstrap.iAUTS.Copy( aFileData.Mid( index, len ) ); |
|
6644 |
||
6645 |
ret = KErrMMEtelSqnVerificationFailed; |
|
6646 |
} |
|
6647 |
} |
|
6648 |
else |
|
6649 |
{ |
|
6650 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrappingApduResp: APDU validation failed\n" ); |
|
6651 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPPINGAPDURESP, "CMmCustomMessHandler::UiccGBABootstrappingApduResp: APDU validation failed" ); |
|
6652 |
ret = KErrGeneral; |
|
6653 |
} |
|
6654 |
} |
|
6655 |
else if( KAppAuthErrorIncorrectMac == result ) |
|
6656 |
{ |
|
6657 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrappingApduResp: incorrect MAC\n" ); |
|
6658 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPPINGAPDURESP, "CMmCustomMessHandler::UiccGBABootstrappingApduResp: incorrect MAC" ); |
|
6659 |
// no parameters in this case |
|
6660 |
ret = KErrMMEtelMacVerificationFailed; |
|
6661 |
} |
|
6662 |
else |
|
6663 |
{ |
|
6664 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrappingApduResp: unknown result\n" ); |
|
6665 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPPINGAPDURESP, "CMmCustomMessHandler::UiccGBABootstrappingApduResp: unknown result" ); |
|
6666 |
ret = KErrGeneral; |
|
6667 |
} |
|
6668 |
} |
|
6669 |
else |
|
6670 |
{ |
|
6671 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccGBABootstrappingApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
6672 |
OstTrace1( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPPINGAPDURESP, "CMmCustomMessHandler::UiccGBABootstrappingApduResp: UICC status not ok: 0x%x", aStatus ); |
|
6673 |
ret = KErrMMEtelAuthenticateFailed; |
|
6674 |
} |
|
6675 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6676 |
if( KErrNone == ret || |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6677 |
KErrMMEtelSqnVerificationFailed == ret || |
0 | 6678 |
KErrMMEtelMacVerificationFailed == ret ) |
6679 |
{ |
|
6680 |
CMmDataPackage dataPackage; |
|
6681 |
dataPackage.PackData( &gbaBootstrap ); |
|
6682 |
||
6683 |
iMessageRouter->Complete( |
|
6684 |
ECustomGetSimAuthenticationDataIPC, |
|
6685 |
&dataPackage, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6686 |
ret ); |
0 | 6687 |
} |
6688 |
else |
|
6689 |
{ |
|
6690 |
iMessageRouter->Complete( |
|
6691 |
ECustomGetSimAuthenticationDataIPC, |
|
6692 |
ret ); |
|
6693 |
} |
|
6694 |
} |
|
6695 |
||
6696 |
||
6697 |
// ----------------------------------------------------------------------------- |
|
6698 |
// CMmCustomMessHandler::UiccGBABootstrapUpdate |
|
6699 |
// starts GBA bootstrap update operation |
|
6700 |
// ----------------------------------------------------------------------------- |
|
6701 |
// |
|
6702 |
void CMmCustomMessHandler::UiccGBABootstrapUpdate( |
|
6703 |
const CMmDataPackage& aDataPackage ) |
|
6704 |
{ |
|
6705 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrapUpdate.\n" ); |
|
6706 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPUPDATE, "CMmCustomMessHandler::UiccGBABootstrapUpdate" ); |
|
6707 |
||
6708 |
// GBA bootstrap update is done by first reading of elementary file EFgba. |
|
6709 |
// After that RAND is stored temporarily and B-Tid and keylifetime is written |
|
6710 |
// to EFgba. After write operation, RAND is completed to the client. |
|
6711 |
||
6712 |
RMmCustomAPI::TSimAuthenticationGbaBootstrapUpdate gbaBootstrapUpdate; |
|
6713 |
aDataPackage.UnPackData( gbaBootstrapUpdate ); |
|
6714 |
||
6715 |
iBTidBuf.Zero(); |
|
6716 |
iKeyLifetimeBuf.Zero(); |
|
6717 |
||
6718 |
// Store B-TID temporarily |
|
6719 |
iBTidBuf.Append( gbaBootstrapUpdate.iBTid ); |
|
6720 |
||
6721 |
// Store Key lifetime temporarily |
|
6722 |
iKeyLifetimeBuf.Append( gbaBootstrapUpdate.iKeyLifeTime ); |
|
6723 |
||
6724 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
6725 |
TUiccReadTransparent params; |
|
6726 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
6727 |
params.trId = ETrIdEGbaBootstrapRead; |
|
6728 |
||
6729 |
params.dataAmount = 0; |
|
6730 |
params.dataOffset = 0; |
|
6731 |
params.fileId = KElemGba; |
|
6732 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
6733 |
params.serviceType = UICC_APPL_READ_TRANSPARENT; |
|
6734 |
||
6735 |
// File id path |
|
6736 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
6737 |
params.filePath.Append( KMasterFileId ); |
|
6738 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
6739 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6740 |
iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
0 | 6741 |
} |
6742 |
||
6743 |
// ----------------------------------------------------------------------------- |
|
6744 |
// CMmCustomMessHandler::UiccGBABootstrapReadResp |
|
6745 |
// Handles response to elementary file EFgba read operation |
|
6746 |
// ----------------------------------------------------------------------------- |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6747 |
// |
0 | 6748 |
void CMmCustomMessHandler::UiccGBABootstrapReadResp( |
6749 |
TInt aStatus, |
|
6750 |
const TDesC8& aFileData ) |
|
6751 |
{ |
|
6752 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrapReadResp.\n" ); |
|
6753 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPREADRESP, "CMmCustomMessHandler::UiccGBABootstrapReadResp" ); |
|
6754 |
||
6755 |
iRandBuf.Zero(); |
|
6756 |
||
6757 |
if( UICC_STATUS_OK == aStatus) |
|
6758 |
{ |
|
6759 |
// Get the rand len |
|
6760 |
TUint32 index( 0 ); |
|
6761 |
TUint8 randLen( aFileData[index++] ); |
|
6762 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6763 |
if( aFileData.Length() >= randLen + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6764 |
iBTidBuf.Length() + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6765 |
iKeyLifetimeBuf.Length() + |
0 | 6766 |
3 ) |
6767 |
{ |
|
6768 |
// store rand temporarily so that we can complete it |
|
6769 |
// when B-Tid and keylifetime is updated to the EFgba. |
|
6770 |
iRandBuf.Copy( aFileData.Mid( index, randLen ) ); |
|
6771 |
||
6772 |
// Set parameters for UICC_APPL_CMD_REQ message |
|
6773 |
TUiccWriteTransparent params; |
|
6774 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
6775 |
params.trId = ETrIdEGbaBootstrapUpdate; |
|
6776 |
params.dataOffset = randLen + 1; |
|
6777 |
params.fileId = KElemGba; |
|
6778 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
6779 |
params.serviceType = UICC_APPL_UPDATE_TRANSPARENT; |
|
6780 |
||
6781 |
// File id path |
|
6782 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
6783 |
params.filePath.Append( KMasterFileId ); |
|
6784 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
6785 |
||
6786 |
// fill file data |
|
6787 |
params.fileData.Append( iBTidBuf.Length() ); |
|
6788 |
params.fileData.Append( iBTidBuf ); |
|
6789 |
params.fileData.Append( iKeyLifetimeBuf.Length() ); |
|
6790 |
params.fileData.Append( iKeyLifetimeBuf ); |
|
6791 |
||
6792 |
iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
6793 |
} |
|
6794 |
else |
|
6795 |
{ |
|
6796 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrapReadResp. File too small for update\n" ); |
|
6797 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPREADRESP, "CMmCustomMessHandler::UiccGBABootstrapReadResp. File too small for update" ); |
|
6798 |
iMessageRouter->Complete( |
|
6799 |
ECustomGetSimAuthenticationDataIPC, |
|
6800 |
KErrArgument ); |
|
6801 |
} |
|
6802 |
} |
|
6803 |
else |
|
6804 |
{ |
|
6805 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccGBABootstrapReadResp. EFgba reading failed (0x%x)\n", aStatus ); |
|
6806 |
OstTrace1( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPREADRESP, "CMmCustomMessHandler::UiccGBABootstrapReadResp. EFgba reading failed (%x)", aStatus ); |
|
6807 |
iMessageRouter->Complete( |
|
6808 |
ECustomGetSimAuthenticationDataIPC, |
|
6809 |
KErrMMEtelAuthenticateFailed ); |
|
6810 |
} |
|
6811 |
} |
|
6812 |
||
6813 |
||
6814 |
// ----------------------------------------------------------------------------- |
|
6815 |
// CMmCustomMessHandler::UiccGBABootstrapUpdateResp |
|
6816 |
// Handles response to elementary file EFgba write operation |
|
6817 |
// ----------------------------------------------------------------------------- |
|
6818 |
// |
|
6819 |
void CMmCustomMessHandler::UiccGBABootstrapUpdateResp( TInt aStatus ) |
|
6820 |
{ |
|
6821 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrapUpdateResp.\n" ); |
|
6822 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCGBABOOTSTRAPUPDATERESP, "CMmCustomMessHandler::UiccGBABootstrapUpdateResp" ); |
|
6823 |
||
6824 |
TInt ret( KErrGeneral ); |
|
6825 |
RMmCustomAPI::TSimAuthenticationGbaBootstrapUpdate gbaBootstrapUpdate; |
|
6826 |
||
6827 |
if( UICC_STATUS_OK == aStatus ) |
|
6828 |
{ |
|
6829 |
ret = KErrNone; |
|
6830 |
gbaBootstrapUpdate.iRandomParameters.Copy( iRandBuf ); |
|
6831 |
} |
|
6832 |
else |
|
6833 |
{ |
|
6834 |
ret = KErrMMEtelAuthenticateFailed; |
|
6835 |
} |
|
6836 |
||
6837 |
if( KErrNone == ret ) |
|
6838 |
{ |
|
6839 |
CMmDataPackage dataPackage; |
|
6840 |
dataPackage.PackData( &gbaBootstrapUpdate ); |
|
6841 |
iMessageRouter->Complete( |
|
6842 |
ECustomGetSimAuthenticationDataIPC, |
|
6843 |
&dataPackage, |
|
6844 |
ret ); |
|
6845 |
} |
|
6846 |
else |
|
6847 |
{ |
|
6848 |
iMessageRouter->Complete( |
|
6849 |
ECustomGetSimAuthenticationDataIPC, |
|
6850 |
ret ); |
|
6851 |
} |
|
6852 |
} |
|
6853 |
||
6854 |
// ----------------------------------------------------------------------------- |
|
6855 |
// CMmCustomMessHandler::UiccCreateGBABootstrapNafDerivationApdu |
|
6856 |
// Constructs GBA security context AUTHENTICATE APDU (NAF derivation mode) |
|
6857 |
// ----------------------------------------------------------------------------- |
|
6858 |
// |
|
6859 |
void CMmCustomMessHandler::UiccCreateGBABootstrapNafDerivationApdu( |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6860 |
TUiccSendApdu& aParams, |
0 | 6861 |
const CMmDataPackage& aDataPackage ) |
6862 |
{ |
|
6863 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateGBABootstrapNafDerivationApdu.\n" ); |
|
6864 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATEGBABOOTSTRAPNAFDERIVATIONAPDU, "CMmCustomMessHandler::UiccCreateGBABootstrapNafDerivationApdu" ); |
|
6865 |
||
6866 |
RMmCustomAPI::TSimAuthenticationGbaNafDerivation gbaBootstrapNafDerivation; |
|
6867 |
aDataPackage.UnPackData( gbaBootstrapNafDerivation ); |
|
6868 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6869 |
// len of data is GBA NAF derivation mode tag (1 byte) + sizeof NAFId |
0 | 6870 |
// + sizeof IMPI + two length fields (one for NAFId len and one for IMPI len) |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6871 |
TUint8 lc( 1 + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6872 |
gbaBootstrapNafDerivation.iNafId.Size() + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6873 |
gbaBootstrapNafDerivation.iImpi.Size() + |
0 | 6874 |
2 ); |
6875 |
||
6876 |
aParams.trId = ETrIdEGbaNafDerivation; |
|
6877 |
aParams.apdu.Append( KClaNoSm ); // CLA |
|
6878 |
aParams.apdu.Append( KEvenInstructionCode ); // INS |
|
6879 |
aParams.apdu.Append( 0 ); // P1 is set to 0 in case of even instruction |
|
6880 |
aParams.apdu.Append( KGBAAuthenticationContext ); // P2 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6881 |
aParams.apdu.Append( lc ); // Lc |
0 | 6882 |
aParams.apdu.Append( KGBANAFDerivationModeTag ); // GBA bootstrapping mode tag |
6883 |
aParams.apdu.Append( gbaBootstrapNafDerivation.iNafId.Size() ); // len of NAFId |
|
6884 |
aParams.apdu.Append( gbaBootstrapNafDerivation.iNafId ); // NAFId |
|
6885 |
aParams.apdu.Append( gbaBootstrapNafDerivation.iImpi.Size() ); // len of IMPI |
|
6886 |
aParams.apdu.Append( gbaBootstrapNafDerivation.iImpi ); // IMPI |
|
6887 |
aParams.apdu.Append( KMaximumLenOfDataExpected ); // Le |
|
6888 |
} |
|
6889 |
||
6890 |
||
6891 |
// ----------------------------------------------------------------------------- |
|
6892 |
// CMmCustomMessHandler::UiccGBABootstrapNafDerivationApduResp |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6893 |
// Handles response APDU for GBA security context AUTHENTICATE APDU |
0 | 6894 |
// (NAF derivation mode) |
6895 |
// ----------------------------------------------------------------------------- |
|
6896 |
// |
|
6897 |
void CMmCustomMessHandler::UiccGBANafDerivationApduResp( |
|
6898 |
TInt aTraId, |
|
6899 |
TInt aStatus, |
|
6900 |
const TDesC8& aFileData ) |
|
6901 |
{ |
|
6902 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrapNafDerivationApduResp.\n" ); |
|
6903 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCGBANAFDERIVATIONAPDURESP, "CMmCustomMessHandler::UiccGBANafDerivationApduResp" ); |
|
6904 |
||
6905 |
TInt ret( KErrNone ); |
|
6906 |
RMmCustomAPI::TSimAuthenticationGbaNafDerivation gbaNafDerivation; |
|
6907 |
||
6908 |
if( UICC_STATUS_OK == aStatus ) |
|
6909 |
{ |
|
6910 |
// get SW1 and SW2 |
|
6911 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
6912 |
TUint8 sw2( aFileData[aFileData.Length() - KSw2Position] ); |
|
6913 |
||
6914 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
6915 |
||
6916 |
if( KNormalCommandEnding == result ) |
|
6917 |
{ |
|
6918 |
if( KApduOk == ValidateReceivedAuthenticateApdu( aTraId, aFileData ) ) |
|
6919 |
{ |
|
6920 |
// Let's skip "Successful GBA operation" tag |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6921 |
// and start with Length of Length of Ks ext NAF |
0 | 6922 |
TUint32 index( 1 ); |
6923 |
||
6924 |
// get the Ks ext NAF |
|
6925 |
TUint8 len( aFileData[index++] ); |
|
6926 |
gbaNafDerivation.iKsExtNaf.Copy( aFileData.Mid( index, len ) ); |
|
6927 |
} |
|
6928 |
else |
|
6929 |
{ |
|
6930 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrapNafDerivationApduResp: APDU validation failed\n" ); |
|
6931 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCGBANAFDERIVATIONAPDURESP, "CMmCustomMessHandler::UiccGBANafDerivationApduResp: APDU validation failed" ); |
|
6932 |
ret = KErrGeneral; |
|
6933 |
} |
|
6934 |
} |
|
6935 |
else if( KCmdNotAllowedConditionsNotSatisfied == result ) |
|
6936 |
{ |
|
6937 |
ret = KErrNotSupported; |
|
6938 |
} |
|
6939 |
else |
|
6940 |
{ |
|
6941 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccGBABootstrapNafDerivationApduResp: unknown result\n" ); |
|
6942 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_UICCGBANAFDERIVATIONAPDURESP, "CMmCustomMessHandler::UiccGBANafDerivationApduResp: unknown result" ); |
|
6943 |
ret = KErrGeneral; |
|
6944 |
} |
|
6945 |
} |
|
6946 |
else |
|
6947 |
{ |
|
6948 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccGBABootstrapNafDerivationApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
6949 |
OstTrace1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_UICCGBANAFDERIVATIONAPDURESP, "CMmCustomMessHandler::UiccGBANafDerivationApduResp: UICC status not ok: 0x%x", aStatus ); |
|
6950 |
ret = KErrMMEtelAuthenticateFailed; |
|
6951 |
} |
|
6952 |
||
6953 |
if( KErrNone == ret ) |
|
6954 |
{ |
|
6955 |
CMmDataPackage dataPackage; |
|
6956 |
dataPackage.PackData( &gbaNafDerivation ); |
|
6957 |
||
6958 |
iMessageRouter->Complete( |
|
6959 |
ECustomGetSimAuthenticationDataIPC, |
|
6960 |
&dataPackage, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6961 |
ret ); |
0 | 6962 |
} |
6963 |
else |
|
6964 |
{ |
|
6965 |
iMessageRouter->Complete( |
|
6966 |
ECustomGetSimAuthenticationDataIPC, |
|
6967 |
ret ); |
|
6968 |
} |
|
6969 |
} |
|
6970 |
||
6971 |
||
6972 |
// ----------------------------------------------------------------------------- |
|
6973 |
// CMmCustomMessHandler::UiccCreateMbmsMskUpdateApdu |
|
6974 |
// Constructs MBMS security context AUTHENTICATE APDU (MSK Update Mode) |
|
6975 |
// ----------------------------------------------------------------------------- |
|
6976 |
// |
|
6977 |
void CMmCustomMessHandler::UiccCreateMbmsMskUpdateApdu( |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6978 |
TUiccSendApdu& params, |
0 | 6979 |
const CMmDataPackage& aDataPackage ) |
6980 |
{ |
|
6981 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateMbmsMskUpdateApdu.\n" ); |
|
6982 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATEMBMSMSKUPDATEAPDU, "CMmCustomMessHandler::UiccCreateMbmsMskUpdateApdu" ); |
|
6983 |
||
6984 |
// Note. MBMS functionality is not tested in real hardware and in real environmen |
|
6985 |
// because of there is no users for this authentication type. So this is implemented |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
6986 |
// with the best knowledge at the moment and it can contain some bugs which |
0 | 6987 |
// can be found when this is tested in real environment. |
6988 |
||
6989 |
RMmCustomAPI::TSimAuthenticationMgvMskUpdate mskUpdate; |
|
6990 |
aDataPackage.UnPackData( mskUpdate ); |
|
6991 |
||
6992 |
// len of data is MBMS Data Object tag (1 byte) + |
|
6993 |
// MBMS Data Object length (1 byte) + |
|
6994 |
// MBMS Security Context Mode (1 byte) + size of Mikey |
|
6995 |
TUint8 lc( 1 + 1 + 1 + mskUpdate.iMikey.Size() ); |
|
6996 |
||
6997 |
params.trId = ETrIdEMbmsMskUpdate; |
|
6998 |
params.apdu.Append( KClaNoSm ); // CLA |
|
6999 |
params.apdu.Append( KOddInstructionCode ); // INS |
|
7000 |
params.apdu.Append( KFirstBlockOfAuthenticationData ); // P1 |
|
7001 |
params.apdu.Append( KMBMSAuthenticationContext ); // P2 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7002 |
params.apdu.Append( lc ); // Lc |
0 | 7003 |
params.apdu.Append( KMBMSDataObjectTag ); // MBMS Data object tag |
7004 |
params.apdu.Append( mskUpdate.iMikey.Size() + 1 ); // MBMS data obj len |
|
7005 |
params.apdu.Append( KMskUpdateMode ); // MBMS Security Context Mode |
|
7006 |
params.apdu.Append( mskUpdate.iMikey ); // Mikey |
|
7007 |
} |
|
7008 |
||
7009 |
||
7010 |
// ----------------------------------------------------------------------------- |
|
7011 |
// CMmCustomMessHandler::UiccMbmsMskUpdateApduResp |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7012 |
// Handles response APDU for MBMS security context AUTHENTICATE APDU |
0 | 7013 |
// (MSK Update Mode) |
7014 |
// ----------------------------------------------------------------------------- |
|
7015 |
// |
|
7016 |
void CMmCustomMessHandler::UiccMbmsMskUpdateApduResp( |
|
7017 |
TInt aStatus, |
|
7018 |
const TDesC8& aFileData ) |
|
7019 |
{ |
|
7020 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccMbmsMskUpdateApduResp.\n" ); |
|
7021 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCMBMSMSKUPDATEAPDURESP, "CMmCustomMessHandler::UiccMbmsMskUpdateApduResp" ); |
|
7022 |
||
7023 |
// Note. MBMS functionality is not tested in real hardware and in real environment |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7024 |
// because of at the moment there is no users for this authentication type. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7025 |
// So this is implemented with the best knowledge at the moment and it can contain |
0 | 7026 |
// some bugs which can be found when this is tested in real environment. |
7027 |
||
7028 |
TInt ret( KErrGeneral ); |
|
7029 |
RMmCustomAPI::TSimAuthenticationMgvMskUpdate mskUpdate; |
|
7030 |
TBool completeNeeded( ETrue ); |
|
7031 |
||
7032 |
if( UICC_STATUS_OK == aStatus ) |
|
7033 |
{ |
|
7034 |
// get SW1 and SW2 |
|
7035 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
7036 |
TUint8 sw2( aFileData[aFileData.Length() - KSw2Position] ); |
|
7037 |
||
7038 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
7039 |
||
7040 |
switch( result ) |
|
7041 |
{ |
|
7042 |
case KNormalCommandEnding: |
|
7043 |
case KWarningMoreDataAvailable: |
|
7044 |
{ |
|
7045 |
TBuf8<KMaxApduSize> mbmsOperationData; |
|
7046 |
||
7047 |
if( FindTlvObject( KMbmsOperationResponseTag53, aFileData.Mid( 0, aFileData.Length() - 2 ), mbmsOperationData ) || |
|
7048 |
FindTlvObject( KMbmsOperationResponseTag73, aFileData.Mid( 0, aFileData.Length() - 2 ), mbmsOperationData ) ) |
|
7049 |
{ |
|
7050 |
ret = KErrNone; |
|
7051 |
mskUpdate.iMikey.Zero(); |
|
7052 |
if( KSuccessfullMbmsOperationTag == mbmsOperationData[0] ) |
|
7053 |
{ |
|
7054 |
UiccMskUpdateHandleMbmsOperationData( mskUpdate, mbmsOperationData ); |
|
7055 |
} |
|
7056 |
else |
|
7057 |
{ |
|
7058 |
UiccMskUpdateHandleOMABcastOperationData( mskUpdate, mbmsOperationData ); |
|
7059 |
} |
|
7060 |
} |
|
7061 |
break; |
|
7062 |
} |
|
7063 |
case KWarningAuthRespAvailable: |
|
7064 |
{ |
|
7065 |
UiccCreateFirstBlockOfAuthRespApdu( ETrIdEMbmsMskUpdate ); |
|
7066 |
completeNeeded = EFalse; |
|
7067 |
break; |
|
7068 |
} |
|
7069 |
case KCmdNotAllowedConditionsNotSatisfied: |
|
7070 |
{ |
|
7071 |
ret = KErrCustomSCCondOfuseNotSatisfied; |
|
7072 |
break; |
|
7073 |
} |
|
7074 |
case KAppErrorAuthMbmsOutOfMemMuk: |
|
7075 |
{ |
|
7076 |
ret = KErrCustomSCNoMemSpaceAvailableMukAuthError; |
|
7077 |
break; |
|
7078 |
} |
|
7079 |
case KAppErrorAuthMbmsOutOfMemMsk: |
|
7080 |
{ |
|
7081 |
ret = KErrCustomSCNoMemSpaceAvailableAuthError; |
|
7082 |
break; |
|
7083 |
} |
|
7084 |
case KAppAuthErrorIncorrectMac: |
|
7085 |
{ |
|
7086 |
ret = KErrCustomSCIncorrectMACAuthError; |
|
7087 |
break; |
|
7088 |
} |
|
7089 |
case KWrongParametersDataNotFound: |
|
7090 |
{ |
|
7091 |
ret = KErrCustomSCRefDataNotFound; |
|
7092 |
break; |
|
7093 |
} |
|
7094 |
default: |
|
7095 |
{ |
|
7096 |
ret = KErrGeneral; |
|
7097 |
break; |
|
7098 |
} |
|
7099 |
} |
|
7100 |
} |
|
7101 |
else |
|
7102 |
{ |
|
7103 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccMbmsMskUpdateApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
7104 |
OstTrace1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCMBMSMSKUPDATEAPDURESP, "CMmCustomMessHandler::UiccMbmsMskUpdateApduResp: UICC status not ok: 0x%x", aStatus ); |
|
7105 |
ret = KErrMMEtelAuthenticateFailed; |
|
7106 |
} |
|
7107 |
||
7108 |
if( completeNeeded ) |
|
7109 |
{ |
|
7110 |
if( KErrNone == ret ) |
|
7111 |
{ |
|
7112 |
CMmDataPackage dataPackage; |
|
7113 |
dataPackage.PackData( &mskUpdate ); |
|
7114 |
||
7115 |
iMessageRouter->Complete( |
|
7116 |
ECustomGetSimAuthenticationDataIPC, |
|
7117 |
&dataPackage, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7118 |
ret ); |
0 | 7119 |
} |
7120 |
else |
|
7121 |
{ |
|
7122 |
iMessageRouter->Complete( |
|
7123 |
ECustomGetSimAuthenticationDataIPC, |
|
7124 |
ret ); |
|
7125 |
} |
|
7126 |
} |
|
7127 |
} |
|
7128 |
||
7129 |
||
7130 |
// ----------------------------------------------------------------------------- |
|
7131 |
// CMmCustomMessHandler::UiccMskUpdateHandleMbmsOperationData |
|
7132 |
// Handles MBMS operation data from MSK Update authenticate APDU |
|
7133 |
// ----------------------------------------------------------------------------- |
|
7134 |
// |
|
7135 |
void CMmCustomMessHandler::UiccMskUpdateHandleMbmsOperationData( |
|
7136 |
RMmCustomAPI::TSimAuthenticationMgvMskUpdate& aMskUpdate, |
|
7137 |
TDesC8& aMbmsData ) |
|
7138 |
{ |
|
7139 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccMskUpdateHandleMbmsOperationData.\n" ); |
|
7140 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCMSKUPDATEHANDLEMBMSOPERATIONDATA, "CMmCustomMessHandler::UiccMskUpdateHandleMbmsOperationData" ); |
|
7141 |
||
7142 |
TUint8 index( 0 ); |
|
7143 |
TUint32 objLen( aMbmsData.Length() ); |
|
7144 |
||
7145 |
if( KSuccessfullMbmsOperationTag == aMbmsData[index] && |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7146 |
1 <= objLen && |
0 | 7147 |
( KMaxMbmsMikeyLen + 1 ) >= objLen ) // + 1 for 0xDB TLV tag |
7148 |
{ |
|
7149 |
index++; |
|
7150 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7151 |
// len of MIKEY is obj len - 1 because of |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7152 |
// obj data contains 1 byte for |
0 | 7153 |
// Successfull Mbms Operation Tag |
7154 |
TUint8 mikeyLen = objLen - 1; |
|
7155 |
if( 0 < mikeyLen ) |
|
7156 |
{ |
|
7157 |
aMskUpdate.iMikey.Copy( aMbmsData.Mid( index, mikeyLen ) ); |
|
7158 |
} |
|
7159 |
} |
|
7160 |
} |
|
7161 |
||
7162 |
||
7163 |
// ----------------------------------------------------------------------------- |
|
7164 |
// CMmCustomMessHandler::UiccMskUpdateHandleMbmsOperationData |
|
7165 |
// Handles OMA BCAST operation data from authenticate APDU |
|
7166 |
// ----------------------------------------------------------------------------- |
|
7167 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7168 |
void CMmCustomMessHandler::UiccMskUpdateHandleOMABcastOperationData( |
0 | 7169 |
RMmCustomAPI::TSimAuthenticationMgvMskUpdate& aMskUpdate, |
7170 |
TDesC8& aMbmsData ) |
|
7171 |
{ |
|
7172 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccMskUpdateHandleOMABcastOperationData.\n" ); |
|
7173 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCMSKUPDATEHANDLEOMABCASTOPERATIONDATA, "CMmCustomMessHandler::UiccMskUpdateHandleOMABcastOperationData" ); |
|
7174 |
||
7175 |
TBuf8<KMaxApduSize> omaBcastData; |
|
7176 |
||
7177 |
if( FindTlvObject( KOMABcastOperationResponseTag, aMbmsData, omaBcastData ) ) |
|
7178 |
{ |
|
7179 |
TBuf8<KMaxApduSize> bcastManagementData; |
|
7180 |
TBuf8<KMaxParentalRatingDataSize> parentalRatingData; |
|
7181 |
TBuf8<KMaxSpeSize> speTypeNotSupportedData; |
|
7182 |
TBuf8<KMaxApduSize> mikeyData; |
|
7183 |
||
7184 |
if( FindTlvObject( KBcastManagementDataTag, omaBcastData, bcastManagementData ) ) |
|
7185 |
{ |
|
7186 |
aMskUpdate.iBCASTManagement.Copy( bcastManagementData ); |
|
7187 |
} |
|
7188 |
if( FindTlvObject( KParentalRatingDataTag, omaBcastData, parentalRatingData ) ) |
|
7189 |
{ |
|
7190 |
aMskUpdate.iParentalRating.Copy( parentalRatingData ); |
|
7191 |
} |
|
7192 |
if( FindTlvObject( KSPETypeNotSupportedTag, omaBcastData, speTypeNotSupportedData ) ) |
|
7193 |
{ |
|
7194 |
aMskUpdate.iSecurityPolicyExt.Copy( speTypeNotSupportedData ); |
|
7195 |
} |
|
7196 |
||
7197 |
if( FindTlvObject( KMikeyMessageTag, omaBcastData, mikeyData ) ) |
|
7198 |
{ |
|
7199 |
aMskUpdate.iMikey.Copy( mikeyData ); |
|
7200 |
} |
|
7201 |
} |
|
7202 |
} |
|
7203 |
||
7204 |
||
7205 |
// ----------------------------------------------------------------------------- |
|
7206 |
// CMmCustomMessHandler::UiccCreateMbmsMtkGenerationApdu |
|
7207 |
// Constructs MBMS security context AUTHENTICATE APDU (MTK Generation Mode) |
|
7208 |
// ----------------------------------------------------------------------------- |
|
7209 |
// |
|
7210 |
void CMmCustomMessHandler::UiccCreateMbmsMtkGenerationApdu( |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7211 |
TUiccSendApdu& params, |
0 | 7212 |
const CMmDataPackage& aDataPackage ) |
7213 |
{ |
|
7214 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateMbmsMtkGenerationApdu.\n" ); |
|
7215 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATEMBMSMTKGENERATIONAPDU, "CMmCustomMessHandler::UiccCreateMbmsMtkGenerationApdu" ); |
|
7216 |
||
7217 |
// Note. MBMS functionality is not tested in real hardware and in real environment |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7218 |
// because of at the moment there is no users for this authentication type. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7219 |
// So this is implemented with the best knowledge at the moment and it can contain |
0 | 7220 |
// some bugs which can be found when this is tested in real environment. |
7221 |
||
7222 |
RMmCustomAPI::TSimAuthenticationMgvMtkGeneration mtkGen; |
|
7223 |
aDataPackage.UnPackData( mtkGen ); |
|
7224 |
||
7225 |
// len of data is MBMS Data Object tag (1 byte) + |
|
7226 |
// MBMS Data Object length (1 byte) + |
|
7227 |
// MBMS Security Context Mode (1 byte) + size of Mikey |
|
7228 |
TUint8 lc( 1 + 1 + 1 + mtkGen.iMikey.Size() ); |
|
7229 |
||
7230 |
params.trId = ETrIdEMbmsMtkGeneration; |
|
7231 |
params.apdu.Append( KClaNoSm ); // CLA |
|
7232 |
params.apdu.Append( KOddInstructionCode ); // INS |
|
7233 |
params.apdu.Append( KFirstBlockOfAuthenticationData ); // P1 |
|
7234 |
params.apdu.Append( KMBMSAuthenticationContext ); // P2 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7235 |
params.apdu.Append( lc ); // Lc |
0 | 7236 |
params.apdu.Append( KMBMSDataObjectTag ); // MBMS Data object tag |
7237 |
params.apdu.Append( mtkGen.iMikey.Size() + 1 ); // MBMS data obj len |
|
7238 |
params.apdu.Append( KMtkGenerationMode ); // MBMS Security Context Mode |
|
7239 |
params.apdu.Append( mtkGen.iMikey ); // Mikey |
|
7240 |
} |
|
7241 |
||
7242 |
||
7243 |
// ----------------------------------------------------------------------------- |
|
7244 |
// CMmCustomMessHandler::UiccMbmsMtkGenerationApduResp |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7245 |
// Handles response APDU for MBMS security context AUTHENTICATE APDU |
0 | 7246 |
// (MTK Generation Mode) |
7247 |
// ----------------------------------------------------------------------------- |
|
7248 |
// |
|
7249 |
void CMmCustomMessHandler::UiccMbmsMtkGenerationApduResp( |
|
7250 |
TInt aStatus, |
|
7251 |
const TDesC8& aFileData ) |
|
7252 |
{ |
|
7253 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccMbmsMtkGenerationApduResp.\n" ); |
|
7254 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCMBMSMTKGENERATIONAPDURESP, "CMmCustomMessHandler::UiccMbmsMtkGenerationApduResp" ); |
|
7255 |
||
7256 |
// Note. MBMS functionality is not tested in real hardware and in real environment |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7257 |
// because of at the moment there is no users for this authentication type. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7258 |
// So this is implemented with the best knowledge at the moment and it can contain |
0 | 7259 |
// some bugs which can be found when this is tested in real environment. |
7260 |
||
7261 |
TInt ret( KErrGeneral ); |
|
7262 |
RMmCustomAPI::TSimAuthenticationMgvMtkGeneration mtkGen; |
|
7263 |
TBool completeNeeded( ETrue ); |
|
7264 |
||
7265 |
if( UICC_STATUS_OK == aStatus ) |
|
7266 |
{ |
|
7267 |
// get SW1 and SW2 |
|
7268 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
7269 |
TUint8 sw2( aFileData[aFileData.Length() - KSw2Position] ); |
|
7270 |
||
7271 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
7272 |
||
7273 |
switch( result ) |
|
7274 |
{ |
|
7275 |
case KNormalCommandEnding: |
|
7276 |
case KWarningMoreDataAvailable: |
|
7277 |
{ |
|
7278 |
TBuf8<KMaxApduSize> mbmsOperationData; |
|
7279 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7280 |
if( FindTlvObject( KMbmsOperationResponseTag53, aFileData.Mid( 0, aFileData.Length() - 2 ), mbmsOperationData ) || |
0 | 7281 |
FindTlvObject( KMbmsOperationResponseTag73, aFileData.Mid( 0, aFileData.Length() - 2 ), mbmsOperationData ) ) |
7282 |
{ |
|
7283 |
ret = KErrNone; |
|
7284 |
if( KSuccessfullMbmsOperationTag == mbmsOperationData[0] ) |
|
7285 |
{ |
|
7286 |
UiccMtkGenHandleMbmsOperationData( mtkGen, mbmsOperationData ); |
|
7287 |
} |
|
7288 |
else |
|
7289 |
{ |
|
7290 |
UiccMtkGenHandleOMABcastOperationData( mtkGen, mbmsOperationData ); |
|
7291 |
} |
|
7292 |
} |
|
7293 |
break; |
|
7294 |
} |
|
7295 |
case KWarningAuthRespAvailable: |
|
7296 |
{ |
|
7297 |
UiccCreateFirstBlockOfAuthRespApdu( ETrIdEMbmsMtkGeneration ); |
|
7298 |
completeNeeded = EFalse; |
|
7299 |
break; |
|
7300 |
} |
|
7301 |
case KCmdNotAllowedConditionsNotSatisfied: |
|
7302 |
{ |
|
7303 |
ret = KErrCustomSCCondOfuseNotSatisfied; |
|
7304 |
break; |
|
7305 |
} |
|
7306 |
case KAppErrorAuthMbmsKeyFresh: |
|
7307 |
{ |
|
7308 |
ret = KErrCustomSCKeyRefreshFail; |
|
7309 |
break; |
|
7310 |
} |
|
7311 |
case KAppAuthErrorIncorrectMac: |
|
7312 |
{ |
|
7313 |
ret = KErrCustomSCIncorrectMACAuthError; |
|
7314 |
break; |
|
7315 |
} |
|
7316 |
case KWrongParametersDataNotFound: |
|
7317 |
{ |
|
7318 |
ret = KErrCustomSCRefDataNotFound; |
|
7319 |
break; |
|
7320 |
} |
|
7321 |
default: |
|
7322 |
{ |
|
7323 |
ret = KErrGeneral; |
|
7324 |
break; |
|
7325 |
} |
|
7326 |
} |
|
7327 |
} |
|
7328 |
else |
|
7329 |
{ |
|
7330 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccMbmsMtkGenerationApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
7331 |
OstTrace1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCMBMSMTKGENERATIONAPDURESP, "CMmCustomMessHandler::UiccMbmsMtkGenerationApduResp: UICC status not ok: 0x%x", aStatus ); |
|
7332 |
ret = KErrMMEtelAuthenticateFailed; |
|
7333 |
} |
|
7334 |
||
7335 |
if( completeNeeded ) |
|
7336 |
{ |
|
7337 |
if( KErrNone == ret ) |
|
7338 |
{ |
|
7339 |
CMmDataPackage dataPackage; |
|
7340 |
dataPackage.PackData( &mtkGen ); |
|
7341 |
||
7342 |
iMessageRouter->Complete( |
|
7343 |
ECustomGetSimAuthenticationDataIPC, |
|
7344 |
&dataPackage, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7345 |
ret ); |
0 | 7346 |
} |
7347 |
else |
|
7348 |
{ |
|
7349 |
iMessageRouter->Complete( |
|
7350 |
ECustomGetSimAuthenticationDataIPC, |
|
7351 |
ret ); |
|
7352 |
} |
|
7353 |
} |
|
7354 |
} |
|
7355 |
||
7356 |
||
7357 |
// ----------------------------------------------------------------------------- |
|
7358 |
// CMmCustomMessHandler::UiccMtkGenHandleMbmsOperationData |
|
7359 |
// Handles MBMS operation data from MTK Generation authenticate APDU |
|
7360 |
// ----------------------------------------------------------------------------- |
|
7361 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7362 |
void CMmCustomMessHandler::UiccMtkGenHandleMbmsOperationData( |
0 | 7363 |
RMmCustomAPI::TSimAuthenticationMgvMtkGeneration& aMtkGen, |
7364 |
TDesC8& aMbmsData ) |
|
7365 |
{ |
|
7366 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccMtkGenHandleMbmsOperationData.\n" ); |
|
7367 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCMTKGENHANDLEMBMSOPERATIONDATA, "CMmCustomMessHandler::UiccMtkGenHandleMbmsOperationData" ); |
|
7368 |
||
7369 |
TUint8 index( 0 ); |
|
7370 |
TUint32 objLen( aMbmsData.Length() ); |
|
7371 |
||
7372 |
if( KSuccessfullMbmsOperationTag == aMbmsData[index] && |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7373 |
1 <= objLen && |
0 | 7374 |
( KMaxMbmsSaltLen + 1 ) >= objLen ) // + 1 for 0xDB TLV tag |
7375 |
{ |
|
7376 |
index++; |
|
7377 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7378 |
// len of SALT is obj len - 1 because of |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7379 |
// obj data contains 1 byte for |
0 | 7380 |
// Successfull Mbms Operation Tag |
7381 |
TUint8 saltLen( objLen - 1 ); |
|
7382 |
if( 0 < saltLen ) |
|
7383 |
{ |
|
7384 |
aMtkGen.iMtkSalt.Copy( aMbmsData.Mid( index, saltLen ) ); |
|
7385 |
} |
|
7386 |
} |
|
7387 |
} |
|
7388 |
||
7389 |
||
7390 |
// ----------------------------------------------------------------------------- |
|
7391 |
// CMmCustomMessHandler::UiccMtkGenHandleOMABcastOperationData |
|
7392 |
// Handles OMA BCAST operation data from authenticate APDU |
|
7393 |
// ----------------------------------------------------------------------------- |
|
7394 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7395 |
void CMmCustomMessHandler::UiccMtkGenHandleOMABcastOperationData( |
0 | 7396 |
RMmCustomAPI::TSimAuthenticationMgvMtkGeneration& aMtkGen, |
7397 |
TDesC8& aMbmsData ) |
|
7398 |
{ |
|
7399 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccMtkGenHandleOMABcastOperationData.\n" ); |
|
7400 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCMTKGENHANDLEOMABCASTOPERATIONDATA, "CMmCustomMessHandler::UiccMtkGenHandleOMABcastOperationData" ); |
|
7401 |
||
7402 |
TBuf8<KMaxApduSize> omaBcastData; |
|
7403 |
||
7404 |
if( FindTlvObject( KOMABcastOperationResponseTag, aMbmsData, omaBcastData ) ) |
|
7405 |
{ |
|
7406 |
TBuf8<KMaxApduSize> bcastManagementData; |
|
7407 |
TBuf8<KMaxApduSize> tekData; |
|
7408 |
TBuf8<KMaxApduSize> saltData; |
|
7409 |
TBuf8<KMaxApduSize> parentalControlData; |
|
7410 |
||
7411 |
if( FindTlvObject( KBcastManagementDataTag, omaBcastData, bcastManagementData ) ) |
|
7412 |
{ |
|
7413 |
aMtkGen.iBCASTManagement.Copy( bcastManagementData ); |
|
7414 |
} |
|
7415 |
if( FindTlvObject( KTekDataTag, omaBcastData, tekData ) ) |
|
7416 |
{ |
|
7417 |
aMtkGen.iTrafficEncryptionKey.Copy( tekData ); |
|
7418 |
} |
|
7419 |
if( FindTlvObject( KParentalControlTag, omaBcastData, parentalControlData ) ) |
|
7420 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7421 |
// first parameter of parental control data is "key reference for second |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7422 |
// application PIN defined for parental contol" but it's not supported |
0 | 7423 |
// at the moment |
7424 |
aMtkGen.iParentalControl.Append( parentalControlData[1] ); // rating type |
|
7425 |
aMtkGen.iParentalControl.Append( parentalControlData[2] ); // rating value |
|
7426 |
aMtkGen.iParentalControl.Append( parentalControlData[3] ); // level granted value |
|
7427 |
} |
|
7428 |
if( FindTlvObject( KSaltDataTag, omaBcastData, saltData ) ) |
|
7429 |
{ |
|
7430 |
aMtkGen.iMtkSalt.Copy( saltData ); |
|
7431 |
} |
|
7432 |
} |
|
7433 |
} |
|
7434 |
||
7435 |
||
7436 |
// ----------------------------------------------------------------------------- |
|
7437 |
// CMmCustomMessHandler::UiccCreateMbmsMskDeletionApdu |
|
7438 |
// Constructs MBMS security context AUTHENTICATE APDU (MSK Deletion Mode) |
|
7439 |
// ----------------------------------------------------------------------------- |
|
7440 |
// |
|
7441 |
void CMmCustomMessHandler::UiccCreateMbmsMskDeletionApdu( |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7442 |
TUiccSendApdu& params, |
0 | 7443 |
const CMmDataPackage& aDataPackage ) |
7444 |
{ |
|
7445 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateMbmsMskDeletionApdu.\n" ); |
|
7446 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATEMBMSMSKDELETIONAPDU, "CMmCustomMessHandler::UiccCreateMbmsMskDeletionApdu" ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7447 |
|
0 | 7448 |
// Note. MBMS functionality is not tested in real hardware and in real environment |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7449 |
// because of at the moment there is no users for this authentication type. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7450 |
// So this is implemented with the best knowledge at the moment and it can contain |
0 | 7451 |
// some bugs which can be found when this is tested in real environment. |
7452 |
||
7453 |
RMmCustomAPI::TSimAuthenticationMgvMskDeletion mskDel; |
|
7454 |
aDataPackage.UnPackData( mskDel ); |
|
7455 |
||
7456 |
// len of data is MBMS Data Object tag (1 byte) + |
|
7457 |
// MBMS Data Object length (1 byte) + |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7458 |
// MBMS Security Context Mode (1 byte) + |
0 | 7459 |
// size of Key Domain Id + size of Key Group Id Part |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7460 |
TUint8 lc( 1 + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7461 |
1 + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7462 |
1 + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7463 |
mskDel.iKeyDomainId.Size() + |
0 | 7464 |
mskDel.iKeyGroupIdPart.Size() ); |
7465 |
||
7466 |
// data size in MBMS Data Object Tag is: |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7467 |
// MBMS Security Context Mode (1 byte) + |
0 | 7468 |
// size of Key Domain Id + size of Key Group Id Part |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7469 |
TUint8 dataSize( 1 + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7470 |
mskDel.iKeyDomainId.Size() + |
0 | 7471 |
mskDel.iKeyGroupIdPart.Size() ); |
7472 |
||
7473 |
params.trId = ETrIdEMbmsMskDeletion; |
|
7474 |
params.apdu.Append( KClaNoSm ); // CLA |
|
7475 |
params.apdu.Append( KOddInstructionCode ); // INS |
|
7476 |
params.apdu.Append( KFirstBlockOfAuthenticationData ); // P1 |
|
7477 |
params.apdu.Append( KMBMSAuthenticationContext ); // P2 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7478 |
params.apdu.Append( lc ); // Lc |
0 | 7479 |
params.apdu.Append( KMBMSDataObjectTag ); // MBMS Data object tag |
7480 |
params.apdu.Append( dataSize ); // MBMS data obj len |
|
7481 |
params.apdu.Append( KMskDeletionMode ); // MBMS Security Context Mode |
|
7482 |
params.apdu.Append( mskDel.iKeyDomainId ); // Key Domain Id |
|
7483 |
params.apdu.Append( mskDel.iKeyGroupIdPart ); // Key Group Id |
|
7484 |
} |
|
7485 |
||
7486 |
||
7487 |
// ----------------------------------------------------------------------------- |
|
7488 |
// CMmCustomMessHandler::UiccMbmsMskDeletionApduResp |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7489 |
// Handles response APDU for MBMS security context AUTHENTICATE APDU |
0 | 7490 |
// (MSK Deletion Mode) |
7491 |
// ----------------------------------------------------------------------------- |
|
7492 |
// |
|
7493 |
void CMmCustomMessHandler::UiccMbmsMskDeletionApduResp( |
|
7494 |
TInt aStatus, |
|
7495 |
const TDesC8& aFileData ) |
|
7496 |
{ |
|
7497 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccMbmsMskDeletionApduResp.\n" ); |
|
7498 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCMBMSMSKDELETIONAPDURESP, "CMmCustomMessHandler::UiccMbmsMskDeletionApduResp" ); |
|
7499 |
||
7500 |
// Note. MBMS functionality is not tested in real hardware and in real environment |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7501 |
// because of at the moment there is no users for this authentication type. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7502 |
// So this is implemented with the best knowledge at the moment and it can contain |
0 | 7503 |
// some bugs which can be found when this is tested in real environment. |
7504 |
||
7505 |
TInt ret( KErrGeneral ); |
|
7506 |
RMmCustomAPI::TSimAuthenticationMgvMskDeletion mskDel; |
|
7507 |
TBool completeNeeded( ETrue ); |
|
7508 |
||
7509 |
if( UICC_STATUS_OK == aStatus ) |
|
7510 |
{ |
|
7511 |
// get SW1 and SW2 |
|
7512 |
TUint8 sw1( aFileData[aFileData.Length() - KSw1Position] ); |
|
7513 |
TUint8 sw2(aFileData[aFileData.Length() - KSw2Position] ); |
|
7514 |
||
7515 |
TUint8 result( MapSw1Sw2ToAuthenticateResult( sw1, sw2 ) ); |
|
7516 |
||
7517 |
switch( result ) |
|
7518 |
{ |
|
7519 |
case KNormalCommandEnding: |
|
7520 |
{ |
|
7521 |
TBuf8<KMaxApduSize> mbmsOperationData; |
|
7522 |
||
7523 |
if( FindTlvObject( KMbmsOperationResponseTag53, aFileData.Mid( 0, aFileData.Length() - 2 ), mbmsOperationData ) ) |
|
7524 |
{ |
|
7525 |
if( KSuccessfullMbmsOperationTag == mbmsOperationData[0] ) |
|
7526 |
{ |
|
7527 |
ret = KErrNone; |
|
7528 |
} |
|
7529 |
} |
|
7530 |
break; |
|
7531 |
} |
|
7532 |
case KWarningAuthRespAvailable: |
|
7533 |
{ |
|
7534 |
UiccCreateFirstBlockOfAuthRespApdu( ETrIdEMbmsMskDeletion ); |
|
7535 |
completeNeeded = EFalse; |
|
7536 |
break; |
|
7537 |
} |
|
7538 |
case KWrongParametersDataNotFound: |
|
7539 |
{ |
|
7540 |
ret = KErrCustomSCRefDataNotFound; |
|
7541 |
break; |
|
7542 |
} |
|
7543 |
default: |
|
7544 |
{ |
|
7545 |
ret = KErrGeneral; |
|
7546 |
break; |
|
7547 |
} |
|
7548 |
} |
|
7549 |
} |
|
7550 |
else |
|
7551 |
{ |
|
7552 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::UiccMbmsMskDeletionApduResp: UICC status not ok: 0x%x\n", aStatus ); |
|
7553 |
OstTrace1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_UICCMBMSMSKDELETIONAPDURESP, "CMmCustomMessHandler::UiccMbmsMskDeletionApduResp: UICC status not ok: 0x%x", aStatus ); |
|
7554 |
ret = KErrMMEtelAuthenticateFailed; |
|
7555 |
} |
|
7556 |
||
7557 |
if( completeNeeded ) |
|
7558 |
{ |
|
7559 |
if( KErrNone == ret ) |
|
7560 |
{ |
|
7561 |
CMmDataPackage dataPackage; |
|
7562 |
dataPackage.PackData( &mskDel ); |
|
7563 |
||
7564 |
iMessageRouter->Complete( |
|
7565 |
ECustomGetSimAuthenticationDataIPC, |
|
7566 |
&dataPackage, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7567 |
ret ); |
0 | 7568 |
} |
7569 |
else |
|
7570 |
{ |
|
7571 |
iMessageRouter->Complete( |
|
7572 |
ECustomGetSimAuthenticationDataIPC, |
|
7573 |
ret ); |
|
7574 |
} |
|
7575 |
} |
|
7576 |
} |
|
7577 |
||
7578 |
||
7579 |
// ----------------------------------------------------------------------------- |
|
7580 |
// CMmCustomMessHandler::UiccCreateFirstBlockOfAuthRespApdu |
|
7581 |
// Constructs APDU to get authenticate response data in case of odd ins code |
|
7582 |
// ----------------------------------------------------------------------------- |
|
7583 |
// |
|
7584 |
void CMmCustomMessHandler::UiccCreateFirstBlockOfAuthRespApdu( TUiccTrId aTrId ) |
|
7585 |
{ |
|
7586 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccCreateFirstBlockOfAuthRespApdu.\n" ); |
|
7587 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCCREATEFIRSTBLOCKOFAUTHRESPAPDU, "CMmCustomMessHandler::UiccCreateFirstBlockOfAuthRespApdu" ); |
|
7588 |
||
7589 |
// Fill parameters to instance created from TUiccSendApdu |
|
7590 |
// needed for APDU sending |
|
7591 |
TUiccSendApdu params; |
|
7592 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
7593 |
params.serviceType = UICC_APPL_APDU_SEND; |
|
7594 |
params.fileId = UICC_EF_ID_NOT_PRESENT; |
|
7595 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
7596 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
7597 |
params.filePath.Append( KMasterFileId ); |
|
7598 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
7599 |
||
7600 |
params.trId = aTrId; |
|
7601 |
params.apdu.Append( KClaNoSm ); // CLA |
|
7602 |
params.apdu.Append( KOddInstructionCode ); // INS |
|
7603 |
params.apdu.Append( KFirstBlockOfAuthenticationResponseData ); // P1 |
|
7604 |
params.apdu.Append( 0x00 ); // P2 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7605 |
params.apdu.Append( 0x00 ); // Le |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7606 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7607 |
iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
0 | 7608 |
} |
7609 |
||
7610 |
||
7611 |
// ----------------------------------------------------------------------------- |
|
7612 |
// CMmCustomMessHandler::MapSw1Sw2ToAuthenticateResult |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7613 |
// Maps sw1 and sw2 from response authenticate apdu to result |
0 | 7614 |
// ----------------------------------------------------------------------------- |
7615 |
// |
|
7616 |
TUint8 CMmCustomMessHandler::MapSw1Sw2ToAuthenticateResult( TUint8 sw1, TUint8 sw2 ) |
|
7617 |
{ |
|
7618 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::MapSw1Sw2ToAuthenticateResult. sw1: 0x%x sw2: 0x%x\n", sw1, sw2 ); |
|
7619 |
OstTraceExt2( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_MAPSW1SW2TOAUTHENTICATERESULT, "CMmCustomMessHandler::MapSw1Sw2ToAuthenticateResult. sw1: 0x%x sw2: 0x%x", sw1, sw2 ); |
|
7620 |
||
7621 |
TUint8 ret( KUnknownCommandEnding ); |
|
7622 |
||
7623 |
switch( sw1 ) |
|
7624 |
{ |
|
7625 |
case 0x90: |
|
7626 |
{ |
|
7627 |
if( 0x00 == sw2 ) |
|
7628 |
{ |
|
7629 |
ret = KNormalCommandEnding; |
|
7630 |
} |
|
7631 |
break; |
|
7632 |
} |
|
7633 |
case 0x62: |
|
7634 |
{ |
|
7635 |
if( 0x00 == sw2 ) |
|
7636 |
{ |
|
7637 |
ret = KNormalCommandEnding; |
|
7638 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7639 |
else if( 0xF1 == sw2 || |
0 | 7640 |
0xF2 == sw2 ) |
7641 |
{ |
|
7642 |
ret = KWarningMoreDataAvailable; |
|
7643 |
} |
|
7644 |
else if( 0xF3 == sw2 ) |
|
7645 |
{ |
|
7646 |
ret = KWarningAuthRespAvailable; |
|
7647 |
} |
|
7648 |
break; |
|
7649 |
} |
|
7650 |
case 0x91: |
|
7651 |
{ |
|
7652 |
ret = KNormalCommandEnding; |
|
7653 |
break; |
|
7654 |
} |
|
7655 |
case 0x98: |
|
7656 |
{ |
|
7657 |
if( 0x62 == sw2 ) |
|
7658 |
{ |
|
7659 |
ret = KAppAuthErrorIncorrectMac; |
|
7660 |
} |
|
7661 |
else if( 0x65 == sw2 ) |
|
7662 |
{ |
|
7663 |
ret = KAppErrorAuthMbmsKeyFresh; |
|
7664 |
} |
|
7665 |
else if( 0x66 == sw2 ) |
|
7666 |
{ |
|
7667 |
ret = KAppErrorAuthMbmsOutOfMemMsk; |
|
7668 |
} |
|
7669 |
else if( 0x67 == sw2 ) |
|
7670 |
{ |
|
7671 |
ret = KAppErrorAuthMbmsOutOfMemMuk; |
|
7672 |
} |
|
7673 |
break; |
|
7674 |
} |
|
7675 |
case 0x69: |
|
7676 |
{ |
|
7677 |
if( 0x82 == sw2 ) |
|
7678 |
{ |
|
7679 |
ret = KCmdNotAllowedSecurityStatusNotSatisfied; |
|
7680 |
} |
|
7681 |
else if( 0x85 == sw2 ) |
|
7682 |
{ |
|
7683 |
ret = KCmdNotAllowedConditionsNotSatisfied; |
|
7684 |
} |
|
7685 |
break; |
|
7686 |
} |
|
7687 |
case 0x6A: |
|
7688 |
{ |
|
7689 |
if( 0x88 == sw2 ) |
|
7690 |
{ |
|
7691 |
ret = KWrongParametersDataNotFound; |
|
7692 |
} |
|
7693 |
break; |
|
7694 |
} |
|
7695 |
default: |
|
7696 |
{ |
|
7697 |
break; |
|
7698 |
} |
|
7699 |
} |
|
7700 |
||
7701 |
return ret; |
|
7702 |
} |
|
7703 |
||
7704 |
||
7705 |
// ----------------------------------------------------------------------------- |
|
7706 |
// CMmCustomMessHandler::ValidateReceivedAuthenticateApdu |
|
7707 |
// Validates received apdu |
|
7708 |
// ----------------------------------------------------------------------------- |
|
7709 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7710 |
TUint8 CMmCustomMessHandler::ValidateReceivedAuthenticateApdu( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7711 |
TInt aTraId, |
0 | 7712 |
const TDesC8& aApdu ) |
7713 |
{ |
|
7714 |
TUint8 ret( KApduOk ); |
|
7715 |
||
7716 |
switch( aTraId ) |
|
7717 |
{ |
|
7718 |
case ETrIdEEapSimAuthenticate: |
|
7719 |
{ |
|
7720 |
ret = ValidateGsmSecurityContextApduResp( aApdu ); |
|
7721 |
break; |
|
7722 |
} |
|
7723 |
case ETrIdEEapAkaAuthenticate: |
|
7724 |
case ETrIdEEapAkaAuthenticateIms: |
|
7725 |
{ |
|
7726 |
ret = Validate3GSecurityContextApduResp( aApdu ); |
|
7727 |
break; |
|
7728 |
} |
|
7729 |
case ETrIdEGbaBootstrap: |
|
7730 |
{ |
|
7731 |
ret = ValidateGBABootstrappingApduResp( aApdu ); |
|
7732 |
break; |
|
7733 |
} |
|
7734 |
case ETrIdEGbaNafDerivation: |
|
7735 |
{ |
|
7736 |
ret = ValidateGBANafDerivationApduResp( aApdu ); |
|
7737 |
break; |
|
7738 |
} |
|
7739 |
case ETrIdRunGsmAlgorithmSim: |
|
7740 |
case ETrIdRunGsmAlgorithmAka: |
|
7741 |
case ETrIdRunGsmAlgorithmIms: |
|
7742 |
{ |
|
7743 |
ret = ValidateRunGsmAlgorithmApduResp( aApdu ); |
|
7744 |
break; |
|
7745 |
} |
|
7746 |
default: |
|
7747 |
{ |
|
7748 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ValidateReceivedAuthenticateApdu: unknown APDU\n" ); |
|
7749 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_VALIDATERECEIVEDAUTHENTICATEAPDU, "CMmCustomMessHandler::ValidateReceivedAuthenticateApdu: unknown APDU" ); |
|
7750 |
ret = KApduNok; |
|
7751 |
break; |
|
7752 |
} |
|
7753 |
} |
|
7754 |
return ret; |
|
7755 |
} |
|
7756 |
||
7757 |
// ----------------------------------------------------------------------------- |
|
7758 |
// CMmCustomMessHandler::ValidateGsmSecurityContextApduResp |
|
7759 |
// Validates received apdu |
|
7760 |
// ----------------------------------------------------------------------------- |
|
7761 |
// |
|
7762 |
TUint8 CMmCustomMessHandler::ValidateGsmSecurityContextApduResp( const TDesC8& aApdu ) |
|
7763 |
{ |
|
7764 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ValidateGsmSecurityContextApduResp.\n" ); |
|
7765 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_VALIDATEGSMSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::ValidateGsmSecurityContextApduResp" ); |
|
7766 |
TUint8 ret( KApduNok ); |
|
7767 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7768 |
// apdu len is len of aApdu - 2 (because of |
0 | 7769 |
// aApdu contains sw1 and sw2) |
7770 |
TUint apduLen( aApdu.Length() - 2 ); |
|
7771 |
TUint32 index( 0 ); |
|
7772 |
||
7773 |
index += aApdu[index] + 1; |
|
7774 |
TUint8 lenOfKc = aApdu[index++]; |
|
7775 |
||
7776 |
if( KLenOfKc == lenOfKc && index + lenOfKc == apduLen ) |
|
7777 |
{ |
|
7778 |
ret = KApduOk; |
|
7779 |
} |
|
7780 |
||
7781 |
return ret; |
|
7782 |
} |
|
7783 |
||
7784 |
// ----------------------------------------------------------------------------- |
|
7785 |
// CMmCustomMessHandler::Validate3GSecurityContextApduResp |
|
7786 |
// Validates received apdu |
|
7787 |
// ----------------------------------------------------------------------------- |
|
7788 |
// |
|
7789 |
TUint8 CMmCustomMessHandler::Validate3GSecurityContextApduResp( const TDesC8& aApdu ) |
|
7790 |
{ |
|
7791 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp.\n" ); |
|
7792 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp" ); |
|
7793 |
||
7794 |
TUint8 ret( KApduOk ); |
|
7795 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7796 |
// Let's calculate total APDU data len in aApdu. Length is |
0 | 7797 |
// decremented by 2 because of aApdu contains also sw1 and sw2 |
7798 |
// and these are total 2 bytes long. |
|
7799 |
TUint8 apduLen( aApdu.Length() - 2 ); |
|
7800 |
TUint32 index( 0 ); |
|
7801 |
TUint8 tag( aApdu[index++] ); |
|
7802 |
||
7803 |
if( KSuccessfull3GAuthTag == tag ) |
|
7804 |
{ |
|
7805 |
// check the len of RES |
|
7806 |
if( KMinLenOfRes > aApdu[index] || KMaxLenOfRes < aApdu[index] ) |
|
7807 |
{ |
|
7808 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid RES\n" ); |
|
7809 |
OstTrace0( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid RES" ); |
|
7810 |
ret = KApduNok; |
|
7811 |
} |
|
7812 |
else |
|
7813 |
{ |
|
7814 |
// move pointer to field length of CK |
|
7815 |
index += aApdu[index] + 1; |
|
7816 |
} |
|
7817 |
||
7818 |
// check the len of CK |
|
7819 |
if( KApduNok == ret || |
|
7820 |
KLenOfCk != aApdu[index] ) |
|
7821 |
{ |
|
7822 |
if( KApduNok != ret ) |
|
7823 |
{ |
|
7824 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid CK\n" ); |
|
7825 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid CK" ); |
|
7826 |
ret = KApduNok; |
|
7827 |
} |
|
7828 |
} |
|
7829 |
else |
|
7830 |
{ |
|
7831 |
// move pointer to field length of IK |
|
7832 |
index += aApdu[index] + 1; |
|
7833 |
} |
|
7834 |
||
7835 |
// check the len of IK |
|
7836 |
if( KApduNok == ret || |
|
7837 |
KLenOfIk != aApdu[index] ) |
|
7838 |
{ |
|
7839 |
if( KApduNok != ret ) |
|
7840 |
{ |
|
7841 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid IK\n" ); |
|
7842 |
OstTrace0( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid IK" ); |
|
7843 |
ret = KApduNok; |
|
7844 |
} |
|
7845 |
} |
|
7846 |
else |
|
7847 |
{ |
|
7848 |
// move pointer to end of IK |
|
7849 |
index += aApdu[index]; |
|
7850 |
} |
|
7851 |
||
7852 |
// check the len of Kc if present. |
|
7853 |
// This parameter is only present |
|
7854 |
// when service nro 27 is available |
|
7855 |
if( KApduOk == ret && index < apduLen - 1 ) |
|
7856 |
{ |
|
7857 |
// move pointer to field length of Kc |
|
7858 |
index++; |
|
7859 |
||
7860 |
// check the len of Kc |
|
7861 |
if( KLenOfKc != aApdu[index] ) |
|
7862 |
{ |
|
7863 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid Kc\n" ); |
|
7864 |
OstTrace0( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid Kc" ); |
|
7865 |
ret = KApduNok; |
|
7866 |
} |
|
7867 |
else |
|
7868 |
{ |
|
7869 |
// move pointer to end of Kc |
|
7870 |
index += aApdu[index]; |
|
7871 |
} |
|
7872 |
} |
|
7873 |
||
7874 |
// let's check that pointer doesn't go over |
|
7875 |
// aApdu's limits. |
|
7876 |
if( KApduOk == ret && index > apduLen - 1 ) |
|
7877 |
{ |
|
7878 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: error, APDU buffer overflow\n" ); |
|
7879 |
OstTrace0( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: error, APDU buffer overflow" ); |
|
7880 |
ret = KApduNok; |
|
7881 |
} |
|
7882 |
} |
|
7883 |
||
7884 |
else if(KSyncFailureTag == tag) |
|
7885 |
{ |
|
7886 |
// check the len of AUTS |
|
7887 |
if( KLenOfAuts != aApdu[index]) |
|
7888 |
{ |
|
7889 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid AUTS\n" ); |
|
7890 |
OstTrace0( TRACE_NORMAL, DUP6_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: invalid AUTS" ); |
|
7891 |
ret = KApduNok; |
|
7892 |
} |
|
7893 |
else |
|
7894 |
{ |
|
7895 |
// move pointer to end of AUTS |
|
7896 |
index += aApdu[index]; |
|
7897 |
} |
|
7898 |
||
7899 |
// let's check that pointer doesn't go over |
|
7900 |
// aApdu's limits. |
|
7901 |
if( KApduOk == ret && index > apduLen - 1 ) |
|
7902 |
{ |
|
7903 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: error, APDU buffer overflow\n" ); |
|
7904 |
OstTrace0( TRACE_NORMAL, DUP7_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: error, APDU buffer overflow" ); |
|
7905 |
ret = KApduNok; |
|
7906 |
} |
|
7907 |
} |
|
7908 |
else |
|
7909 |
{ |
|
7910 |
TFLOGSTRING("TSY: CMmCustomMessHandler::Validate3GSecurityContextApduResp: error, unknown tag\n" ); |
|
7911 |
OstTrace0( TRACE_NORMAL, DUP8_CMMCUSTOMMESSHANDLER_VALIDATE3GSECURITYCONTEXTAPDURESP, "CMmCustomMessHandler::Validate3GSecurityContextApduResp: error, unknown tag" ); |
|
7912 |
ret = KApduNok; |
|
7913 |
} |
|
7914 |
||
7915 |
return ret; |
|
7916 |
} |
|
7917 |
||
7918 |
// ----------------------------------------------------------------------------- |
|
7919 |
// CMmCustomMessHandler::ValidateGBABootstrappingApduResp |
|
7920 |
// Validates received apdu |
|
7921 |
// ----------------------------------------------------------------------------- |
|
7922 |
// |
|
7923 |
TUint8 CMmCustomMessHandler::ValidateGBABootstrappingApduResp( const TDesC8& aApdu ) |
|
7924 |
{ |
|
7925 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ValidateGBABootstrappingApduResp.\n" ); |
|
7926 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_VALIDATEGBABOOTSTRAPPINGAPDURESP, "CMmCustomMessHandler::ValidateGBABootstrappingApduResp" ); |
|
7927 |
||
7928 |
TUint8 ret( KApduNok ); |
|
7929 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7930 |
// Let's calculate total APDU data len in aApdu. Length is |
0 | 7931 |
// decremented by 2 because of aApdu contains also sw1 and sw2 |
7932 |
// and these are total 2 bytes long. |
|
7933 |
TUint8 apduLen( aApdu.Length() - 2 ); |
|
7934 |
TUint32 index( 0 ); |
|
7935 |
TUint8 tag( aApdu[index++] ); |
|
7936 |
||
7937 |
if( apduLen > 1 ) |
|
7938 |
{ |
|
7939 |
if( KSuccessfull3GAuthTag == tag || |
|
7940 |
KSyncFailureTag == tag ) |
|
7941 |
{ |
|
7942 |
if( apduLen >= aApdu[index] ) |
|
7943 |
{ |
|
7944 |
ret = KApduOk; |
|
7945 |
} |
|
7946 |
} |
|
7947 |
} |
|
7948 |
return ret; |
|
7949 |
} |
|
7950 |
||
7951 |
||
7952 |
// ----------------------------------------------------------------------------- |
|
7953 |
// CMmCustomMessHandler::ValidateGBANafDerivationApduResp |
|
7954 |
// Validates received apdu |
|
7955 |
// ----------------------------------------------------------------------------- |
|
7956 |
// |
|
7957 |
TUint8 CMmCustomMessHandler::ValidateGBANafDerivationApduResp( const TDesC8& aApdu ) |
|
7958 |
{ |
|
7959 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ValidateGBANafDerivationApduResp.\n" ); |
|
7960 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_VALIDATEGBANAFDERIVATIONAPDURESP, "CMmCustomMessHandler::ValidateGBANafDerivationApduResp" ); |
|
7961 |
||
7962 |
TUint8 ret = KApduNok; |
|
7963 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7964 |
// Let's calculate total APDU data len in aApdu. Length is |
0 | 7965 |
// decremented by 2 because of aApdu contains also sw1 and sw2 |
7966 |
// and these are total 2 bytes long. |
|
7967 |
TUint8 apduLen( aApdu.Length() - 2 ); |
|
7968 |
TUint32 index( 0 ); |
|
7969 |
TUint8 tag( aApdu[index++] ); |
|
7970 |
||
7971 |
if( apduLen > 1 ) |
|
7972 |
{ |
|
7973 |
if( KSuccessfull3GAuthTag == tag ) |
|
7974 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7975 |
// response apdu contains only parameter Ks Ext NAF |
0 | 7976 |
// so, let's check that apdu len contains parameter |
7977 |
// correctly. So apduLen should be len of Ks Ext NAF |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
7978 |
// + 2 ("Successful GBA operation" field + |
0 | 7979 |
// Length of Ks_ext_NAF field) |
7980 |
if( apduLen == aApdu[index] + 2 ) |
|
7981 |
{ |
|
7982 |
ret = KApduOk; |
|
7983 |
} |
|
7984 |
} |
|
7985 |
} |
|
7986 |
return ret; |
|
7987 |
} |
|
7988 |
||
7989 |
// ----------------------------------------------------------------------------- |
|
7990 |
// CMmCustomMessHandler::ValidateRunGsmAlgorithmApduResp |
|
7991 |
// Validates received apdu |
|
7992 |
// ----------------------------------------------------------------------------- |
|
7993 |
// |
|
7994 |
TUint8 CMmCustomMessHandler::ValidateRunGsmAlgorithmApduResp( const TDesC8& aApdu ) |
|
7995 |
{ |
|
7996 |
TFLOGSTRING("TSY: CMmCustomMessHandler::ValidateRunGsmAlgorithmApduResp.\n" ); |
|
7997 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_VALIDATERUNGSMALGORITHMAPDURESP, "CMmCustomMessHandler::ValidateRunGsmAlgorithmApduResp" ); |
|
7998 |
||
7999 |
TUint8 ret( KApduNok ); |
|
8000 |
||
8001 |
if( aApdu.Length() == KRunGsmAlgorithmRespLen + 2 ) |
|
8002 |
{ |
|
8003 |
ret = KApduOk; |
|
8004 |
} |
|
8005 |
return ret; |
|
8006 |
} |
|
8007 |
||
8008 |
||
8009 |
// ----------------------------------------------------------------------------- |
|
8010 |
// CMmCustomMessHandler::FindTlvObject |
|
8011 |
// Finds TLV object |
|
8012 |
// ----------------------------------------------------------------------------- |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8013 |
// |
0 | 8014 |
TBool CMmCustomMessHandler::FindTlvObject( |
8015 |
TUint8 aTlvTag, |
|
8016 |
const TDesC8& aBerTlv, |
|
8017 |
TDes8& aTlvObject ) |
|
8018 |
{ |
|
8019 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::FindTlvObject (tag: 0x%x)\n", aTlvTag ); |
|
8020 |
OstTrace1( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_FINDTLVOBJECT, "CMmCustomMessHandler::FindTlvObject (tag: 0x%x)", aTlvTag ); |
|
8021 |
||
8022 |
TBool ret( EFalse ); |
|
8023 |
TUint32 index( 0 ); |
|
8024 |
TUint8 tag( 0 ); |
|
8025 |
TUint32 tlvLength( 0 ); |
|
8026 |
||
8027 |
while( index + 2 < aBerTlv.Length() ) |
|
8028 |
{ |
|
8029 |
tag = aBerTlv[index++]; |
|
8030 |
tlvLength = aBerTlv[index++]; |
|
8031 |
||
8032 |
// let's check if len of tlv object is coded |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8033 |
// with one or two bytes |
0 | 8034 |
if( 0x81 == tlvLength || |
8035 |
0x82 == tlvLength ) |
|
8036 |
{ |
|
8037 |
TUint8 byteCount( tlvLength & 0x7F ); |
|
8038 |
TUint8 ind( 0 ); |
|
8039 |
tlvLength = 0; |
|
8040 |
do |
|
8041 |
{ |
|
8042 |
tlvLength = tlvLength << 8; |
|
8043 |
tlvLength = tlvLength + aBerTlv[index++]; |
|
8044 |
ind++; |
|
8045 |
} |
|
8046 |
while ( ind < byteCount ); |
|
8047 |
} |
|
8048 |
||
8049 |
if( tag == aTlvTag ) |
|
8050 |
{ |
|
8051 |
if( index + tlvLength <= aBerTlv.Length() ) |
|
8052 |
{ |
|
8053 |
if( tlvLength <= aTlvObject.MaxSize() ) |
|
8054 |
{ |
|
8055 |
// tlv object found |
|
8056 |
TFLOGSTRING2("TSY: CMmCustomMessHandler::FindTlvObject: tag: 0x%x found\n", aTlvTag ); |
|
8057 |
OstTrace1( TRACE_NORMAL, DUP1_CMMCUSTOMMESSHANDLER_FINDTLVOBJECT, "CMmCustomMessHandler::FindTlvObject: tag: 0x%x found", aTlvTag ); |
|
8058 |
aTlvObject.Copy( aBerTlv.Mid( index , tlvLength ) ); |
|
8059 |
ret = ETrue; |
|
8060 |
} |
|
8061 |
else |
|
8062 |
{ |
|
8063 |
TFLOGSTRING3("TSY: CMmCustomMessHandler::FindTlvObject: length of aTlvObject is not enough, needed: %d max size: %d \n", tlvLength, aTlvObject.MaxSize() ); |
|
8064 |
OstTrace0( TRACE_NORMAL, DUP2_CMMCUSTOMMESSHANDLER_FINDTLVOBJECT, "CMmCustomMessHandler::FindTlvObject: length of aTlvObject is not enough" ); |
|
8065 |
OstTrace1( TRACE_NORMAL, DUP3_CMMCUSTOMMESSHANDLER_FINDTLVOBJECT, "CMmCustomMessHandler::FindTlvObject: needed: %d", tlvLength ); |
|
8066 |
OstTrace1( TRACE_NORMAL, DUP4_CMMCUSTOMMESSHANDLER_FINDTLVOBJECT, "CMmCustomMessHandler::FindTlvObject: max size: %d", aTlvObject.MaxSize() ); |
|
8067 |
} |
|
8068 |
} |
|
8069 |
else |
|
8070 |
{ |
|
8071 |
TFLOGSTRING("TSY: CMmCustomMessHandler::FindTlvObject: buffer overflow \n" ); |
|
8072 |
OstTrace0( TRACE_NORMAL, DUP5_CMMCUSTOMMESSHANDLER_FINDTLVOBJECT, "CMmCustomMessHandler::FindTlvObject: buffer overflow" ); |
|
8073 |
} |
|
8074 |
break; |
|
8075 |
} |
|
8076 |
else |
|
8077 |
{ |
|
8078 |
index += tlvLength; |
|
8079 |
} |
|
8080 |
} |
|
8081 |
||
8082 |
return ret; |
|
8083 |
} |
|
8084 |
||
8085 |
||
8086 |
// ----------------------------------------------------------------------------- |
|
8087 |
// CMmCustomMessHandler::DeriveCkFromKc |
|
8088 |
// derives Ck from Kc |
|
8089 |
// ----------------------------------------------------------------------------- |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8090 |
// |
0 | 8091 |
void CMmCustomMessHandler::DeriveCkFromKc( |
8092 |
TDes8& aCk, |
|
8093 |
const TDesC8& aKc ) |
|
8094 |
{ |
|
8095 |
TFLOGSTRING("TSY: CMmCustomMessHandler::DeriveCkFromKc.\n" ); |
|
8096 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_DERIVECKFROMKC, "CMmCustomMessHandler::DeriveCkFromKc" ); |
|
8097 |
||
8098 |
/* This operation calculates the UMTS Ciphering Key (CK) from the GSM |
|
8099 |
Ciphering Key (Kc). This is done by using the c4 algorithm defined in |
|
8100 |
3GPP TS 33.102 v3.8.0 (Release 1999). |
|
8101 |
||
8102 |
c4: CK = Kc || Kc; |
|
8103 |
where || means concatination. |
|
8104 |
||
8105 |
The resulting CK is as follows: |
|
8106 |
----------------------------------------------------------------- |
|
8107 |
|kc1|kc2|kc3|kc4|kc5|kc6|kc7|kc8|kc1|kc2|kc3|kc4|kc5|kc6|kc7|kc8| |
|
8108 |
----------------------------------------------------------------- */ |
|
8109 |
aCk.Copy( aKc ); |
|
8110 |
aCk.Append( aKc ); |
|
8111 |
} |
|
8112 |
||
8113 |
||
8114 |
// ----------------------------------------------------------------------------- |
|
8115 |
// CMmCustomMessHandler::DeriveIkFromKc |
|
8116 |
// derives Ck from Kc |
|
8117 |
// ----------------------------------------------------------------------------- |
|
8118 |
// |
|
8119 |
void CMmCustomMessHandler::DeriveIkFromKc( |
|
8120 |
TDes8& aIk, |
|
8121 |
const TDesC8& aKc ) |
|
8122 |
{ |
|
8123 |
TFLOGSTRING("TSY: CMmCustomMessHandler::DeriveIkFromKc.\n" ); |
|
8124 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_DERIVEIKFROMKC, "CMmCustomMessHandler::DeriveIkFromKc" ); |
|
8125 |
||
8126 |
/* This operation derives the UMTS Integrity Key (IK) from the GSM |
|
8127 |
Ciphering Key (Kc). This is done by using the c5 algorithm defined in |
|
8128 |
3GPP TS 33.102 v3.8.0 (release 1999). |
|
8129 |
||
8130 |
c5: IK = Kc1 xor Kc2 || Kc || Kc1 xor Kc2; |
|
8131 |
where Kc1 and Kc2 are both 4 bytes long and || means concatination. |
|
8132 |
||
8133 |
|--------------> Kc 8 bytes <-----------| |
|
8134 |
----------------------------------------- |
|
8135 |
| B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | |
|
8136 |
----------------------------------------- |
|
8137 |
|--> Kc1,4 bytes <--|--> Kc2,4 bytes <--| |
|
8138 |
||
8139 |
Kx = Kc1 xor Kc2 |
|
8140 |
||
8141 |
The resulting IK is as follows: |
|
8142 |
||
8143 |
|-----------------------> IK, 16 bytes <------------------------| |
|
8144 |
----------------------------------------------------------------- |
|
8145 |
|Kx1|Kx2|Kx3|Kx4|Kc1|Kc2|Kc3|Kc4|Kc5|Kc6|Kc7|Kc8|Kx1|Kx2|Kx3|Kx4| |
|
8146 |
----------------------------------------------------------------- |
|
8147 |
|----> Kx <-----|------------> Kc <-------------|-----> Kx <----| */ |
|
8148 |
||
8149 |
TBuf8<KLenOfKc> kc1; |
|
8150 |
TBuf8<KLenOfKc> kc2; |
|
8151 |
TBuf8<KLenOfKc> kx; |
|
8152 |
||
8153 |
kc1.Copy( aKc.Mid( 0, 4 ) ); |
|
8154 |
kc2.Copy( aKc.Mid( 4, 4 ) ); |
|
8155 |
||
8156 |
for ( TUint8 i = 0; i < 4; i++ ) |
|
8157 |
{ |
|
8158 |
kx.Append( kc1[i] ^ kc2[i] ); |
|
8159 |
} |
|
8160 |
||
8161 |
aIk.Append( kx ); |
|
8162 |
aIk.Append( aKc ); |
|
8163 |
aIk.Append( kx ); |
|
8164 |
} |
|
8165 |
||
8166 |
||
8167 |
// ----------------------------------------------------------------------------- |
|
8168 |
// CMmCustomMessHandler::DeriveIkFromKc |
|
8169 |
// derives Ck from Kc |
|
8170 |
// ----------------------------------------------------------------------------- |
|
8171 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8172 |
TInt CMmCustomMessHandler::UiccHandleImsAuthentication( |
0 | 8173 |
const CMmDataPackage& aDataPackage ) |
8174 |
{ |
|
8175 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccHandleImsAuthentication.\n" ); |
|
8176 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCHANDLEIMSAUTHENTICATION, "CMmCustomMessHandler::UiccHandleImsAuthentication" ); |
|
8177 |
TInt ret( KErrNone ); |
|
8178 |
||
8179 |
// IMS authentication: |
|
8180 |
// If card type is ICC, we just send the RUN GSM ALGORITHM to the ICC |
|
8181 |
// If card type is UICC, we check is ISIM application activated: |
|
8182 |
// * If ISIM application is activated, we send 3G security context |
|
8183 |
// to the ISIM application. |
|
8184 |
// * If ISIM application is NOT activated, we try to activate it. |
|
8185 |
// * If actication succeeded, we send 3G security context to the |
|
8186 |
// ISIM application |
|
8187 |
// * If activation fails, we send 3G security context to the USIM |
|
8188 |
// application |
|
8189 |
||
8190 |
RMobilePhone::TImsAuthenticateDataV5 authenticationData; |
|
8191 |
aDataPackage.UnPackData( authenticationData ); |
|
8192 |
||
8193 |
TUiccSendApdu params; |
|
8194 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
8195 |
params.serviceType = UICC_APPL_APDU_SEND; |
|
8196 |
params.fileId = UICC_EF_ID_NOT_PRESENT; |
|
8197 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
8198 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
8199 |
params.filePath.Append( KMasterFileId ); |
|
8200 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
8201 |
||
8202 |
TUint8 cardType( iMmUiccMessHandler->GetCardType() ); |
|
8203 |
||
8204 |
if( UICC_CARD_TYPE_ICC == cardType ) |
|
8205 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8206 |
// no need to activate ISIM application, |
0 | 8207 |
// let's just send the authentication APDU |
8208 |
UiccCreateRunGsmAlgorithmApdu( |
|
8209 |
params, |
|
8210 |
authenticationData.iRAND, |
|
8211 |
ETrIdRunGsmAlgorithmIms ); |
|
8212 |
||
8213 |
ret = iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
8214 |
} |
|
8215 |
else if( UICC_CARD_TYPE_UICC == cardType ) |
|
8216 |
{ |
|
8217 |
// let's store RAND and AUTN while we try to acticate |
|
8218 |
// ISIM application |
|
8219 |
RMobilePhone::TImsAuthenticateDataV5 authenticationData; |
|
8220 |
aDataPackage.UnPackData( authenticationData ); |
|
8221 |
||
8222 |
if( iMmUiccMessHandler->IsIsimApplicationFound() ) |
|
8223 |
{ |
|
8224 |
// let's check is ISIM application already tried to activate |
|
8225 |
if( iIsimApplActivated ) |
|
8226 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8227 |
UiccCreate3GSecurityContextApdu( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8228 |
params, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8229 |
authenticationData.iRAND, |
0 | 8230 |
authenticationData.iAUTN, |
8231 |
ETrIdEEapAkaAuthenticateIms ); |
|
8232 |
||
8233 |
ret = iMmUiccMessHandler->CreateUiccApplCmdReq( params, UICC_APPL_TYPE_UICC_ISIM ); |
|
8234 |
} |
|
8235 |
else |
|
8236 |
{ |
|
8237 |
iRandBuf.Zero(); |
|
8238 |
iAutnBuf.Zero(); |
|
8239 |
||
8240 |
iRandBuf.Append( authenticationData.iRAND ); |
|
8241 |
iAutnBuf.Append( authenticationData.iAUTN ); |
|
8242 |
||
8243 |
TUiccParamsBase activationParams; |
|
8244 |
activationParams.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
8245 |
activationParams.trId = ETrIdActivateIsimApplication; |
|
8246 |
||
8247 |
ret = iMmUiccMessHandler->CreateUiccApplicationReq( |
|
8248 |
activationParams, |
|
8249 |
UICC_APPL_HOST_ACTIVATE, |
|
8250 |
UICC_APPL_TYPE_UICC_ISIM ); |
|
8251 |
} |
|
8252 |
} |
|
8253 |
else |
|
8254 |
{ |
|
8255 |
// no ISim application, let's send authenticate apdu to the Uicc application |
|
8256 |
UiccCreate3GSecurityContextApdu( |
|
8257 |
params, |
|
8258 |
authenticationData.iRAND, |
|
8259 |
authenticationData.iAUTN, |
|
8260 |
ETrIdEEapAkaAuthenticateIms ); |
|
8261 |
||
8262 |
ret = iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
8263 |
} |
|
8264 |
} |
|
8265 |
else |
|
8266 |
{ |
|
8267 |
ret = KErrGeneral; |
|
8268 |
} |
|
8269 |
return ret; |
|
8270 |
} |
|
8271 |
||
8272 |
||
8273 |
// ----------------------------------------------------------------------------- |
|
8274 |
// CMmCustomMessHandler::UiccHandleIsimActivationResp |
|
8275 |
// handles repsonse for ISim application activation |
|
8276 |
// ----------------------------------------------------------------------------- |
|
8277 |
// |
|
8278 |
void CMmCustomMessHandler::UiccHandleIsimActivationResp( TInt aStatus ) |
|
8279 |
{ |
|
8280 |
TFLOGSTRING("TSY: CMmCustomMessHandler::UiccHandleIsimActivationResp.\n" ); |
|
8281 |
OstTrace0( TRACE_NORMAL, CMMCUSTOMMESSHANDLER_UICCHANDLEISIMACTIVATIONRESP, "CMmCustomMessHandler::UiccHandleIsimActivationResp" ); |
|
8282 |
||
8283 |
TUiccSendApdu params; |
|
8284 |
params.messHandlerPtr = static_cast<MUiccOperationBase*>( this ); |
|
8285 |
params.serviceType = UICC_APPL_APDU_SEND; |
|
8286 |
params.fileId = UICC_EF_ID_NOT_PRESENT; |
|
8287 |
params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
8288 |
params.filePath.Append( KMasterFileId >> 8 ); |
|
8289 |
params.filePath.Append( KMasterFileId ); |
|
8290 |
params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() ); |
|
8291 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8292 |
UiccCreate3GSecurityContextApdu( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8293 |
params, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8294 |
iRandBuf, |
0 | 8295 |
iAutnBuf, |
8296 |
ETrIdEEapAkaAuthenticateIms ); |
|
8297 |
||
8298 |
if( UICC_STATUS_OK == aStatus ) |
|
8299 |
{ |
|
8300 |
iIsimApplActivated = ETrue; |
|
8301 |
||
8302 |
// ISim application activated successfully, let's send authentication apdu |
|
8303 |
// to the ISim application |
|
8304 |
iMmUiccMessHandler->CreateUiccApplCmdReq( params, UICC_APPL_TYPE_UICC_ISIM ); |
|
8305 |
} |
|
8306 |
else |
|
8307 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
8308 |
// ISim application activation fails, le'ts send authentication apdu |
0 | 8309 |
// to the USim application |
8310 |
iMmUiccMessHandler->CreateUiccApplCmdReq( params ); |
|
8311 |
} |
|
8312 |
} |
|
8313 |
||
8314 |
// ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
8315 |
//None |
|
8316 |
||
8317 |
// End of File |