author | mikaruus <mika.a.ruuskanen@nokia.com> |
Wed, 21 Apr 2010 14:29:55 +0300 | |
changeset 8 | 6295dc2169f3 |
parent 5 | 8ccc39f9d787 |
child 9 | 8486d82aef45 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
2 |
* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 3 |
* All rights reserved. |
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
14 |
* Description: |
0 | 15 |
* |
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include "satmesshandler.h" // sat message handler class |
|
22 |
#include "satmessaging.h" // sat messaging class |
|
23 |
#include "sattimer.h" // sat timer class |
|
24 |
#include "sateventdownload.h" // sat event download class |
|
25 |
#include "satdatadownload.h" // sat data download class |
|
26 |
#include "saticon.h" // sat icon class |
|
27 |
#include "satmosmsctrl.h" // sat mo sms control class |
|
28 |
#include "satnotifications.h" // sat notifications class |
|
29 |
#include "ber_tlv.h" // sat ber-tlv classes |
|
30 |
#include "satutil.h" // sat utility class |
|
31 |
#include "cmmphonetsender.h" // phonet sender |
|
32 |
#include "terminalprofile.h" // terminal profile |
|
33 |
#include "satflightmodestatus.h"// flight mode status |
|
34 |
||
35 |
#include <pn_const.h> // server id constants |
|
36 |
#include <tisi.h> // isi message |
|
37 |
#include <ss_wmisi.h> // ss server |
|
38 |
#include <infoisi.h> // info server |
|
39 |
#include <net_modemisi.h> // net server |
|
40 |
#include <gssisi.h> // gss server |
|
41 |
#include <call_modemisi.h> // Call Modem server |
|
42 |
#include <smsisi.h> // sms server |
|
43 |
#include <uiccisi.h> // UICC server |
|
44 |
#include <gpdsisi.h> // GPDS server |
|
45 |
||
46 |
#include <atk_sharedisi.h> |
|
47 |
#include <call_sharedisi.h> |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
48 |
#include <info_sharedisi.h> |
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 "satmesshandlerTraces.h" |
0 | 52 |
#endif |
53 |
||
54 |
||
55 |
||
56 |
// CONSTANTS |
|
57 |
const TUint8 KOneByteLengthLimit = 0x7F; |
|
58 |
// Maximum value for get input string |
|
59 |
const TUint8 KGetInputStringMaxSize = 0xEF; |
|
60 |
// No transaction ongoing |
|
61 |
const TInt KNoTransactionOngoing = -1; |
|
62 |
// Time zone not available |
|
63 |
const TUint8 KTimeZoneNotAvailable = 0xFF; |
|
64 |
// Access Technology unknown |
|
65 |
const TUint8 KAccTechUnknown = 0xFF; |
|
66 |
// This is a common length constant (2 bytes) |
|
67 |
const TUint8 KLengthTwoBytes = 0x02; |
|
68 |
// Maximum polling interval of legacy phones |
|
69 |
const TUint8 KMaxLegacyPollInterval = 0x19; // 25 decimal |
|
70 |
// Size of one clut entry in bytes |
|
71 |
const TUint16 KClutEntrySize = 3; |
|
72 |
||
73 |
// Padding bytes for UICC messages |
|
74 |
const TUint8 KUiccPadding = 0x00; |
|
75 |
// Size of terminal profile subblock |
|
76 |
const TUint8 KSizeOfTerminalProfileSb = 40; |
|
77 |
// Offset of UICC_APPL_CMD_REQ message for adding subblocks |
|
78 |
const TUint8 KUiccApplCmdReqOffset( |
|
79 |
ISI_HEADER_SIZE + SIZE_UICC_APPL_CMD_REQ ); |
|
80 |
// Size of UICC_SB_APPL_PATH |
|
81 |
const TUint8 KUiccSbApplPathSize( |
|
82 |
SIZE_UICC_SB_APPL_PATH + KUiccFilePathLength ); |
|
83 |
// UICC file IDs |
|
84 |
const TUint16 KUiccMasterFileId( 0x3F00 ); |
|
85 |
const TUint16 KUiccElemFileServiceTable( 0x6F38 ); |
|
86 |
const TUint16 KUiccDedicatedFileTelecom( 0x7F10 ); |
|
87 |
const TUint16 KUiccDedicatedFileGraphics( 0x5F50 ); |
|
88 |
const TUint16 KUiccElemFileImg( 0x4F20 ); |
|
89 |
const TUint8 KUiccSfiServiceTable( 4 ); |
|
90 |
// Number of subblocks in UICC_APPL_CMD_REQ |
|
91 |
const TUint8 KNumOfSbsInUiccApplCmdReq( 3 ); |
|
92 |
// Max size of UICC_SB_TERMINAL_PROFILE |
|
93 |
const TUint16 KMaxSizeOfUiccSbTerminalResponse( 264 ); |
|
94 |
// Length of device identity TLV data object |
|
95 |
const TUint8 KTlvDeviceIdentityLength( 2 ); |
|
96 |
// Max length of UICC_SB_AID |
|
97 |
const TUint16 KMaxLengthUiccSbAid( 260 ); |
|
98 |
// Elementary file ID length |
|
99 |
const TUint8 KUiccFileIdLength( 2 ); |
|
100 |
// Maximum size of envelope |
|
101 |
const TUint16 KMaxSizeOfEnvelope( 256 ); |
|
102 |
||
103 |
||
104 |
// ==================== MEMBER FUNCTIONS ==================================== |
|
105 |
||
106 |
// ----------------------------------------------------------------------------- |
|
107 |
// CSatMessHandler::CSatMessHandler |
|
108 |
// C++ default constructor can NOT contain any code, that |
|
109 |
// might leave. |
|
110 |
// ----------------------------------------------------------------------------- |
|
111 |
// |
|
112 |
CSatMessHandler::CSatMessHandler |
|
113 |
( |
|
114 |
CTsySatMessaging* aTsySatMessaging, |
|
115 |
CMmPhoNetSender* aPnSend |
|
116 |
) |
|
117 |
: |
|
118 |
iTsySatMessaging( aTsySatMessaging ), |
|
119 |
iPnSend( aPnSend ) |
|
120 |
{ |
|
121 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_CSATMESSHANDLER, "CSatMessHandler::CSatMessHandler" ); |
|
122 |
// >= 0 if there is ongoing transaction |
|
123 |
iTerminalRespTraId = KNoTransactionOngoing; |
|
124 |
iGetIconSimReadFieldTraId = KNoTransactionOngoing; |
|
125 |
iDataDownloadSimReadFieldTraId = KNoTransactionOngoing; |
|
126 |
||
127 |
iCardId = KZero; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
128 |
iImeiAvailable = EFalse; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
129 |
iImeiSvAvailable = EFalse; |
0 | 130 |
// By default, there's no need to request routing from SMS server |
131 |
iSmsCbRoutingComplete = ETrue; |
|
132 |
iRefreshRequestIsOn = EFalse; |
|
133 |
iTimingAdvance = GSS_TIMING_ADVANCE_NOT_AVAILABLE; |
|
134 |
iTaStatus = GSS_TIMING_ADVANCE_NOT_VALID; |
|
135 |
iTimeZone = KTimeZoneNotAvailable; |
|
136 |
iSimServerObjectId = KZero; |
|
137 |
iCurrentAccTech = KAccTechUnknown; |
|
138 |
// Set polling status to the use of the default value (25 sec.) |
|
139 |
iPollingOff = ETrue; |
|
140 |
iSsStatus = ENotBusy; |
|
141 |
// No long poll interval requests yet |
|
142 |
iLongPollIntervalReq = EFalse; |
|
143 |
||
144 |
#ifdef INFO_PP_ATK_MO_SM_CONTROL |
|
145 |
// MO SMS support not yet read from product profile |
|
146 |
iMoSmsSupportedInPp = EFalse; |
|
147 |
#endif // INFO_PP_ATK_MO_SM_CONTROL |
|
148 |
||
149 |
#ifdef INFO_PP_ENHANCED_NETWORK_SELECTION |
|
150 |
// ENS support not yet read from product profile |
|
151 |
iEnsSupportedInPp = EFalse; |
|
152 |
// SET UP EVENT LIST TR not yet sent |
|
153 |
iSetUpEventListTrSent = EFalse; |
|
154 |
#endif // INFO_PP_ENHANCED_NETWORK_SELECTION |
|
155 |
||
156 |
// Init location info structure |
|
157 |
iLocInfo.iOperatorCode.FillZ( iLocInfo.iOperatorCode.MaxLength() ); |
|
158 |
iLocInfo.iLac.FillZ( iLocInfo.iLac.MaxLength() ); |
|
159 |
iLocInfo.iCellId.FillZ( iLocInfo.iCellId.MaxLength() ); |
|
160 |
iLocInfo.iRegStatus = NET_NO_COVERAGE; |
|
161 |
||
162 |
// Init IMEI of the ME |
|
163 |
iIMEI.FillZ( 16 ); // KSerialNumberLength + 1 |
|
164 |
||
165 |
// Clear NMR (Network Measurement result) |
|
166 |
iNMR.Zero(); |
|
167 |
||
168 |
// Clear BCCH channel list |
|
169 |
iBCCHChannelList.Zero(); |
|
170 |
||
171 |
// Clear UTRAN measurement result |
|
172 |
iUtranNMR.Set( KNullDesC8 ); |
|
173 |
||
174 |
// ME is not yet in service during startup |
|
175 |
iPreviousRegistrationStatus = NET_REG_STATUS_NOSERV_SEARCHING; |
|
176 |
||
177 |
// INFO_PP_SIM_OLD_POLL_INTERVAL flag not read yet |
|
178 |
iOldPollIntervalSupportedInPp = ETrue; |
|
179 |
} |
|
180 |
||
181 |
||
182 |
// ----------------------------------------------------------------------------- |
|
183 |
// CSatMessHandler::~CSatMessHandler |
|
184 |
// Destructor. |
|
185 |
// ----------------------------------------------------------------------------- |
|
186 |
// |
|
187 |
CSatMessHandler::~CSatMessHandler() |
|
188 |
{ |
|
189 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_CSATMESSHANDLER, "CSatMessHandler::~CSatMessHandler" ); |
|
190 |
} |
|
191 |
||
192 |
// ----------------------------------------------------------------------------- |
|
193 |
// CSatMessHandler::NewL |
|
194 |
// Two-phased constructor. |
|
195 |
// ----------------------------------------------------------------------------- |
|
196 |
// |
|
197 |
CSatMessHandler* CSatMessHandler::NewL |
|
198 |
( |
|
199 |
CTsySatMessaging* aTsySatMessaging, |
|
200 |
CMmPhoNetSender* aPnSend |
|
201 |
) |
|
202 |
{ |
|
203 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NEWL, "CSatMessHandler::NewL" ); |
|
204 |
TFLOGSTRING("TSY:CSatMessHandler::NewL"); |
|
205 |
||
206 |
CSatMessHandler* self = new( ELeave ) CSatMessHandler( aTsySatMessaging, |
|
207 |
aPnSend ); |
|
208 |
CleanupStack::PushL( self ); |
|
209 |
self->ConstructL(); |
|
210 |
CleanupStack::Pop( self ); |
|
211 |
return self; |
|
212 |
} |
|
213 |
||
214 |
// ----------------------------------------------------------------------------- |
|
215 |
// CSatMessHandler::ConstructL |
|
216 |
// Symbian 2nd phase constructor can leave |
|
217 |
// ----------------------------------------------------------------------------- |
|
218 |
// |
|
219 |
void CSatMessHandler::ConstructL() |
|
220 |
{ |
|
221 |
TFLOGSTRING("TSY:CSatMessHandler::ConstructL"); |
|
222 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_CONSTRUCTL, "CSatMessHandler::ConstructL" ); |
|
223 |
||
224 |
// This flag is set to 'true' when indication ESatUsatClientReadyIndication |
|
225 |
// is received from SAT server. CAT can be enabled when the state of this |
|
226 |
// flag is 'true' and also UICC server is ready. |
|
227 |
iSatReady = EFalse; |
|
228 |
// Application ID will be set when UICC_APPLICATION_IND is received |
|
229 |
iApplicationId = 0xFF; |
|
230 |
// UICC client ID will be set when UICC_APPLICATION_RESP is received |
|
231 |
iUiccClientId = 0; |
|
232 |
// Terminal profile status flag is set 'true' when terminal profile has been |
|
233 |
// sent to prevent CAT enabling request to be sent before terminal profile |
|
234 |
iTerminalProfileSent = EFalse; |
|
235 |
// Card type is not known yet |
|
236 |
iCardType = UICC_CARD_TYPE_UNKNOWN; |
|
237 |
// Application file id is initialize to 'FFFF' |
|
238 |
TBuf8<2> unknownFileId; |
|
239 |
unknownFileId.Append( 0xFF ); |
|
240 |
unknownFileId.Append( 0xFF ); |
|
241 |
iApplFileId.Copy( unknownFileId ); |
|
242 |
||
243 |
iPollingInterval = KDefaultPollInterval; |
|
244 |
iImageCodingScheme = KBlackAndWhite; |
|
245 |
} |
|
246 |
||
247 |
// ----------------------------------------------------------------------------- |
|
248 |
// CSatMessHandler::ProactiveProcedureMessageReceivedL |
|
249 |
// Called SatMessHandler::ReceivedL, handles Event download, |
|
250 |
// Call control, Data Download and MO-SMS Control related messages |
|
251 |
// ----------------------------------------------------------------------------- |
|
252 |
// |
|
253 |
void CSatMessHandler::ProactiveProcedureMessageReceivedL |
|
254 |
( |
|
255 |
const TIsiReceiveC& aIsiMessage |
|
256 |
) |
|
257 |
{ |
|
258 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_PROACTIVEPROCEDUREMESSAGERECEIVEDL, "CSatMessHandler::ProactiveProcedureMessageReceivedL" ); |
|
259 |
TFLOGSTRING("TSY:CSatMessHandler::ProactiveProcedureMessageReceivedL"); |
|
260 |
||
261 |
// handle event download and related messages |
|
262 |
iTsySatMessaging->EventDownloadReceived( aIsiMessage ); |
|
263 |
||
264 |
// handle call control and releated messages |
|
265 |
iTsySatMessaging->CallControlReceivedL( aIsiMessage ); |
|
266 |
||
267 |
// handle Data Download and related messages |
|
268 |
iTsySatMessaging->DataDownloadReceivedL( aIsiMessage ); |
|
269 |
||
270 |
// handle MO-SMS Control related messages |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
271 |
iTsySatMessaging->MoSmsControlReceivedL( aIsiMessage ); |
0 | 272 |
} |
273 |
||
274 |
// ----------------------------------------------------------------------------- |
|
275 |
// CSatMessHandler::NetServerMessageReceived |
|
276 |
// Called from SatMessHandler::ReceivedL, handles Net Server related messages |
|
277 |
// ----------------------------------------------------------------------------- |
|
278 |
// |
|
279 |
void CSatMessHandler::NetServerMessageReceived |
|
280 |
( |
|
281 |
const TIsiReceiveC& aIsiMessage // ISI message |
|
282 |
) |
|
283 |
{ |
|
284 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETSERVERMESSAGERECEIVED, "CSatMessHandler::NetServerMessageReceived" ); |
|
285 |
TFLOGSTRING("TSY:CSatMessHandler::NetServerMessageReceived"); |
|
286 |
||
287 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
288 |
||
289 |
switch ( messageId ) |
|
290 |
{ |
|
291 |
case NET_CELL_INFO_IND: |
|
292 |
{ |
|
293 |
StoreNetServiceStatus( aIsiMessage ); |
|
294 |
// If SMS CB routing is still pending, regenerate routing request. |
|
295 |
// This might be the case if CS was inactive or SIM is not ready |
|
296 |
// during the first request. |
|
297 |
if ( !iSmsCbRoutingComplete ) |
|
298 |
{ |
|
299 |
TFLOGSTRING("TSY:CSatMessHandler::NetServerMessageReceived \ |
|
300 |
Sending delayed SMS CB routing request."); |
|
301 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETSERVERMESSAGERECEIVED, "CSatMessHandler::NetServerMessageReceived Sending delayed SMS CB routing request." ); |
|
302 |
SmsCbRoutingReq( |
|
303 |
iTsySatMessaging->GetTransactionId(), SMS_ROUTING_SET ); |
|
304 |
} |
|
305 |
break; |
|
306 |
} |
|
307 |
case NET_NEIGHBOUR_CELLS_RESP: |
|
308 |
{ |
|
309 |
NetNeighbourCellResp( aIsiMessage ); |
|
310 |
break; |
|
311 |
} |
|
312 |
case NET_CELL_INFO_GET_RESP: |
|
313 |
{ |
|
314 |
NetCellInfoGetResp( aIsiMessage ); |
|
315 |
break; |
|
316 |
} |
|
317 |
case NET_TIME_IND: |
|
318 |
{ |
|
319 |
NetTimeInd( aIsiMessage ); |
|
320 |
break; |
|
321 |
} |
|
322 |
case NET_RAT_IND: |
|
323 |
{ |
|
324 |
NetRatInd( aIsiMessage ); |
|
325 |
break; |
|
326 |
} |
|
327 |
default: |
|
328 |
{ |
|
329 |
// Do nothing |
|
330 |
break; |
|
331 |
} |
|
332 |
} |
|
333 |
} |
|
334 |
||
335 |
// ----------------------------------------------------------------------------- |
|
336 |
// CSatMessHandler::PhoneInfoMessageReceived |
|
337 |
// Called from SatMessHandler::ReceivedL, handles Phone Info related messages |
|
338 |
// ----------------------------------------------------------------------------- |
|
339 |
// |
|
340 |
void CSatMessHandler::PhoneInfoMessageReceived |
|
341 |
( |
|
342 |
const TIsiReceiveC& aIsiMessage // ISI message |
|
343 |
) |
|
344 |
{ |
|
345 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_PHONEINFOMESSAGERECEIVED, "CSatMessHandler::PhoneInfoMessageReceived" ); |
|
346 |
TFLOGSTRING("TSY:CSatMessHandler::PhoneInfoMessageReceived"); |
|
347 |
||
348 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
349 |
||
350 |
switch ( messageId ) |
|
351 |
{ |
|
352 |
case INFO_SERIAL_NUMBER_READ_RESP: |
|
353 |
{ |
|
354 |
InfoSerialNumberReadResp( aIsiMessage ); |
|
355 |
break; |
|
356 |
} |
|
357 |
case INFO_PP_READ_RESP: |
|
358 |
{ |
|
359 |
InfoPpReadResp( aIsiMessage ); |
|
360 |
break; |
|
361 |
} |
|
362 |
default: |
|
363 |
{ |
|
364 |
// do nothing |
|
365 |
break; |
|
366 |
} |
|
367 |
} |
|
368 |
} |
|
369 |
||
370 |
||
371 |
// ----------------------------------------------------------------------------- |
|
372 |
// CSatMessHandler::UiccServerMessageReceived |
|
373 |
// Called from SatMessHandler::ReceivedL, handles UICC Server messages |
|
374 |
// ----------------------------------------------------------------------------- |
|
375 |
// |
|
376 |
TBool CSatMessHandler::UiccServerMessageReceived( |
|
377 |
const TIsiReceiveC& aIsiMessage ) |
|
378 |
{ |
|
379 |
TUint8 messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
380 |
OstTraceExt1( TRACE_NORMAL, DUP3_CSATMESSHANDLER_UICCSERVERMESSAGERECEIVED, "CSatMessHandler::UiccServerMessageReceived;messageId=%hhu", messageId ); |
|
381 |
TFLOGSTRING2("TSY:CSatMessHandler::UiccServerMessageReceived, message ID: %d", messageId ); |
|
382 |
||
383 |
TBool handled( EFalse ); |
|
384 |
||
385 |
switch ( messageId ) |
|
386 |
{ |
|
387 |
case UICC_CAT_IND: |
|
388 |
{ |
|
389 |
UiccCatInd( aIsiMessage ); |
|
390 |
break; |
|
391 |
} |
|
392 |
case UICC_CAT_RESP: |
|
393 |
{ |
|
394 |
TUint8 serviceType( |
|
395 |
aIsiMessage.Get8bit( |
|
396 |
ISI_HEADER_SIZE + UICC_CAT_RESP_OFFSET_SERVICETYPE ) ); |
|
397 |
TUint8 status( |
|
398 |
aIsiMessage.Get8bit( |
|
399 |
ISI_HEADER_SIZE + UICC_CAT_RESP_OFFSET_STATUS ) ); |
|
400 |
||
401 |
TFLOGSTRING3("TSY:CSatMessHandler:: KUiccCatResp: service type %d, status %d", serviceType, status); |
|
402 |
OstTraceExt2( TRACE_NORMAL, DUP2_CSATMESSHANDLER_UICCSERVERMESSAGERECEIVED, "CSatMessHandler::KUiccCatResp;serviceType=%hhu;status=%hhu", serviceType, status ); |
|
403 |
||
404 |
// If terminal profile was sent succesfully and SAT is ready, |
|
405 |
// start fetching proactive commands |
|
406 |
if ( UICC_CAT_TERMINAL_PROFILE == serviceType && |
|
407 |
UICC_STATUS_OK == status ) |
|
408 |
{ |
|
409 |
// If SAT is not ready, CAT enable request cannot be sent yet. |
|
410 |
// When indication of SAT ready is received by satmessaging, |
|
411 |
// CAT enable request is sent if this flag is set to 'true'. |
|
412 |
iTerminalProfileSent = ETrue; |
|
413 |
||
414 |
// Enable or disable proactive command fetching depending on |
|
415 |
// flight mode status |
|
416 |
if ( iSatReady ) |
|
417 |
{ |
|
418 |
// Get instance of CSatFlightModeStatus for flight mode |
|
419 |
// status |
|
420 |
CSatFlightModeStatus* satFlightModeStatus( |
|
421 |
iTsySatMessaging->GetSatFlightModeStatus() ); |
|
422 |
if ( ! satFlightModeStatus->FlightModeStatusValue() ) |
|
423 |
{ |
|
424 |
UiccCatReq( UICC_CAT_ENABLE ); |
|
425 |
} |
|
426 |
else |
|
427 |
{ |
|
428 |
UiccCatReq( UICC_CAT_DISABLE ); |
|
429 |
} |
|
430 |
} |
|
431 |
} |
|
432 |
// Response for refresh command |
|
433 |
else if ( UICC_CAT_REFRESH == serviceType ) |
|
434 |
{ |
|
435 |
RefreshResult( status ); |
|
436 |
} |
|
437 |
// Response for polling set command |
|
438 |
else if ( UICC_CAT_POLLING_SET == serviceType ) |
|
439 |
{ |
|
440 |
SetPollingResult( |
|
441 |
status, |
|
442 |
aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ), |
|
443 |
iPollingInterval ); |
|
444 |
} |
|
445 |
// Response for envelope |
|
446 |
else if ( UICC_CAT_ENVELOPE == serviceType ) |
|
447 |
{ |
|
448 |
handled = UiccCatRespEnvelope( aIsiMessage ); |
|
449 |
} |
|
450 |
// Response for terminal response |
|
451 |
else if ( UICC_CAT_TERMINAL_RESPONSE == serviceType ) |
|
452 |
{ |
|
453 |
handled = UiccCatRespTerminalResponse( aIsiMessage ); |
|
454 |
} |
|
455 |
break; |
|
456 |
} |
|
457 |
case UICC_APPLICATION_RESP: |
|
458 |
{ |
|
459 |
TUint uiccSbClientOffset( 0 ); |
|
460 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
461 |
ISI_HEADER_SIZE + SIZE_UICC_APPLICATION_RESP, |
|
462 |
UICC_SB_CLIENT, |
|
463 |
EIsiSubBlockTypeId16Len16, |
|
464 |
uiccSbClientOffset ) ) |
|
465 |
{ |
|
466 |
iUiccClientId = aIsiMessage.Get8bit( |
|
467 |
uiccSbClientOffset + UICC_SB_CLIENT_OFFSET_CLIENTID ); |
|
468 |
} |
|
469 |
break; |
|
470 |
} |
|
471 |
case UICC_APPLICATION_IND: |
|
472 |
{ |
|
473 |
// Application ID is needed when reading data from UICC |
|
474 |
iApplicationId = aIsiMessage.Get8bit( |
|
475 |
ISI_HEADER_SIZE + UICC_APPLICATION_IND_OFFSET_APPLID ); |
|
476 |
// Access to UICC files is possible when application is active |
|
477 |
TUint8 serviceType( aIsiMessage.Get8bit( |
|
478 |
ISI_HEADER_SIZE + UICC_APPLICATION_IND_OFFSET_SERVICETYPE ) ); |
|
479 |
if ( UICC_APPL_ACTIVATED == serviceType ) |
|
480 |
{ |
|
481 |
// USIM and SIM: Read SMS-PP DD and Call Control from byte 4. |
|
482 |
// Only USIM: MO-SMS control from byte 4 |
|
483 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte4, 3 ); |
|
484 |
||
485 |
if ( UICC_CARD_TYPE_UICC == iCardType ) |
|
486 |
{ |
|
487 |
// USIM: Read call control GPRS from byte 7 |
|
488 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte7, 6 ); |
|
489 |
} |
|
490 |
else if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
491 |
{ |
|
492 |
// SIM: Read MO-SMS control from byte 5 |
|
493 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte5, 4 ); |
|
494 |
} |
|
495 |
} |
|
496 |
break; |
|
497 |
} |
|
498 |
case UICC_APPL_CMD_RESP: |
|
499 |
{ |
|
500 |
UiccApplCmdResp( aIsiMessage ); |
|
501 |
} |
|
502 |
} // End of switch ( messageId ) |
|
503 |
return handled; |
|
504 |
} |
|
505 |
||
506 |
// ----------------------------------------------------------------------------- |
|
507 |
// CSatMessHandler::SmsServerMessageReceived |
|
508 |
// Called from SatMessHandler::ReceivedL, handles SMS Server messages |
|
509 |
// ----------------------------------------------------------------------------- |
|
510 |
// |
|
511 |
void CSatMessHandler::SmsServerMessageReceived |
|
512 |
( |
|
513 |
const TIsiReceiveC& aIsiMessage // ISI message from SMS server |
|
514 |
) |
|
515 |
{ |
|
516 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SMSSERVERMESSAGERECEIVED, "CSatMessHandler::SmsServerMessageReceived" ); |
|
517 |
TFLOGSTRING("TSY:CSatMessHandler::SmsServerMessageReceived"); |
|
518 |
||
519 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
520 |
||
521 |
switch ( messageId ) |
|
522 |
{ |
|
523 |
case SMS_CB_ROUTING_RESP: |
|
524 |
{ |
|
525 |
SmsCbRoutingResp( aIsiMessage ); |
|
526 |
break; |
|
527 |
} |
|
528 |
case SMS_RESOURCE_CONF_IND: |
|
529 |
{ |
|
530 |
SmsResourceConfInd( aIsiMessage ); |
|
531 |
break; |
|
532 |
} |
|
533 |
case SMS_RESOURCE_CONF_RESP: |
|
534 |
{ |
|
535 |
// Take a log because result is always ok |
|
536 |
TFLOGSTRING("TSY:CSatMoSmsCtrl::SmsResourceConfRespReceived: Response for Resource confoguration Req, Receive response from SMS server"); |
|
537 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMOSMSCTRL_SMSRESOURCECONFRESPRECEIVED, "CSatMoSmsCtrl::SmsResourceRespReceived: Response for Resource Configuration Req, Receive response from SMS server" ); |
|
538 |
break; |
|
539 |
} |
|
540 |
default: |
|
541 |
// do nothing |
|
542 |
break; |
|
543 |
} |
|
544 |
} |
|
545 |
||
546 |
||
547 |
// ----------------------------------------------------------------------------- |
|
548 |
// CSatMessHandler::SsServerMessageReceived |
|
549 |
// Called from SatMessHandler::ReceivedL, handles SS Server messages |
|
550 |
// ----------------------------------------------------------------------------- |
|
551 |
// |
|
552 |
void CSatMessHandler::SsServerMessageReceived |
|
553 |
( |
|
554 |
const TIsiReceiveC& aIsiMessage // ISI message |
|
555 |
) |
|
556 |
{ |
|
557 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SSSERVERMESSAGERECEIVED, "CSatMessHandler::SsServerMessageReceived" ); |
|
558 |
TFLOGSTRING("TSY:CSatMessHandler::SsServerMessageReceived"); |
|
559 |
||
560 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
561 |
||
562 |
switch ( messageId ) |
|
563 |
{ |
|
564 |
case SS_STATUS_IND: |
|
565 |
{ |
|
566 |
SsStatusInd( aIsiMessage ); |
|
567 |
break; |
|
568 |
} |
|
569 |
default: |
|
570 |
// do nothing |
|
571 |
break; |
|
572 |
} |
|
573 |
} |
|
574 |
||
575 |
||
576 |
// ----------------------------------------------------------------------------- |
|
577 |
// CSatMessHandler::GsmStackServerMessageReceived |
|
578 |
// Called from SatMessHandler::ReceivedL, handles GSM Stack Server messages |
|
579 |
// ----------------------------------------------------------------------------- |
|
580 |
// |
|
581 |
void CSatMessHandler::GsmStackServerMessageReceived |
|
582 |
( |
|
583 |
const TIsiReceiveC& aIsiMessage // ISI message |
|
584 |
) |
|
585 |
{ |
|
586 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSMSTACKSERVERMESSAGERECEIVED, "CSatMessHandler::GsmStackServerMessageReceived" ); |
|
587 |
TFLOGSTRING("TSY:CSatMessHandler::GsmStackServerMessageReceived"); |
|
588 |
||
589 |
switch ( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ) |
|
590 |
{ |
|
591 |
case GSS_CS_SERVICE_RESP: |
|
592 |
{ |
|
593 |
GssCsServiceResp( aIsiMessage ); |
|
594 |
break; |
|
595 |
} |
|
596 |
case GSS_CS_SERVICE_FAIL_RESP: |
|
597 |
{ |
|
598 |
GssCsServiceFailResp( aIsiMessage ); |
|
599 |
break; |
|
600 |
} |
|
601 |
default: |
|
602 |
{ |
|
603 |
// do nothing |
|
604 |
break; |
|
605 |
} |
|
606 |
} |
|
607 |
} |
|
608 |
||
609 |
||
610 |
// ----------------------------------------------------------------------------- |
|
611 |
// CSatMessHandler::DisplayTextTerminalResp |
|
612 |
// Constructs DisplayText specific part of terminal |
|
613 |
// response and calls SendTerminalResponse to send the terminal response. |
|
614 |
// ----------------------------------------------------------------------------- |
|
615 |
// |
|
616 |
TInt CSatMessHandler::DisplayTextTerminalResp |
|
617 |
( |
|
618 |
TUint8 aTransId, // Transaction id |
|
619 |
TDes8& aCommandDetails, // PCmd number |
|
620 |
TUint8 aGeneralResult, // General Result |
|
621 |
TUint8 aAdditionalInfo // Additional info |
|
622 |
) |
|
623 |
{ |
|
624 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_DISPLAYTEXTTERMINALRESP, "CSatMessHandler::DisplayTextTerminalResp" ); |
|
625 |
TFLOGSTRING("TSY:CSatMessHandler::DisplayTextTerminalResp"); |
|
626 |
||
627 |
TTlv tlvSpecificData; |
|
628 |
// Create General Result TLV here |
|
629 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
630 |
||
631 |
// General result |
|
632 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
633 |
||
634 |
if ( KMeCurrentlyUnableToProcessCommand == aGeneralResult ) |
|
635 |
{ |
|
636 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
637 |
} |
|
638 |
||
639 |
return UiccCatReqTerminalResponse( |
|
640 |
aCommandDetails, |
|
641 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
642 |
aTransId ); |
|
643 |
} |
|
644 |
||
645 |
// ----------------------------------------------------------------------------- |
|
646 |
// CSatMessHandler::GetInkeyTerminalResp |
|
647 |
// Constructs GetInkey specific part of terminal |
|
648 |
// response and calls SendTerminalResponse to send the terminal response. |
|
649 |
// ----------------------------------------------------------------------------- |
|
650 |
// |
|
651 |
TInt CSatMessHandler::GetInkeyTerminalResp |
|
652 |
( |
|
653 |
const TUint8 aTransId, // Transaction id |
|
654 |
const TDes8& aCommandDetails, // PCmd number |
|
655 |
const RSat::TGetInkeyRspV2& aRsp // Response packet from Etel |
|
656 |
) |
|
657 |
{ |
|
658 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GETINKEYTERMINALRESP, "CSatMessHandler::GetInkeyTerminalResp" ); |
|
659 |
TFLOGSTRING("TSY:CSatMessHandler::GetInkeyTerminalRespL"); |
|
660 |
||
661 |
TTlv tlvSpecificData; |
|
662 |
||
663 |
//General result |
|
664 |
TUint8 result( aRsp.iGeneralResult ); |
|
665 |
||
666 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
667 |
tlvSpecificData.AddByte( result ); |
|
668 |
||
669 |
if ( CommandPerformedSuccessfully( result ) ) |
|
670 |
{ |
|
671 |
TUint8 dcs( K8BitDCS ); // Default |
|
672 |
TBuf8<2> character; // Unicode has 2 bytes |
|
673 |
||
674 |
// Text String Tlv |
|
675 |
if ( NULL != aRsp.iAdditionalInfo.Length() ) |
|
676 |
{ |
|
677 |
// Response contain on one character |
|
678 |
TPtrC16 unicodeChar( aRsp.iAdditionalInfo.Mid( 0, 1 ) ); |
|
679 |
switch ( aRsp.iRspFormat ) |
|
680 |
{ |
|
681 |
case RSat::ECharUcs2Alphabet: |
|
682 |
{ |
|
683 |
dcs = KUCS2DCS; |
|
684 |
TIsiUtility::CopyToBigEndian( unicodeChar, character ); |
|
685 |
break; |
|
686 |
} |
|
687 |
case RSat::EDigitOnly: |
|
688 |
case RSat::ECharSmsDefaultAlphabet: |
|
689 |
case RSat::EYesNo: |
|
690 |
default: |
|
691 |
{ |
|
692 |
// Dcs already set to K8BitDCS |
|
693 |
TSatUtility::ConvertUnicode16ToSms7( |
|
694 |
character, unicodeChar ); |
|
695 |
break; |
|
696 |
} |
|
697 |
} |
|
698 |
} |
|
699 |
else |
|
700 |
{ |
|
701 |
// Just in case |
|
702 |
dcs = K8BitDCS; |
|
703 |
character.Copy( NULL ); |
|
704 |
} |
|
705 |
||
706 |
tlvSpecificData.AddTag( KTlvTextStringTag ); |
|
707 |
tlvSpecificData.AddByte( dcs ); |
|
708 |
tlvSpecificData.AddData( character ); |
|
709 |
} |
|
710 |
else if ( RSat::KNoAdditionalInfo != aRsp.iInfoType ) |
|
711 |
{ |
|
712 |
// Command not successfull |
|
713 |
if ( NULL != aRsp.iAdditionalInfo.Length() ) |
|
714 |
{ |
|
715 |
tlvSpecificData.AddByte( TUint8 ( aRsp.iAdditionalInfo[0] ) ); |
|
716 |
} |
|
717 |
} |
|
718 |
else |
|
719 |
{ |
|
720 |
// Command was not successful but additional info was not provided |
|
721 |
} |
|
722 |
||
723 |
// Append Duration TLV, if provided |
|
724 |
TInt tlvTimeUnit( KErrNotFound ); |
|
725 |
switch ( aRsp.iDuration.iTimeUnit ) |
|
726 |
{ |
|
727 |
case RSat::EMinutes: |
|
728 |
{ |
|
729 |
tlvTimeUnit = KMinutes; |
|
730 |
break; |
|
731 |
} |
|
732 |
case RSat::ESeconds: |
|
733 |
{ |
|
734 |
tlvTimeUnit = KSeconds; |
|
735 |
break; |
|
736 |
} |
|
737 |
case RSat::ETenthsOfSeconds: |
|
738 |
{ |
|
739 |
tlvTimeUnit = KTenthsOfSeconds; |
|
740 |
break; |
|
741 |
} |
|
742 |
case RSat::ETimeUnitNotSet: |
|
743 |
case RSat::ENoDurationAvailable: |
|
744 |
default: |
|
745 |
{ |
|
746 |
// Duration is not added to terminal response |
|
747 |
break; |
|
748 |
} |
|
749 |
} |
|
750 |
if ( KErrNotFound != tlvTimeUnit ) |
|
751 |
{ |
|
752 |
// Duration provided. Append it to terminal response. |
|
753 |
tlvSpecificData.AddTag( KTlvDurationTag ); |
|
754 |
tlvSpecificData.AddByte( tlvTimeUnit ); |
|
755 |
tlvSpecificData.AddByte( aRsp.iDuration.iNumOfUnits ); |
|
756 |
} |
|
757 |
||
758 |
return UiccCatReqTerminalResponse( |
|
759 |
aCommandDetails, |
|
760 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
761 |
aTransId ); |
|
762 |
||
763 |
} |
|
764 |
||
765 |
// ----------------------------------------------------------------------------- |
|
766 |
// CSatMessHandler::GetInputTerminalResp |
|
767 |
// Constructs Get Input specific part of terminal |
|
768 |
// response and calls SendTerminalResponse to send the terminal response. |
|
769 |
// ----------------------------------------------------------------------------- |
|
770 |
// |
|
771 |
TInt CSatMessHandler::GetInputTerminalResp |
|
772 |
( |
|
773 |
TUint8 aTransId, // Transaction id |
|
774 |
TDes8& aCommandDetails, // Command details tlv |
|
775 |
TUint8 aGeneralResult, // General result |
|
776 |
TUint8 aAdditionalInfo, // Additional info |
|
777 |
TDesC16& aTextString, // Response string |
|
778 |
TUint8 aDataCodingScheme // Coding scheme |
|
779 |
) |
|
780 |
{ |
|
781 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GETINPUTTERMINALRESP, "CSatMessHandler::GetInputTerminalResp" ); |
|
782 |
TFLOGSTRING("TSY:CSatMessHandler::GetInputTerminalResp"); |
|
783 |
||
784 |
TTlv tlvSpecificData; |
|
785 |
TBuf8<KGetInputStringMaxSize> string; |
|
786 |
||
787 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
788 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
789 |
if ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
790 |
{ |
|
791 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
792 |
} |
|
793 |
||
794 |
if ( CommandPerformedSuccessfully( aGeneralResult ) ) |
|
795 |
{ |
|
796 |
// create TextString TLV |
|
797 |
tlvSpecificData.AddTag( KTlvTextStringTag ); |
|
798 |
||
799 |
if ( aTextString.Length() ) |
|
800 |
{ |
|
801 |
switch ( aDataCodingScheme ) |
|
802 |
{ |
|
803 |
case RSat::EUcs2Alphabet: |
|
804 |
{ |
|
805 |
// data coding scheme UCS2 (16-bit) |
|
806 |
tlvSpecificData.AddByte( KUCS2DCS ); |
|
807 |
||
808 |
if ( aTextString.Length() ) |
|
809 |
{ |
|
810 |
TIsiUtility::CopyToBigEndian( aTextString, string ); |
|
811 |
tlvSpecificData.AddData( string ); |
|
812 |
} |
|
813 |
break; |
|
814 |
} |
|
815 |
||
816 |
case RSat::EDigitOnlyPacked: |
|
817 |
case RSat::ESmsDefaultAlphabetPacked: |
|
818 |
{ |
|
819 |
// data coding scheme 7-bit default sms |
|
820 |
tlvSpecificData.AddByte( K7BitDefaultSmsDCS ); |
|
821 |
TSatUtility::UCSToPacket7( aTextString, string ); |
|
822 |
tlvSpecificData.AddData( string ); |
|
823 |
break; |
|
824 |
} |
|
825 |
||
826 |
case RSat::EDigitOnlyUnpacked: |
|
827 |
case RSat::ESmsDefaultAlphabetUnpacked: |
|
828 |
{ |
|
829 |
// data coding scheme 8-bit |
|
830 |
tlvSpecificData.AddByte( K8BitDCS ); |
|
831 |
TSatUtility::ConvertUnicode16ToSms7( string, aTextString ); |
|
832 |
tlvSpecificData.AddData( string ); |
|
833 |
break; |
|
834 |
} |
|
835 |
default: |
|
836 |
// do nothing |
|
837 |
break; |
|
838 |
} |
|
839 |
} |
|
840 |
} |
|
841 |
||
842 |
return UiccCatReqTerminalResponse( |
|
843 |
aCommandDetails, |
|
844 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
845 |
aTransId ); |
|
846 |
} |
|
847 |
||
848 |
// ----------------------------------------------------------------------------- |
|
849 |
// CSatMessHandler::PlayToneTerminateResponse |
|
850 |
// Constructs PlayTone specific part of terminal |
|
851 |
// response and calls SendTerminalResponse to send the terminal response. |
|
852 |
// ----------------------------------------------------------------------------- |
|
853 |
// |
|
854 |
TInt CSatMessHandler::PlayToneTerminalResp |
|
855 |
( |
|
856 |
TUint8 aTransId, // Transaction Id |
|
857 |
TDes8& aCommandDetails, // Command details |
|
858 |
TUint8 aGeneralResult, // General result |
|
859 |
TUint8 aAdditionalInfo // Additional info |
|
860 |
) |
|
861 |
{ |
|
862 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_PLAYTONETERMINALRESP, "CSatMessHandler::PlayToneTerminalResp" ); |
|
863 |
TFLOGSTRING("TSY:CSatMessHandler::PlayToneTerminalResp"); |
|
864 |
||
865 |
TTlv tlvSpecificData; |
|
866 |
||
867 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
868 |
//General result |
|
869 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
870 |
if ( AdditionalInfoNeeded( aGeneralResult ) ) |
|
871 |
{ |
|
872 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
873 |
} |
|
874 |
||
875 |
return UiccCatReqTerminalResponse( |
|
876 |
aCommandDetails, |
|
877 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
878 |
aTransId ); |
|
879 |
} |
|
880 |
||
881 |
||
882 |
// ----------------------------------------------------------------------------- |
|
883 |
// CSatMessHandler::SetUpMenuTerminalResp |
|
884 |
// Constructs SetUpMenu specific part of terminal |
|
885 |
// response and calls SendTerminalResponse to send the terminal response. |
|
886 |
// ----------------------------------------------------------------------------- |
|
887 |
// |
|
888 |
TInt CSatMessHandler::SetUpMenuTerminalResp |
|
889 |
( |
|
890 |
TUint8 aTransId, // Transaction id |
|
891 |
TDes8& aCommandDetails, // aPCmdNumber |
|
892 |
TUint8 aGeneralResult, // General result |
|
893 |
TUint8 aAdditionalInfo // Additional info |
|
894 |
) |
|
895 |
{ |
|
896 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SETUPMENUTERMINALRESP, "CSatMessHandler::SetUpMenuTerminalResp" ); |
|
897 |
TFLOGSTRING("TSY:CSatMessHandler::SetUpMenuTerminalResp"); |
|
898 |
||
899 |
// Create and append response data |
|
900 |
TTlv tlvSpecificData; |
|
901 |
||
902 |
//create General Result TLV here |
|
903 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
904 |
||
905 |
//General result |
|
906 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
907 |
||
908 |
if ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
909 |
{ |
|
910 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
911 |
} |
|
912 |
||
913 |
return UiccCatReqTerminalResponse( |
|
914 |
aCommandDetails, |
|
915 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
916 |
aTransId ); |
|
917 |
} |
|
918 |
||
919 |
// ----------------------------------------------------------------------------- |
|
920 |
// CSatMessHandler::SelectItemTerminalResp |
|
921 |
// Constructs SelectItem specific part of terminal |
|
922 |
// response and calls SendTerminalResponse to send the terminal response. |
|
923 |
// ----------------------------------------------------------------------------- |
|
924 |
// |
|
925 |
TInt CSatMessHandler::SelectItemTerminalResp |
|
926 |
( |
|
927 |
TUint8 aTransId, // Transaction id |
|
928 |
TDes8& aCommandDetails, // Comamnd number |
|
929 |
TUint8 aGeneralResult, // General result |
|
930 |
TUint8 aAdditionalInfo // Additional info |
|
931 |
) |
|
932 |
{ |
|
933 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SELECTITEMTERMINALRESP, "CSatMessHandler::SelectItemTerminalResp" ); |
|
934 |
TFLOGSTRING("TSY:CSatMessHandler::SelectItemTerminalResp"); |
|
935 |
||
936 |
TTlv tlvSpecificData; |
|
937 |
// Create general result TLV here |
|
938 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
939 |
// General result |
|
940 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
941 |
||
942 |
if ( !( CommandPerformedSuccessfully( aGeneralResult ) ) ) |
|
943 |
{ |
|
944 |
switch ( aGeneralResult ) |
|
945 |
{ |
|
946 |
case RSat::KHelpRequestedByUser: |
|
947 |
{ |
|
948 |
// add selected Item Id tag |
|
949 |
tlvSpecificData.AddTag( KTlvItemIdentifierTag ); |
|
950 |
tlvSpecificData.AddByte( aAdditionalInfo ); // selected item |
|
951 |
break; |
|
952 |
} |
|
953 |
case RSat::KPSessionTerminatedByUser: |
|
954 |
case RSat::KBackwardModeRequestedByUser: |
|
955 |
case RSat::KNoResponseFromUser: |
|
956 |
{ |
|
957 |
break; |
|
958 |
} |
|
959 |
default: |
|
960 |
{ |
|
961 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
962 |
break; |
|
963 |
} |
|
964 |
} |
|
965 |
} |
|
966 |
else |
|
967 |
{ |
|
968 |
// add selected Item Id tag |
|
969 |
tlvSpecificData.AddTag( KTlvItemIdentifierTag ); |
|
970 |
tlvSpecificData.AddByte( aAdditionalInfo ); // selected item |
|
971 |
} |
|
972 |
||
973 |
return UiccCatReqTerminalResponse( |
|
974 |
aCommandDetails, |
|
975 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
976 |
aTransId ); |
|
977 |
} |
|
978 |
||
979 |
// ----------------------------------------------------------------------------- |
|
980 |
// CSatMessHandler::PollIntervalTerminateResp |
|
981 |
// Constructs PollInterval specific part of terminal |
|
982 |
// response and calls SendTerminalResponse to send the terminal response. |
|
983 |
// ----------------------------------------------------------------------------- |
|
984 |
// |
|
985 |
TInt CSatMessHandler::PollIntervalTerminalResp |
|
986 |
( |
|
987 |
TUint8 aTransId, // Transaction id |
|
988 |
TDes8& aCommandDetails, // command number |
|
989 |
TUint8 aGeneralResult, // General result |
|
990 |
TUint8 aAdditionalInfo, // Additional info |
|
991 |
TUint8 aNumOfUnits // Time interval |
|
992 |
) |
|
993 |
{ |
|
994 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_POLLINTERVALTERMINALRESP, "CSatMessHandler::PollIntervalTerminalResp" ); |
|
995 |
TFLOGSTRING("TSY:CSatMessHandler::PollIntervalTerminalResp"); |
|
996 |
||
997 |
TTlv tlvSpecificData; |
|
998 |
||
999 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1000 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1001 |
||
1002 |
if ( !( CommandPerformedSuccessfully( aGeneralResult ) ) ) |
|
1003 |
{ |
|
1004 |
switch ( aGeneralResult ) |
|
1005 |
{ |
|
1006 |
// Cases in which additional info is not required |
|
1007 |
case RSat::KPSessionTerminatedByUser: |
|
1008 |
case RSat::KBackwardModeRequestedByUser: |
|
1009 |
case RSat::KNoResponseFromUser: |
|
1010 |
case RSat::KErrorRequiredValuesMissing: |
|
1011 |
case RSat::KHelpRequestedByUser: |
|
1012 |
{ |
|
1013 |
break; |
|
1014 |
} |
|
1015 |
default: |
|
1016 |
{ |
|
1017 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1018 |
break; |
|
1019 |
} |
|
1020 |
} |
|
1021 |
} |
|
1022 |
else |
|
1023 |
{ |
|
1024 |
tlvSpecificData.AddTag( KTlvDurationTag ); |
|
1025 |
tlvSpecificData.AddByte( KSeconds ); |
|
1026 |
tlvSpecificData.AddByte( aNumOfUnits ); |
|
1027 |
} |
|
1028 |
||
1029 |
return UiccCatReqTerminalResponse( |
|
1030 |
aCommandDetails, |
|
1031 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1032 |
aTransId ); |
|
1033 |
} |
|
1034 |
||
1035 |
// ----------------------------------------------------------------------------- |
|
1036 |
// CSatMessHandler::SendSmTerminalResp |
|
1037 |
// Constructs SendSm specific part of terminal |
|
1038 |
// response and calls SendTerminalResponse to send the terminal response. |
|
1039 |
// ----------------------------------------------------------------------------- |
|
1040 |
// |
|
1041 |
TInt CSatMessHandler::SendSmTerminalResp |
|
1042 |
( |
|
1043 |
TUint8 aTransId, // Transaction id |
|
1044 |
TDes8& aCommandDetails, // Command details |
|
1045 |
TUint8 aGeneralResult, // General result |
|
1046 |
TUint8 aAdditionalInfo // Additional info |
|
1047 |
) |
|
1048 |
{ |
|
1049 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDSMTERMINALRESP, "CSatMessHandler::SendSmTerminalResp" ); |
|
1050 |
TFLOGSTRING("TSY:CSatMessHandler::SendSmTerminalResp"); |
|
1051 |
||
1052 |
// Create and append response data |
|
1053 |
TTlv tlvSpecificData; |
|
1054 |
||
1055 |
//create General Result TLV here |
|
1056 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1057 |
||
1058 |
//General result |
|
1059 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1060 |
||
1061 |
if ( RSat::KMeUnableToProcessCmd == aGeneralResult || |
|
1062 |
RSat::KNetworkUnableToProcessCmd == aGeneralResult || |
|
1063 |
RSat::KSmsRpError == aGeneralResult || |
|
1064 |
RSat::KInteractionWithCCPermanentError == aGeneralResult ) |
|
1065 |
{ |
|
1066 |
// if there is ME, Network or SMS error, append additional info |
|
1067 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1068 |
} |
|
1069 |
// Send terminal response |
|
1070 |
return UiccCatReqTerminalResponse( |
|
1071 |
aCommandDetails, |
|
1072 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1073 |
aTransId ); |
|
1074 |
} |
|
1075 |
||
1076 |
// ----------------------------------------------------------------------------- |
|
1077 |
// CSatMessHandler::SendSsTerminalResp |
|
1078 |
// Constructs SendSS specific part of terminal |
|
1079 |
// response and calls SendTerminalResponse to send the terminal response. |
|
1080 |
// ----------------------------------------------------------------------------- |
|
1081 |
// |
|
1082 |
TInt CSatMessHandler::SendSsTerminalResp |
|
1083 |
( |
|
1084 |
TUint8 aTransId, // Transaction id |
|
1085 |
TDes8& aCommandDetails, // Command details tlv |
|
1086 |
TUint8 aGeneralResult, // General result |
|
1087 |
TDesC8& aAdditionalInfo // Additional info |
|
1088 |
) |
|
1089 |
{ |
|
1090 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDSSTERMINALRESP, "CSatMessHandler::SendSsTerminalResp" ); |
|
1091 |
TFLOGSTRING("TSY:CSatMessHandler::SendSsTerminalResp"); |
|
1092 |
||
1093 |
// Create and append response data |
|
1094 |
TTlv tlvSpecificData; |
|
1095 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1096 |
// Append general result |
|
1097 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1098 |
||
1099 |
if ( RSat::KErrorRequiredValuesMissing != aGeneralResult && |
|
1100 |
RSat::KCmdDataNotUnderstood != aGeneralResult ) |
|
1101 |
{ |
|
1102 |
tlvSpecificData.AddData( aAdditionalInfo ); |
|
1103 |
} |
|
1104 |
||
1105 |
return UiccCatReqTerminalResponse( |
|
1106 |
aCommandDetails, |
|
1107 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1108 |
aTransId ); |
|
1109 |
} |
|
1110 |
||
1111 |
// ----------------------------------------------------------------------------- |
|
1112 |
// CSatMessHandler::SendDtmfTerminalResp |
|
1113 |
// Constructs Send Dtmf specific part of terminal |
|
1114 |
// response and calls SendTerminalResponse to send the terminal response. |
|
1115 |
// ----------------------------------------------------------------------------- |
|
1116 |
// |
|
1117 |
TInt CSatMessHandler::SendDtmfTerminalResp |
|
1118 |
( |
|
1119 |
TUint8 aTransId, |
|
1120 |
TDes8& aCommandDetails, |
|
1121 |
TUint8 aGeneralResult, // General result |
|
1122 |
TUint8 aAdditionalInfo // Additional info |
|
1123 |
) |
|
1124 |
{ |
|
1125 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDDTMFTERMINALRESP, "CSatMessHandler::SendDtmfTerminalResp" ); |
|
1126 |
TFLOGSTRING("CSatMessHandler::SendDtmfTerminalResp"); |
|
1127 |
||
1128 |
TTlv tlvSpecificData; |
|
1129 |
// Append general result tag |
|
1130 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1131 |
// Append general result |
|
1132 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1133 |
||
1134 |
if ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
1135 |
{ |
|
1136 |
// UnSuccessful result neccessitating additional info byte |
|
1137 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1138 |
} |
|
1139 |
||
1140 |
return UiccCatReqTerminalResponse( |
|
1141 |
aCommandDetails, |
|
1142 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1143 |
aTransId ); |
|
1144 |
} |
|
1145 |
||
1146 |
// ----------------------------------------------------------------------------- |
|
1147 |
// CSatMessHandler::SendUssdTerminalResponse |
|
1148 |
// Constructs and sends the Send USSD response to Phonet, in order |
|
1149 |
// to reach the CellMo side. |
|
1150 |
// ----------------------------------------------------------------------------- |
|
1151 |
// |
|
1152 |
TInt CSatMessHandler::SendUssdTerminalResp |
|
1153 |
( |
|
1154 |
TUint8 aTransId, |
|
1155 |
TDes8& aCommandDetails, |
|
1156 |
TUint8 aGeneralResult, |
|
1157 |
TUint8 aAdditionalInfo, |
|
1158 |
TDes& aUssdData, |
|
1159 |
TUint8 aUssdCbsDataCodingScheme |
|
1160 |
) |
|
1161 |
{ |
|
1162 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDUSSDTERMINALRESP, "CSatMessHandler::SendUssdTerminalResp" ); |
|
1163 |
TFLOGSTRING("TSY:CSatMessHandler::SendUssdTerminalResp"); |
|
1164 |
||
1165 |
TTlv tlvSpecificData; |
|
1166 |
TBuf8<RSat::KStringMaxSize> string; |
|
1167 |
||
1168 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1169 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1170 |
||
1171 |
// For the general results '20', '21', '37', '38' |
|
1172 |
// it is mandatory for the ME to provide a specific |
|
1173 |
// cause value as additional |
|
1174 |
if ( ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
1175 |
|| ( RSat::KNetworkUnableToProcessCmd == aGeneralResult ) |
|
1176 |
|| ( RSat::KUssdReturnError == aGeneralResult) |
|
1177 |
|| ( RSat::KMultipleCardCmdsError == aGeneralResult) ) |
|
1178 |
{ |
|
1179 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1180 |
} |
|
1181 |
// For general result '32' additional info or text string is not used |
|
1182 |
else if ( RSat::KCmdDataNotUnderstood != aGeneralResult ) |
|
1183 |
{ |
|
1184 |
// Append received Ussd text string, with a Text string tag |
|
1185 |
tlvSpecificData.AddTag( KTlvTextStringTag ); |
|
1186 |
||
1187 |
// Decode DCS |
|
1188 |
// Remains to know if SatServer sets the general result to |
|
1189 |
// KUssdReturnError when the DCS has a reserved value. |
|
1190 |
TSmsDcs decodedDcs( ESmsUnknownOrReservedDcs ); |
|
1191 |
decodedDcs = TSatUtility::DecodeCbsDcs( aUssdCbsDataCodingScheme ); |
|
1192 |
//Data Coding Scheme for Text String |
|
1193 |
tlvSpecificData.AddByte( (TUint8)decodedDcs ); |
|
1194 |
switch ( decodedDcs ) |
|
1195 |
{ |
|
1196 |
case ESms7BitDcs: |
|
1197 |
{ |
|
1198 |
// Convert the Response string (which comes in the form of |
|
1199 |
// a TBuf (unicode)) to 7-bit gsm format. |
|
1200 |
TSatUtility::UCSToPacket7( aUssdData, string ); |
|
1201 |
break; |
|
1202 |
} |
|
1203 |
case ESms8BitDcs: |
|
1204 |
{ |
|
1205 |
// Convert the Response string (which comes in the form of |
|
1206 |
// a TBuf (unicode)) to 7-bit gsm format. |
|
1207 |
TSatUtility::ConvertUnicode16ToSms7( string, aUssdData ); |
|
1208 |
break; |
|
1209 |
} |
|
1210 |
case ESms16BitDcs: |
|
1211 |
{ |
|
1212 |
TIsiUtility::CopyToBigEndian( aUssdData, string ); |
|
1213 |
break; |
|
1214 |
} |
|
1215 |
default: |
|
1216 |
{ |
|
1217 |
// Reserved |
|
1218 |
// The general result should in fact prevent reaching this |
|
1219 |
// branch of the switch. |
|
1220 |
TFLOGSTRING("TSY:CSatMessHandler::SendUssdTerminalResp, \ |
|
1221 |
The DCS sent by the network has a reserved value."); |
|
1222 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_SENDUSSDTERMINALRESP, "CSatMessHandler::SendUssdTerminalResp, The DCS sent by the network has a reserved value." ); |
|
1223 |
break; |
|
1224 |
} |
|
1225 |
} |
|
1226 |
// Text |
|
1227 |
tlvSpecificData.AddData( string ); |
|
1228 |
} |
|
1229 |
||
1230 |
return UiccCatReqTerminalResponse( |
|
1231 |
aCommandDetails, |
|
1232 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1233 |
aTransId ); |
|
1234 |
} |
|
1235 |
||
1236 |
// ----------------------------------------------------------------------------- |
|
1237 |
// CSatMessHandler::SetUpCallTerminalResp |
|
1238 |
// Constructs SetUpCall specific part of terminal |
|
1239 |
// response and calls SendTerminalResponse to send the terminal response |
|
1240 |
// ----------------------------------------------------------------------------- |
|
1241 |
// |
|
1242 |
TInt CSatMessHandler::SetUpCallTerminalResp |
|
1243 |
( |
|
1244 |
TUint8 aTransId, // Transaction id |
|
1245 |
TDes8& aCommandDetails, // Command Details tlv |
|
1246 |
TUint8 aGeneralResult, // General result |
|
1247 |
TUint8 aAdditionalInfo // Additional info |
|
1248 |
) |
|
1249 |
{ |
|
1250 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SETUPCALLTERMINALRESP, "CSatMessHandler::SetUpCallTerminalResp" ); |
|
1251 |
TFLOGSTRING("TSY:CSatMessHandler::SetUpCallTerminalResp"); |
|
1252 |
||
1253 |
// Create and append response data |
|
1254 |
TTlv tlvSpecificData; |
|
1255 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1256 |
// Result |
|
1257 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1258 |
||
1259 |
if ( RSat::KMeUnableToProcessCmd == aGeneralResult || |
|
1260 |
RSat::KNetworkUnableToProcessCmd == aGeneralResult || |
|
1261 |
RSat::KInteractionWithCCPermanentError == aGeneralResult ) |
|
1262 |
{ |
|
1263 |
// If there was ME or network error, add additional info |
|
1264 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1265 |
} |
|
1266 |
||
1267 |
return UiccCatReqTerminalResponse( |
|
1268 |
aCommandDetails, |
|
1269 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1270 |
aTransId ); |
|
1271 |
} |
|
1272 |
||
1273 |
// ----------------------------------------------------------------------------- |
|
1274 |
// CSatMessHandler::RefreshTerminalResp |
|
1275 |
// Constructs Refresh specific part of terminal |
|
1276 |
// response and calls SendTerminalResponse to send the terminal response |
|
1277 |
// ----------------------------------------------------------------------------- |
|
1278 |
// |
|
1279 |
TInt CSatMessHandler::RefreshTerminalResp |
|
1280 |
( |
|
1281 |
TUint8 aTransId, // Transaction id |
|
1282 |
TDes8& aCommandDetails, // Command number |
|
1283 |
TUint8 aGeneralResult, // General result |
|
1284 |
TUint8 aAdditionalInfo // Additional info |
|
1285 |
) |
|
1286 |
{ |
|
1287 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_REFRESHTERMINALRESP, "CSatMessHandler::RefreshTerminalResp" ); |
|
1288 |
TFLOGSTRING("TSY:CSatMessHandler::RefreshTerminalResp"); |
|
1289 |
||
1290 |
// Create and append response data |
|
1291 |
TTlv tlvSpecificData; |
|
1292 |
// append result tag |
|
1293 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1294 |
||
1295 |
// General result |
|
1296 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1297 |
||
1298 |
if ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
1299 |
{ |
|
1300 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1301 |
} |
|
1302 |
||
1303 |
return UiccCatReqTerminalResponse( |
|
1304 |
aCommandDetails, |
|
1305 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1306 |
aTransId ); |
|
1307 |
} |
|
1308 |
||
1309 |
// ----------------------------------------------------------------------------- |
|
1310 |
// CSatMessHandler::MenuSelectionInd |
|
1311 |
// Constructs and sends the Menu Selection response to phonet |
|
1312 |
// ----------------------------------------------------------------------------- |
|
1313 |
// |
|
1314 |
void CSatMessHandler::MenuSelectionInd |
|
1315 |
( |
|
1316 |
TUint8 aTransId, // Transaction id |
|
1317 |
TUint8 aItemIdentifier, // Item identifier |
|
1318 |
TUint8 aHelp // Help requested status |
|
1319 |
) |
|
1320 |
{ |
|
1321 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_MENUSELECTIONIND, "CSatMessHandler::MenuSelectionInd" ); |
|
1322 |
TFLOGSTRING("TSY:CSatMessHandler::MenuSelectionInd"); |
|
1323 |
||
1324 |
TTlv tlvSpecificData; |
|
1325 |
||
1326 |
tlvSpecificData.Begin( KBerTlvMenuSelectionTag ); |
|
1327 |
tlvSpecificData.AddTag( KTlvDeviceIdentityTag ); |
|
1328 |
tlvSpecificData.AddByte( KKeypad ); |
|
1329 |
tlvSpecificData.AddByte( KSim ); |
|
1330 |
tlvSpecificData.AddTag( KTlvItemIdentifierTag ); |
|
1331 |
tlvSpecificData.AddByte( aItemIdentifier ); |
|
1332 |
if ( aHelp ) |
|
1333 |
{ |
|
1334 |
tlvSpecificData.AddTag( KTlvHelpRequestTag ); |
|
1335 |
} |
|
1336 |
||
1337 |
// Save menu selection envelope's transaction id, because SIM session |
|
1338 |
// has to be completed if menu selection does not have successive commands. |
|
1339 |
iTerminalRespTraId = TInt( aTransId ); |
|
1340 |
UiccCatReqEnvelope( aTransId, tlvSpecificData.End(), EFalse ); |
|
1341 |
} |
|
1342 |
||
1343 |
// ----------------------------------------------------------------------------- |
|
1344 |
// CSatMessHandler::LaunchBrowserTerminalResp |
|
1345 |
// Constructs and sends the Launch Browser response to phonet |
|
1346 |
// ----------------------------------------------------------------------------- |
|
1347 |
// |
|
1348 |
TInt CSatMessHandler::LaunchBrowserTerminalResp |
|
1349 |
( |
|
1350 |
TUint8 aTransId, // aTransId |
|
1351 |
TDes8& aCommandDetails, // command number |
|
1352 |
TUint8 aGeneralResult, // Result |
|
1353 |
TUint8 aAdditionalInfo // additional info |
|
1354 |
) |
|
1355 |
{ |
|
1356 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_LAUNCHBROWSERTERMINALRESP, "CSatMessHandler::LaunchBrowserTerminalResp" ); |
|
1357 |
TFLOGSTRING("TSY:CSatMessHandler::LaunchBrowserTerminalResp"); |
|
1358 |
||
1359 |
TTlv tlvSpecificData; |
|
1360 |
||
1361 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1362 |
//create General Result TLV here |
|
1363 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1364 |
if ( !( CommandPerformedSuccessfully( aGeneralResult ) ) ) |
|
1365 |
{ |
|
1366 |
if ( RSat::KCmdTypeNotUnderstood != aGeneralResult |
|
1367 |
&& RSat::KCmdDataNotUnderstood != aGeneralResult |
|
1368 |
&& RSat::KErrorRequiredValuesMissing != aGeneralResult ) |
|
1369 |
{ |
|
1370 |
// additional info |
|
1371 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1372 |
} |
|
1373 |
} |
|
1374 |
||
1375 |
return UiccCatReqTerminalResponse( |
|
1376 |
aCommandDetails, |
|
1377 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1378 |
aTransId ); |
|
1379 |
} |
|
1380 |
||
1381 |
||
1382 |
// ----------------------------------------------------------------------------- |
|
1383 |
// CSatMessHandler::CommandPerformedSuccessfully |
|
1384 |
// Test if a proactive command was performed successfully |
|
1385 |
// ----------------------------------------------------------------------------- |
|
1386 |
// |
|
1387 |
TBool CSatMessHandler::CommandPerformedSuccessfully |
|
1388 |
( |
|
1389 |
TUint8 aGeneralResult |
|
1390 |
) |
|
1391 |
{ |
|
1392 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_COMMANDPERFORMEDSUCCESSFULLY, "CSatMessHandler::CommandPerformedSuccessfully" ); |
|
1393 |
TFLOGSTRING("TSY:CSatMessHandler::CommandPerformedSuccessfully"); |
|
1394 |
||
1395 |
TBool ret( EFalse ); |
|
1396 |
switch ( aGeneralResult ) |
|
1397 |
{ |
|
1398 |
case RSat::KSuccess: |
|
1399 |
case RSat::KPartialComprehension: |
|
1400 |
case RSat::KMissingInformation: |
|
1401 |
case RSat::KRefreshAdditionEFRead: |
|
1402 |
case RSat::KSuccessRequestedIconNotDisplayed: |
|
1403 |
case RSat::KModifiedByCallControl: |
|
1404 |
case RSat::KSuccessLimitedService: |
|
1405 |
case RSat::KPerformedWithModifications: |
|
1406 |
case RSat::KRefreshUSIMNotActive: |
|
1407 |
{ |
|
1408 |
ret = ETrue; |
|
1409 |
break; |
|
1410 |
} |
|
1411 |
default: |
|
1412 |
{ |
|
1413 |
ret = EFalse; |
|
1414 |
break; |
|
1415 |
} |
|
1416 |
} |
|
1417 |
return ret; |
|
1418 |
} |
|
1419 |
||
1420 |
||
1421 |
// ----------------------------------------------------------------------------- |
|
1422 |
// CSatMessHandler::SetUpIdleModeTextTerminalResp |
|
1423 |
// Constructs SetUpIdleModeText specific part of terminal |
|
1424 |
// response and calls SendTerminalResponse to send the terminal response |
|
1425 |
// ----------------------------------------------------------------------------- |
|
1426 |
// |
|
1427 |
TInt CSatMessHandler::SetUpIdleModeTextTerminalResp |
|
1428 |
( |
|
1429 |
TUint8 aTransId, // Transaction id |
|
1430 |
TDes8& aCommandDetails, // command number |
|
1431 |
TUint8 aGeneralResult, // Result |
|
1432 |
TUint8 aAdditionalInfo // Additional info |
|
1433 |
) |
|
1434 |
{ |
|
1435 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SETUPIDLEMODETEXTTERMINALRESP, "CSatMessHandler::SetUpIdleModeTextTerminalResp" ); |
|
1436 |
TFLOGSTRING("TSY:CSatMessHandler::SetUpIdleModeTextTerminalResp"); |
|
1437 |
||
1438 |
TTlv tlvSpecificData; |
|
1439 |
||
1440 |
//create General Result TLV here |
|
1441 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1442 |
//General result |
|
1443 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1444 |
||
1445 |
if ( !( CommandPerformedSuccessfully( aGeneralResult ) ) ) |
|
1446 |
{ |
|
1447 |
switch ( aGeneralResult ) |
|
1448 |
{ |
|
1449 |
// Cases in which additional info is not required |
|
1450 |
case RSat::KPSessionTerminatedByUser: |
|
1451 |
case RSat::KBackwardModeRequestedByUser: |
|
1452 |
case RSat::KNoResponseFromUser: |
|
1453 |
case RSat::KErrorRequiredValuesMissing: |
|
1454 |
case RSat::KHelpRequestedByUser: |
|
1455 |
case RSat::KCmdDataNotUnderstood: |
|
1456 |
{ |
|
1457 |
break; |
|
1458 |
} |
|
1459 |
default: |
|
1460 |
{ |
|
1461 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1462 |
break; |
|
1463 |
} |
|
1464 |
} |
|
1465 |
} |
|
1466 |
||
1467 |
return UiccCatReqTerminalResponse( |
|
1468 |
aCommandDetails, |
|
1469 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1470 |
aTransId ); |
|
1471 |
} |
|
1472 |
||
1473 |
||
1474 |
// ----------------------------------------------------------------------------- |
|
1475 |
// CSatMessHandler::UiccCatReqEnvelope |
|
1476 |
// Create and send UICC_CAT_REQ with UICC_SB_ENVELOPE |
|
1477 |
// ----------------------------------------------------------------------------- |
|
1478 |
// |
|
1479 |
TInt CSatMessHandler::UiccCatReqEnvelope |
|
1480 |
( |
|
1481 |
TUint8 aTransId, |
|
1482 |
const TDesC8& aBerTlv, // BER-TLV specific data |
|
1483 |
TBool aStore // Is envelope stored for resending |
|
1484 |
) |
|
1485 |
{ |
|
1486 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCCATREQENVELOPE, "CSatMessHandler::UiccCatReqEnvelope" ); |
|
1487 |
TFLOGSTRING("TSY:CSatMessHandler::UiccCatReqEnvelope"); |
|
1488 |
||
1489 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
1490 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
1491 |
isiMsg.Set8bit( |
|
1492 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_TRANSID, |
|
1493 |
aTransId ); |
|
1494 |
isiMsg.Set8bit( |
|
1495 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_MESSAGEID, |
|
1496 |
UICC_CAT_REQ ); |
|
1497 |
isiMsg.Set8bit( |
|
1498 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_SERVICETYPE, |
|
1499 |
UICC_CAT_ENVELOPE ); |
|
1500 |
isiMsg.Set8bit( |
|
1501 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_NSB, |
|
1502 |
1 ); |
|
1503 |
||
1504 |
// Add UICC_SB_ENVELOPE |
|
1505 |
TBuf8<SIZE_UICC_SB_ENVELOPE + KMaxSizeOfEnvelope> uiccSbEnvelopeBuf( 0 ); |
|
1506 |
TIsiSubBlock uiccSbEnvelope( |
|
1507 |
uiccSbEnvelopeBuf, |
|
1508 |
UICC_SB_ENVELOPE, |
|
1509 |
EIsiSubBlockTypeId16Len16 ); |
|
1510 |
||
1511 |
// 2x filler |
|
1512 |
uiccSbEnvelopeBuf.Append( KUiccPadding ); |
|
1513 |
uiccSbEnvelopeBuf.Append( KUiccPadding ); |
|
1514 |
||
1515 |
uiccSbEnvelopeBuf.Append( aBerTlv.Length() >> 8 ); // Length of envelope |
|
1516 |
uiccSbEnvelopeBuf.Append( aBerTlv.Length() ); |
|
1517 |
uiccSbEnvelopeBuf.Append( aBerTlv ); // Envelope |
|
1518 |
||
1519 |
// Append subblock to ISI message |
|
1520 |
isiMsg.CopyData( |
|
1521 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_REQ, |
|
1522 |
uiccSbEnvelope.CompleteSubBlock() ); |
|
1523 |
||
1524 |
// Store information if needed for possible resending |
|
1525 |
if ( aStore ) |
|
1526 |
{ |
|
1527 |
iTsySatMessaging->GetSatTimer()->StoreEnvelope( aTransId, aBerTlv ); |
|
1528 |
} |
|
1529 |
||
1530 |
return( iPnSend->Send( isiMsg.Complete() ) ); |
|
1531 |
} |
|
1532 |
||
1533 |
||
1534 |
// ----------------------------------------------------------------------------- |
|
1535 |
// CSatMessHandler::StoreNetServiceStatus |
|
1536 |
// Stores location information and network service status |
|
1537 |
// ----------------------------------------------------------------------------- |
|
1538 |
// |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1539 |
TInt CSatMessHandler::StoreNetServiceStatus |
0 | 1540 |
( |
1541 |
const TIsiReceiveC& aIsiMessage |
|
1542 |
) |
|
1543 |
{ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1544 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus" ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1545 |
TFLOGSTRING("TSY: CSatMessHandler::StoreNetServiceStatus"); |
0 | 1546 |
|
1547 |
// SubBlock offset |
|
1548 |
TUint sbOffset( 0 ); |
|
1549 |
||
1550 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
1551 |
||
1552 |
TInt headerSize( KErrNotFound ); |
|
1553 |
||
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1554 |
TInt retValue( KErrNone ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1555 |
|
0 | 1556 |
if ( NET_CELL_INFO_IND == messageId ) |
1557 |
{ |
|
1558 |
headerSize = SIZE_NET_CELL_INFO_IND; |
|
1559 |
} |
|
1560 |
else if ( NET_CELL_INFO_GET_RESP == messageId ) |
|
1561 |
{ |
|
1562 |
headerSize = SIZE_NET_CELL_INFO_GET_RESP; |
|
1563 |
} |
|
1564 |
else |
|
1565 |
{ |
|
1566 |
// Header size contains already an error value as default. |
|
1567 |
} |
|
1568 |
||
1569 |
if ( KErrNotFound != headerSize ) |
|
1570 |
{ |
|
1571 |
// Find NET_GSM_CELL_INFO or NET_WCDMA_CELL_INFO subblock |
|
1572 |
TInt retGsmSb( aIsiMessage.FindSubBlockOffsetById( |
|
1573 |
ISI_HEADER_SIZE + headerSize, |
|
1574 |
NET_GSM_CELL_INFO, |
|
1575 |
EIsiSubBlockTypeId8Len8, |
|
1576 |
sbOffset ) ); |
|
1577 |
||
1578 |
TInt retWcdmaSb( aIsiMessage.FindSubBlockOffsetById( |
|
1579 |
ISI_HEADER_SIZE + headerSize, |
|
1580 |
NET_WCDMA_CELL_INFO, |
|
1581 |
EIsiSubBlockTypeId8Len8, |
|
1582 |
sbOffset ) ); |
|
1583 |
||
1584 |
// Check if subblock exists. |
|
1585 |
if ( KErrNone == retGsmSb || KErrNone == retWcdmaSb ) |
|
1586 |
{ |
|
1587 |
// NET_GSM_CELL_INFO and NET_WCDMA_CELL_INFO subblocks have identical |
|
1588 |
// bytes and sizes ,use only NET_GSM_CELL_INFO subblock offset |
|
1589 |
// values when getting data. |
|
1590 |
||
1591 |
// Get registration status value |
|
1592 |
iLocInfo.iRegStatus = aIsiMessage.Get8bit( |
|
1593 |
sbOffset + NET_GSM_CELL_INFO_OFFSET_SERVICESTATUS ); |
|
1594 |
||
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1595 |
TFLOGSTRING2("TSY: CSatMessHandler::StoreNetServiceStatus: NET_REGISTRATION_STATUS = %d", iLocInfo.iRegStatus ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1596 |
OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus NET_REGISTRATION_STATUS = %d", iLocInfo.iRegStatus ); |
0 | 1597 |
|
1598 |
if ( NET_SERVICE == iLocInfo.iRegStatus || |
|
1599 |
NET_LIMITED_SERVICE == iLocInfo.iRegStatus ) |
|
1600 |
{ |
|
1601 |
// Get country code |
|
1602 |
iLocInfo.iOperatorCode.Copy( |
|
1603 |
aIsiMessage.GetData( |
|
1604 |
sbOffset + NET_GSM_CELL_INFO_OFFSET_OPERATORCODE, |
|
1605 |
3 ) ); |
|
1606 |
||
1607 |
// Set location area code, 2 bytes |
|
1608 |
iLocInfo.iLac.Copy( |
|
1609 |
aIsiMessage.GetData( |
|
1610 |
sbOffset + NET_GSM_CELL_INFO_OFFSET_CURRENTLAC, |
|
1611 |
2 ) ); |
|
1612 |
||
1613 |
// Cell id + Extented Cell id, 4 bytes |
|
1614 |
// Id's are included to Location Information TLV |
|
1615 |
// reverse order, see 31.111, 8.19 |
|
1616 |
TPtrC8 tempCellId( aIsiMessage.GetData( |
|
1617 |
sbOffset + NET_GSM_CELL_INFO_OFFSET_CURRENTCELLID, |
|
1618 |
4 ) ); |
|
1619 |
// Copy cell id to be first in buffer |
|
1620 |
iLocInfo.iCellId.Copy( tempCellId.Mid( 2 ) ); |
|
1621 |
// Append extented cell id part |
|
1622 |
iLocInfo.iCellId.Append( tempCellId.Left( 2 ) ); |
|
1623 |
||
1624 |
// Network type |
|
1625 |
if ( NET_GSM_CELL_INFO == aIsiMessage.Get8bit( |
|
1626 |
sbOffset + NET_GSM_CELL_INFO_OFFSET_SUBBLOCKID ) ) |
|
1627 |
{ |
|
1628 |
iCurrentAccTech = KNetworkModeGsm; |
|
1629 |
} |
|
1630 |
else |
|
1631 |
{ |
|
1632 |
iCurrentAccTech = KNetworkModeUtran; |
|
1633 |
} |
|
1634 |
} |
|
1635 |
} |
|
1636 |
else |
|
1637 |
{ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1638 |
TFLOGSTRING("TSY: CSatMessHandler::StoreNetServiceStatus - NET_GSM_CELL_INFO or NET_WCDMA_CELL_INFO not found!"); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1639 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus NET_GSM_CELL_INFO or NET_WCDMA_CELL_INFO not found!" ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1640 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1641 |
retValue = KErrNotFound; |
0 | 1642 |
} |
1643 |
} |
|
1644 |
else |
|
1645 |
{ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1646 |
TFLOGSTRING2("TSY: CSatMessHandler::StoreNetServiceStatus - Unexpected message id: %d", messageId ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1647 |
OstTrace1( TRACE_NORMAL, DUP3_CSATMESSHANDLER_STORENETSERVICESTATUS, "CSatMessHandler::StoreNetServiceStatus Unexpected message id: %d", messageId ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1648 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1649 |
retValue = KErrNotFound; |
0 | 1650 |
} |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1651 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
1652 |
return retValue; |
0 | 1653 |
} |
1654 |
||
1655 |
// ----------------------------------------------------------------------------- |
|
1656 |
// CSatMessHandler::SetUpEventListTerminalResp |
|
1657 |
// Constructs Setup EventList and calls |
|
1658 |
// SendTerminalResponse to send the terminal response |
|
1659 |
// ----------------------------------------------------------------------------- |
|
1660 |
// |
|
1661 |
TInt CSatMessHandler::SetUpEventListTerminalResp |
|
1662 |
( |
|
1663 |
TUint8 aTransId, // Transaction id |
|
1664 |
TDes8& aCommandDetails, // Command details |
|
1665 |
TUint8 aGeneralResult, // General result |
|
1666 |
TUint8 aAdditionalInfo // Additional info |
|
1667 |
) |
|
1668 |
{ |
|
1669 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SETUPEVENTLISTTERMINALRESP, "CSatMessHandler::SetUpEventListTerminalResp" ); |
|
1670 |
TFLOGSTRING("TSY:CSatMessHandler::SetUpEventListTerminalResp"); |
|
1671 |
// create responce data |
|
1672 |
TTlv tlvSpecificData; |
|
1673 |
||
1674 |
//create General Result TLV here |
|
1675 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1676 |
||
1677 |
//General result |
|
1678 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1679 |
||
1680 |
if ( RSat::KSuccess != aGeneralResult && |
|
1681 |
RSat::KCmdBeyondMeCapabilities != aGeneralResult && |
|
1682 |
RSat::KErrorRequiredValuesMissing != aGeneralResult) |
|
1683 |
{ |
|
1684 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1685 |
} |
|
1686 |
||
1687 |
#ifdef INFO_PP_ENHANCED_NETWORK_SELECTION |
|
1688 |
iSetUpEventListTrSent = ETrue; |
|
1689 |
#endif // INFO_PP_ENHANCED_NETWORK_SELECTION |
|
1690 |
||
1691 |
return UiccCatReqTerminalResponse( |
|
1692 |
aCommandDetails, |
|
1693 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1694 |
aTransId ); |
|
1695 |
} |
|
1696 |
||
1697 |
// ----------------------------------------------------------------------------- |
|
1698 |
// CSatMessHandler::PollingOffTerminalResp |
|
1699 |
// Constructs PollingOff specific part of terminal |
|
1700 |
// response and calls SendTerminalResponse |
|
1701 |
// ----------------------------------------------------------------------------- |
|
1702 |
// |
|
1703 |
TInt CSatMessHandler::PollingOffTerminalResp |
|
1704 |
( |
|
1705 |
TUint8 aTransId, |
|
1706 |
TDes8& aCommandDetails, // Transaction id |
|
1707 |
TUint8 aGeneralResult, // General result |
|
1708 |
TUint8 aAdditionalInfo // Additional info |
|
1709 |
) |
|
1710 |
{ |
|
1711 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_POLLINGOFFTERMINALRESP, "CSatMessHandler::PollingOffTerminalResp" ); |
|
1712 |
TFLOGSTRING("TSY:CSatMessHandler::PollingOffTerminalResp"); |
|
1713 |
||
1714 |
TTlv tlvSpecificData; |
|
1715 |
||
1716 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
1717 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
1718 |
||
1719 |
if ( !( CommandPerformedSuccessfully( aGeneralResult ) ) ) |
|
1720 |
{ |
|
1721 |
switch ( aGeneralResult ) |
|
1722 |
{ |
|
1723 |
// Cases in which additional info is not required |
|
1724 |
case RSat::KPSessionTerminatedByUser: |
|
1725 |
case RSat::KBackwardModeRequestedByUser: |
|
1726 |
case RSat::KNoResponseFromUser: |
|
1727 |
case RSat::KErrorRequiredValuesMissing: |
|
1728 |
case RSat::KHelpRequestedByUser: |
|
1729 |
{ |
|
1730 |
break; |
|
1731 |
} |
|
1732 |
default: |
|
1733 |
{ |
|
1734 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
1735 |
break; |
|
1736 |
} |
|
1737 |
} |
|
1738 |
} |
|
1739 |
||
1740 |
return UiccCatReqTerminalResponse( |
|
1741 |
aCommandDetails, |
|
1742 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
1743 |
aTransId ); |
|
1744 |
} |
|
1745 |
||
1746 |
// ----------------------------------------------------------------------------- |
|
1747 |
// CSatMessHandler::LocalInfoTerminalResp |
|
1748 |
// Constructs and sends the Local information response to |
|
1749 |
// the SIM card. |
|
1750 |
// ----------------------------------------------------------------------------- |
|
1751 |
// |
|
1752 |
TInt CSatMessHandler::LocalInfoTerminalResp |
|
1753 |
( |
|
1754 |
TUint8 aTransId, // Transaction id |
|
1755 |
TDes8& aCommandDetails, // Command details tlv |
|
1756 |
TUint8 aGeneralResult, // General result |
|
1757 |
TDes& aAdditionalInfo // Additional info |
|
1758 |
) |
|
1759 |
{ |
|
1760 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_LOCALINFOTERMINALRESP, "CSatMessHandler::LocalInfoTerminalResp" ); |
|
1761 |
TFLOGSTRING("TSY: CSatMessHandler::LocalInfoTerminalResp"); |
|
1762 |
// Create and append response data |
|
1763 |
TTlv tlvData; |
|
1764 |
// Create General Result TLV |
|
1765 |
tlvData.AddTag( KTlvResultTag ); |
|
1766 |
||
1767 |
// General result |
|
1768 |
tlvData.AddByte( aGeneralResult ); |
|
1769 |
||
1770 |
if ( RSat::KSuccess != aGeneralResult |
|
1771 |
&& RSat::KSuccessLimitedService != aGeneralResult ) |
|
1772 |
{ |
|
1773 |
if ( aAdditionalInfo.Length() ) |
|
1774 |
{ |
|
1775 |
tlvData.AddByte( TUint8( aAdditionalInfo[0] & 0xFF ) ); |
|
1776 |
} |
|
1777 |
} |
|
1778 |
else |
|
1779 |
{ |
|
1780 |
switch ( aCommandDetails[KCommandQualifier] ) |
|
1781 |
{ |
|
1782 |
case RSat::KProvideLocalInfo: |
|
1783 |
{ |
|
1784 |
const TLocationInfo& locInfo = LocationInfo(); |
|
1785 |
// Create Location Information TLV |
|
1786 |
tlvData.AddTag( KTlvLocationInformationTag ); |
|
1787 |
// Append Mobile Country & Network Codes, 3 bytes |
|
1788 |
tlvData.AddData( locInfo.iOperatorCode ); |
|
1789 |
||
1790 |
// Append LAC code |
|
1791 |
tlvData.AddData( locInfo.iLac ); |
|
1792 |
||
1793 |
// Append CellId |
|
1794 |
tlvData.AddData( locInfo.iCellId ); |
|
1795 |
break; |
|
1796 |
} |
|
1797 |
case RSat::KProvideLocalInfoImei: |
|
1798 |
{ |
|
1799 |
// Add tlv tag |
|
1800 |
tlvData.AddTag( KTlvImeiTag ); |
|
1801 |
TBuf8<8> bcdImei; |
|
1802 |
// Convert IMEI to BCD format |
|
1803 |
_LIT8( KTen, "*" ); |
|
1804 |
_LIT8( KZero, "0" ); |
|
1805 |
||
1806 |
// Check if required changes is allready done for the IMEI |
|
1807 |
if ( '*' != iIMEI[0] ) |
|
1808 |
{ |
|
1809 |
// Processing BCD string is much harder than ASCII so |
|
1810 |
// required changes is done before BCD conversion. |
|
1811 |
// (lot's of shifting etc..) |
|
1812 |
// Insert '*'(0x2A) as a first character which is converted |
|
1813 |
// to 0xA in AsciiToBCD method. |
|
1814 |
// Type of identity for IMEI code is 0xA "1010b" |
|
1815 |
// See 3GPP TS 04.08 |
|
1816 |
iIMEI.Insert( 0, KTen ); |
|
1817 |
||
1818 |
// Spare digit: this digit shall be zero, when transmitted |
|
1819 |
// by the Mobile Station. |
|
1820 |
// See GSM 03.03 |
|
1821 |
iIMEI.Replace( iIMEI.Length() - 1, 1 , KZero ); |
|
1822 |
} |
|
1823 |
||
1824 |
TSatUtility::AsciiToBCD( iIMEI, bcdImei ); |
|
1825 |
// Add IMEI code to the terminal response |
|
1826 |
tlvData.AddData( bcdImei ); |
|
1827 |
break; |
|
1828 |
} |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1829 |
case RSat::KProvideLocalInfoIMEISV: |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1830 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1831 |
tlvData.AddTag( KTlvImeisvTag ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1832 |
tlvData.AddData( iIMEIsv ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1833 |
break; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1834 |
} |
0 | 1835 |
case RSat::KProvideLocalInformationNmr: |
1836 |
{ |
|
1837 |
// Check if NMR's were for UTRAN |
|
1838 |
if ( iUtranNMR.Length() ) |
|
1839 |
{ |
|
1840 |
tlvData.AddTag( KTlvNetworkMeasurementResultsTag ); |
|
1841 |
tlvData.AddData( iUtranNMR ); |
|
1842 |
} |
|
1843 |
else |
|
1844 |
{ |
|
1845 |
// NMR's were for GSM |
|
1846 |
if ( iNMR.Length() ) |
|
1847 |
{ |
|
1848 |
// Network measurement result |
|
1849 |
tlvData.AddTag( KTlvNetworkMeasurementResultsTag ); |
|
1850 |
tlvData.AddData( iNMR ); |
|
1851 |
} |
|
1852 |
||
1853 |
if ( iBCCHChannelList.Length() ) |
|
1854 |
{ |
|
1855 |
// append BCCH channel list tag |
|
1856 |
tlvData.AddTag( KTlvBccdChannelListTag ); |
|
1857 |
||
1858 |
TInt i( 0 ); |
|
1859 |
TInt mask( 3 ); |
|
1860 |
TInt shiftMove( 2 ); |
|
1861 |
TUint8 nextChar( 0 ); |
|
1862 |
||
1863 |
// Convert BCCH channel list from 16-bit to 10-bit |
|
1864 |
// format |
|
1865 |
for ( i = 0; i < iBCCHChannelList.Length(); i++ ) |
|
1866 |
{ |
|
1867 |
TUint char2 = ( iBCCHChannelList[i] & 0x03FF ); |
|
1868 |
TUint8 char1 = TUint8( char2 >> shiftMove); |
|
1869 |
||
1870 |
// append byte |
|
1871 |
tlvData.AddByte( TUint8( char1 | nextChar ) ); |
|
1872 |
||
1873 |
nextChar = TUint8 ( ( char2 & mask ) |
|
1874 |
<< ( 8 - shiftMove ) ); |
|
1875 |
||
1876 |
if ( 8 == shiftMove ) |
|
1877 |
{ |
|
1878 |
shiftMove = 2; |
|
1879 |
nextChar = 0; |
|
1880 |
tlvData.AddByte( TUint8( char2 & 0x00FF ) ); |
|
1881 |
mask = 3; |
|
1882 |
} |
|
1883 |
else |
|
1884 |
{ |
|
1885 |
shiftMove += 2; |
|
1886 |
mask = ( 1L << shiftMove) - 1; |
|
1887 |
} |
|
1888 |
} |
|
1889 |
// add last byte |
|
1890 |
tlvData.AddByte( nextChar ); |
|
1891 |
} |
|
1892 |
} |
|
1893 |
// clear nmr |
|
1894 |
iNMR.Zero(); |
|
1895 |
// clear BCCH channel list |
|
1896 |
iBCCHChannelList.Zero(); |
|
1897 |
// clear UTRAN NMR's |
|
1898 |
iUtranNMR.Set( KNullDesC8 ); |
|
1899 |
break; |
|
1900 |
} |
|
1901 |
case RSat::KProvideLocalInfoDateTimeTimeZone: |
|
1902 |
{ |
|
1903 |
tlvData.AddTag( KTlvDateTimeAndTimeZoneTag ); |
|
1904 |
// append current date/time/timezone to the terminal response |
|
1905 |
TInt i( 0 ); |
|
1906 |
for ( i = 0; i < aAdditionalInfo.Length(); i++ ) |
|
1907 |
{ |
|
1908 |
tlvData.AddByte( TUint8( aAdditionalInfo[i] & 0x00FF ) ); |
|
1909 |
} |
|
1910 |
break; |
|
1911 |
} |
|
1912 |
case RSat::KProvideLocalInfoTimingAdv: |
|
1913 |
{ |
|
1914 |
TFLOGSTRING("TSY: CSatMessHandler::LocalInfoTerminalResp,\ |
|
1915 |
TimingAdvance"); |
|
1916 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_LOCALINFOTERMINALRESP, "CSatMessHandler::LocalInfoTerminalResp, TimingAdvance" ); |
|
1917 |
||
1918 |
// Timing advance result |
|
1919 |
tlvData.AddTag( KTlvTimingAdvanceTag ); |
|
1920 |
tlvData.AddByte( iTaStatus ); |
|
1921 |
tlvData.AddByte( iTimingAdvance ); |
|
1922 |
break; |
|
1923 |
} |
|
1924 |
case RSat::KProvideLocalInfoLanguage: |
|
1925 |
{ |
|
1926 |
TFLOGSTRING("TSY: CSatMessHandler::LocalInfoTerminalResp,\ |
|
1927 |
LocalInfoLanguage"); |
|
1928 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_LOCALINFOTERMINALRESP, "CSatMessHandler::LocalInfoTerminalResp, LocalInfoLanguage" ); |
|
1929 |
||
1930 |
if ( aAdditionalInfo.Length() ) |
|
1931 |
{ |
|
1932 |
// create Language TLV |
|
1933 |
tlvData.AddTag( KTlvLanguageTag ); |
|
1934 |
TBuf8<2> character; |
|
1935 |
TIsiUtility::CopyToBigEndian( aAdditionalInfo, character); |
|
1936 |
tlvData.AddData( character ); |
|
1937 |
} |
|
1938 |
break; |
|
1939 |
} |
|
1940 |
case RSat::KProvideLocalInfoAccTech: |
|
1941 |
{ |
|
1942 |
TFLOGSTRING("TSY: CSatMessHandler::LocalInfoTerminalResp,\ |
|
1943 |
Access Technology"); |
|
1944 |
OstTrace0( TRACE_NORMAL, DUP3_CSATMESSHANDLER_LOCALINFOTERMINALRESP, "CSatMessHandler::LocalInfoTerminalResp, Access Technology" ); |
|
1945 |
||
1946 |
// Access technology result |
|
1947 |
tlvData.AddTag( KTlvAccessTechnologyTag ); |
|
1948 |
tlvData.AddByte( iCurrentAccTech ); |
|
1949 |
||
1950 |
break; |
|
1951 |
} |
|
1952 |
default: |
|
1953 |
{ |
|
1954 |
break; |
|
1955 |
} |
|
1956 |
} |
|
1957 |
} |
|
1958 |
return UiccCatReqTerminalResponse( |
|
1959 |
aCommandDetails, |
|
1960 |
tlvData.GetDataWithoutTopLevelTag(), |
|
1961 |
aTransId ); |
|
1962 |
} |
|
1963 |
// ----------------------------------------------------------------------------- |
|
1964 |
// CSatMessHandler::InfoSerialNumberReadReq |
|
1965 |
// Constructs INFO_SERIAL_NUMBER_READ_REQ ISI message. |
|
1966 |
// Called from CTsySatMessaging::ConstructL method. |
|
1967 |
// ----------------------------------------------------------------------------- |
|
1968 |
// |
|
1969 |
TInt CSatMessHandler::InfoSerialNumberReadReq |
|
1970 |
( |
|
1971 |
TUint8 aTransId, // Transactio id |
|
1972 |
TUint8 aTarget |
|
1973 |
) |
|
1974 |
{ |
|
1975 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_INFOSERIALNUMBERREADREQ, "CSatMessHandler::InfoSerialNumberReadReq" ); |
|
1976 |
TFLOGSTRING("TSY:CSatMessHandler::InfoSerialNumberReadReq"); |
|
1977 |
||
1978 |
//set infoSerialNumberReadReq to point to the send buffer |
|
1979 |
TIsiSend infoSerialNumberReadReq( iPnSend->SendBufferDes() ); |
|
1980 |
infoSerialNumberReadReq.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_INFO ); |
|
1981 |
infoSerialNumberReadReq.Set8bit( ISI_HEADER_OFFSET_TRANSID, aTransId ); |
|
1982 |
infoSerialNumberReadReq.Set8bit( ISI_HEADER_OFFSET_MESSAGEID, |
|
1983 |
INFO_SERIAL_NUMBER_READ_REQ ); |
|
1984 |
||
1985 |
infoSerialNumberReadReq.Set8bit( ISI_HEADER_SIZE |
|
1986 |
+ INFO_SERIAL_NUMBER_READ_REQ_OFFSET_TARGET, aTarget ); |
|
1987 |
||
1988 |
//send message via Phonet |
|
1989 |
return iPnSend->Send( infoSerialNumberReadReq.Complete() ); |
|
1990 |
||
1991 |
} |
|
1992 |
||
1993 |
// ----------------------------------------------------------------------------- |
|
1994 |
// CSatMessHandler::InfoSerialNumberReadResp |
|
1995 |
// Breaks a INFO_SERIAL_NUMBER_READ_RESP ISI-message. |
|
1996 |
// ----------------------------------------------------------------------------- |
|
1997 |
// |
|
1998 |
void CSatMessHandler::InfoSerialNumberReadResp |
|
1999 |
( |
|
2000 |
const TIsiReceiveC& aIsiMessage // received ISI-message |
|
2001 |
) |
|
2002 |
{ |
|
2003 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_INFOSERIALNUMBERREADRESP, "CSatMessHandler::InfoSerialNumberReadResp" ); |
|
2004 |
TFLOGSTRING("TSY:CSatMessHandler::InfoSerialNumberReadResp"); |
|
2005 |
||
2006 |
TUint sbStartOffset( 0 ); |
|
2007 |
||
2008 |
//check if INFO_SB_SN_IMEI_PLAIN sub block is present |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2009 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2010 |
ISI_HEADER_SIZE + SIZE_INFO_SERIAL_NUMBER_READ_RESP, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2011 |
INFO_SB_SN_IMEI_PLAIN, EIsiSubBlockTypeId8Len8, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2012 |
sbStartOffset ) ) |
0 | 2013 |
{ |
2014 |
//store imei code |
|
2015 |
iIMEI.Copy( aIsiMessage.GetData( |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2016 |
sbStartOffset + INFO_SB_SN_IMEI_PLAIN_OFFSET_IMEIPLAINU8, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2017 |
aIsiMessage.Get8bit( sbStartOffset + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2018 |
INFO_SB_SN_IMEI_PLAIN_OFFSET_STRLEN ) - 1 ) ); |
0 | 2019 |
//Set the flag to inform that needed data has been received |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2020 |
iImeiAvailable = ETrue; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2021 |
TFLOGSTRING("TSY: SAT, Imei received."); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2022 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_INFOSERIALNUMBERREADRESP, "SAT, Imei received." ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2023 |
} |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2024 |
//check if INFO_SB_SN_IMEI_SV_TO_NET sub block is present |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2025 |
else if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2026 |
ISI_HEADER_SIZE + SIZE_INFO_SERIAL_NUMBER_READ_RESP, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2027 |
INFO_SB_SN_IMEI_SV_TO_NET, EIsiSubBlockTypeId8Len8, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2028 |
sbStartOffset ) ) |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2029 |
{ |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2030 |
// store imeisv code |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2031 |
iIMEIsv.Copy( aIsiMessage.GetData( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2032 |
sbStartOffset + INFO_SB_SN_IMEI_SV_TO_NET_OFFSET_IMEISVU8, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2033 |
aIsiMessage.Get8bit( sbStartOffset + |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2034 |
INFO_SB_SN_IMEI_SV_TO_NET_OFFSET_STRLEN ) ) ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2035 |
iImeiSvAvailable = ETrue; |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2036 |
TFLOGSTRING("TSY: CSatMessHandler::InfoSerialNumberReadResp IMEISV received"); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2037 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_INFOSERIALNUMBERREADRESP, "CSatMessHandler::InfoSerialNumberReadResp IMEISV received" ); |
0 | 2038 |
} |
2039 |
} |
|
2040 |
||
2041 |
// ----------------------------------------------------------------------------- |
|
2042 |
// CSatMessHandler::NetNeighbourCellsReq |
|
2043 |
// Constructs NET_NEIGHBOUR_CELLS_REQ ISI message. |
|
2044 |
// ----------------------------------------------------------------------------- |
|
2045 |
// |
|
2046 |
TInt CSatMessHandler::NetNeighbourCellsReq |
|
2047 |
( |
|
2048 |
TUint8 aTransId, // Transaction Id |
|
2049 |
TUint8 aCellInfoType // Cell info type |
|
2050 |
) |
|
2051 |
{ |
|
2052 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETNEIGHBOURCELLSREQ, "CSatMessHandler::NetNeighbourCellsReq" ); |
|
2053 |
TFLOGSTRING("TSY:CSatMessHandler::NetNeighbourCellsReq"); |
|
2054 |
||
2055 |
TBuf8<1> data; |
|
2056 |
data.Append( aCellInfoType ); |
|
2057 |
||
2058 |
return iPnSend->Send( |
|
2059 |
PN_MODEM_NETWORK, |
|
2060 |
aTransId, |
|
2061 |
NET_NEIGHBOUR_CELLS_REQ, |
|
2062 |
data ); |
|
2063 |
} |
|
2064 |
||
2065 |
// ----------------------------------------------------------------------------- |
|
2066 |
// CSatMessHandler::NetNeighbourCellResp |
|
2067 |
// Parse NET_NEIGHBOUR_CELLS_RESP message and read from it BCCH |
|
2068 |
// channel list and Network measurement results. |
|
2069 |
// ----------------------------------------------------------------------------- |
|
2070 |
// |
|
2071 |
void CSatMessHandler::NetNeighbourCellResp |
|
2072 |
( |
|
2073 |
const TIsiReceiveC& aIsiMessage |
|
2074 |
) |
|
2075 |
{ |
|
2076 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETNEIGHBOURCELLRESP, "CSatMessHandler::NetNeighbourCellResp" ); |
|
2077 |
TFLOGSTRING("TSY:CSatMessHandler::NetNeighbourCellResp"); |
|
2078 |
||
2079 |
TUint8 result( RSat::KSuccess ); |
|
2080 |
||
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
2081 |
if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus() ) |
0 | 2082 |
{ |
2083 |
// Provide local info proactive command is ongoing |
|
2084 |
||
2085 |
// Subblock offset |
|
2086 |
TUint sbOffset( 0 ); |
|
2087 |
||
2088 |
TInt successCode ( aIsiMessage.Get8bit( |
|
2089 |
ISI_HEADER_SIZE + NET_NEIGHBOUR_CELLS_RESP_OFFSET_SUCCESSCODE ) ); |
|
2090 |
||
2091 |
// Additional info |
|
2092 |
TBuf<1> additionalInfo; |
|
2093 |
additionalInfo.Zero(); |
|
2094 |
||
2095 |
// Get transaction id |
|
2096 |
TUint8 transId( |
|
2097 |
iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId() ); |
|
2098 |
||
2099 |
// Get command details tlv |
|
2100 |
TBuf8<5> commandDetails; |
|
2101 |
commandDetails = |
|
2102 |
iTsySatMessaging->GetNotifyLocalInfo()->GetCmdDetails(); |
|
2103 |
||
2104 |
TInt sbIndex( 1 ); |
|
2105 |
||
2106 |
TInt retValue( aIsiMessage.FindSubBlockOffsetByIndex( |
|
2107 |
ISI_HEADER_SIZE + SIZE_NET_NEIGHBOUR_CELLS_RESP, |
|
2108 |
sbIndex, |
|
2109 |
EIsiSubBlockTypeId8Len8, |
|
2110 |
sbOffset ) ); |
|
2111 |
||
2112 |
if ( NET_CAUSE_OK == successCode && KErrNone == retValue ) |
|
2113 |
{ |
|
2114 |
if ( NET_LIMITED_SERVICE == iLocInfo.iRegStatus ) |
|
2115 |
{ |
|
2116 |
result = RSat::KSuccessLimitedService; |
|
2117 |
} |
|
2118 |
||
2119 |
switch( aIsiMessage.Get8bit( sbOffset ) ) |
|
2120 |
{ |
|
2121 |
case NET_GSM_SIM_NMR_INFO: |
|
2122 |
{ |
|
2123 |
// Store network measurements results, 16 bytes |
|
2124 |
iNMR = aIsiMessage.GetData( sbOffset |
|
2125 |
+ NET_GSM_SIM_NMR_INFO_OFFSET_MEASUREMENTRESULTS, |
|
2126 |
16 ); |
|
2127 |
||
2128 |
// Get BCCH channel list |
|
2129 |
TUint numChannels( aIsiMessage.Get8bit( sbOffset |
|
2130 |
+ NET_GSM_SIM_NMR_INFO_OFFSET_NUMBEROFCHANNELS ) ); |
|
2131 |
||
2132 |
// Each channel takes 2 bytes |
|
2133 |
TPtrC8 bcchList( aIsiMessage.GetData( |
|
2134 |
sbOffset + NET_GSM_SIM_NMR_INFO_OFFSET_ARFCN, |
|
2135 |
2 * numChannels ) ); |
|
2136 |
||
2137 |
for ( TInt i = 0; i < bcchList.Length(); i+=2 ) |
|
2138 |
{ |
|
2139 |
iBCCHChannelList.Append( |
|
2140 |
bcchList[i] << 8 | bcchList[i+1] ); |
|
2141 |
} |
|
2142 |
// Call local info terminal response method to send |
|
2143 |
// terminal response to the sim card. |
|
2144 |
LocalInfoTerminalResp( transId, |
|
2145 |
commandDetails, |
|
2146 |
result, |
|
2147 |
additionalInfo ); |
|
2148 |
break; |
|
2149 |
} |
|
2150 |
case NET_UTRAN_SIM_NMR_INFO: |
|
2151 |
{ |
|
2152 |
TUint8 reportLength( aIsiMessage.Get8bit( sbOffset |
|
2153 |
+ NET_UTRAN_SIM_NMR_INFO_OFFSET_MEASREPORTLENGTH ) ); |
|
2154 |
||
2155 |
iUtranNMR.Set( aIsiMessage.GetData( |
|
2156 |
sbOffset + NET_UTRAN_SIM_NMR_INFO_OFFSET_MEASREPORT, |
|
2157 |
reportLength ) ); |
|
2158 |
||
2159 |
LocalInfoTerminalResp( transId, |
|
2160 |
commandDetails, |
|
2161 |
result, |
|
2162 |
additionalInfo ); |
|
2163 |
break; |
|
2164 |
} |
|
2165 |
default: |
|
2166 |
{ |
|
2167 |
//Response included unexpected subblock |
|
2168 |
iNMR.Zero(); |
|
2169 |
iBCCHChannelList.Zero(); |
|
2170 |
iUtranNMR.Set( KNullDesC8 ); |
|
2171 |
additionalInfo.Append( RSat::KNoService ); |
|
2172 |
// Send terminal response to the sim card |
|
2173 |
LocalInfoTerminalResp( transId, |
|
2174 |
commandDetails, |
|
2175 |
RSat::KMeUnableToProcessCmd, |
|
2176 |
additionalInfo ); |
|
2177 |
break; |
|
2178 |
} |
|
2179 |
} |
|
2180 |
} |
|
2181 |
else |
|
2182 |
{ |
|
2183 |
// No service |
|
2184 |
iNMR.Zero(); |
|
2185 |
iBCCHChannelList.Zero(); |
|
2186 |
iUtranNMR.Set( KNullDesC8 ); |
|
2187 |
additionalInfo.Append( RSat::KNoService ); |
|
2188 |
// Send terminal response to the sim card |
|
2189 |
LocalInfoTerminalResp( transId, |
|
2190 |
commandDetails, |
|
2191 |
RSat::KMeUnableToProcessCmd, |
|
2192 |
additionalInfo ); |
|
2193 |
} |
|
2194 |
// Clear local info flag |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
2195 |
iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue ); |
0 | 2196 |
} |
2197 |
} |
|
2198 |
||
2199 |
||
2200 |
// ----------------------------------------------------------------------------- |
|
2201 |
// CSatMessHandler::CallModemResourceReq |
|
2202 |
// Sends a CALL_MODEM_RESOURCE_REQ ISI message. |
|
2203 |
// ----------------------------------------------------------------------------- |
|
2204 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2205 |
TInt CSatMessHandler::CallModemResourceReq( |
0 | 2206 |
TUint8 aTransId, |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2207 |
const TDesC8& aMsg |
0 | 2208 |
) |
2209 |
{ |
|
2210 |
TFLOGSTRING("TSY:CSatMessHandler::CallModemResourceReq"); |
|
2211 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_CALLMODEMRESOURCEREQ, "TSY:CSatMessHandler::CallModemResourceReq" ); |
|
2212 |
||
2213 |
return iPnSend->Send( PN_MODEM_CALL, aTransId, CALL_MODEM_RESOURCE_REQ, aMsg ); |
|
2214 |
} |
|
2215 |
||
2216 |
// ----------------------------------------------------------------------------- |
|
2217 |
// CSatMessHandler::CallModemResourceConfReq |
|
2218 |
// Sends a CALL_MODEM_RESOURCE_CONF_REQ ISI message. |
|
2219 |
// ----------------------------------------------------------------------------- |
|
2220 |
// |
|
2221 |
TInt CSatMessHandler::CallModemResourceConfReq( |
|
2222 |
TUint16 aResourceId, |
|
2223 |
TUint16 aResourceIdMask ) |
|
2224 |
{ |
|
2225 |
TFLOGSTRING("TSY:CSatMessHandler::CallModemResourceConfReq"); |
|
2226 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_CALLMODEMRESOURCECONFREQ, "TSY:CSatMessHandler::CallModemResourceConfReq" ); |
|
2227 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2228 |
TBuf8< SIZE_CALL_MODEM_RESOURCE_CONF_REQ + |
0 | 2229 |
SIZE_CALL_MODEM_SB_RESOURCE_CONF> msg; |
2230 |
||
2231 |
// CALL_MODEM_RES_CONF_OPERATION |
|
2232 |
msg.Append( CALL_MODEM_RES_CONF_SET ); |
|
2233 |
// Nbr of sb's |
|
2234 |
msg.Append( 1 ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2235 |
|
0 | 2236 |
TIsiSubBlock sbResourceConf( |
2237 |
msg, |
|
2238 |
CALL_MODEM_SB_RESOURCE_CONF, |
|
2239 |
EIsiSubBlockTypeId8Len8 ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2240 |
|
0 | 2241 |
TSatUtility::AppendWord( aResourceId, msg ); |
2242 |
TSatUtility::AppendWord( aResourceIdMask, msg); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2243 |
|
0 | 2244 |
sbResourceConf.CompleteSubBlock(); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2245 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2246 |
return iPnSend->Send( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2247 |
PN_MODEM_CALL, |
0 | 2248 |
iTsySatMessaging->GetTransactionId(), |
2249 |
CALL_MODEM_RESOURCE_CONF_REQ, |
|
2250 |
msg ); |
|
2251 |
} |
|
2252 |
||
2253 |
// ----------------------------------------------------------------------------- |
|
2254 |
// CSatMessHandler::SsResourceConfReq |
|
2255 |
// Sends a SS_RESOURCE_CONF_REQ ISI message. |
|
2256 |
// ----------------------------------------------------------------------------- |
|
2257 |
// |
|
2258 |
TInt CSatMessHandler::SsResourceConfReq() |
|
2259 |
{ |
|
2260 |
TFLOGSTRING("TSY:CSatMessHandler::SsResourceConfReq"); |
|
2261 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SSRESOURCECONFREQ, "TSY:CSatMessHandler::SsResourceConfReq" ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2262 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2263 |
TBuf8< SIZE_SS_RESOURCE_CONF_REQ + |
0 | 2264 |
SIZE_SS_SB_RESOURCE_CONF > msg; |
2265 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2266 |
// SS_RESOURCE_CONF_OPERATION |
0 | 2267 |
msg.Append( SS_RESOURCE_CONF_SET ); |
2268 |
// Nbr of sb's |
|
2269 |
msg.Append( 1 ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2270 |
|
0 | 2271 |
TIsiSubBlock sbResourceConf( |
2272 |
msg, |
|
2273 |
SS_SB_RESOURCE_CONF, |
|
2274 |
EIsiSubBlockTypeId8Len8 ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2275 |
|
0 | 2276 |
TSatUtility::AppendWord( SS_RES_ID_MO_SS_OPERATION, msg ); |
2277 |
TSatUtility::AppendWord( SS_RES_ID_MO_SS_OPERATION_MASK, msg); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2278 |
|
0 | 2279 |
sbResourceConf.CompleteSubBlock(); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2280 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2281 |
return iPnSend->Send( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2282 |
PN_SS, |
0 | 2283 |
iTsySatMessaging->GetTransactionId(), |
2284 |
SS_RESOURCE_CONF_REQ, |
|
2285 |
msg ); |
|
2286 |
} |
|
2287 |
||
2288 |
// ----------------------------------------------------------------------------- |
|
2289 |
// CSatMessHandler::SsResourceControlReq |
|
2290 |
// Sends a SS_RESOURCE_CONNTROL_REQ ISI message. |
|
2291 |
// ----------------------------------------------------------------------------- |
|
2292 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2293 |
TInt CSatMessHandler::SsResourceControlReq( |
0 | 2294 |
TUint8 aTransId, |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2295 |
const TDesC8& aMsg |
0 | 2296 |
) |
2297 |
{ |
|
2298 |
TFLOGSTRING("TSY:CSatMessHandler::SsResourceControlReq"); |
|
2299 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SSRESOURCECONTROLREQ, "TSY:CSatMessHandler::SsResourceControlReq" ); |
|
2300 |
||
2301 |
return iPnSend->Send( |
|
2302 |
PN_SS, |
|
2303 |
aTransId, |
|
2304 |
SS_RESOURCE_CONTROL_REQ, |
|
2305 |
aMsg ); |
|
2306 |
} |
|
2307 |
||
2308 |
// ----------------------------------------------------------------------------- |
|
2309 |
// CSatMessHandler::GpdsResourceConfReq |
|
2310 |
// Sends a GPDS_RESOURCE_CONF_REQISI message. |
|
2311 |
// ----------------------------------------------------------------------------- |
|
2312 |
// |
|
2313 |
TInt CSatMessHandler::GpdsResourceConfReq() |
|
2314 |
{ |
|
2315 |
TFLOGSTRING("TSY:CSatMessHandler::GpdsResourceConfReq"); |
|
2316 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GPDSRESOURCECONFREQ, "TSY:CSatMessHandler::GpdsResourceConfReq" ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2317 |
|
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2318 |
TBuf8< SIZE_GPDS_RESOURCE_CONF_REQ + |
0 | 2319 |
SIZE_GPDS_RESOURCE_CONF > msg; |
2320 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2321 |
// SS_RESOURCE_CONF_OPERATION |
0 | 2322 |
msg.Append( GPDS_RESOURCE_CONF_SET ); |
2323 |
// Nbr of sb's |
|
2324 |
msg.Append( 1 ); |
|
2325 |
||
2326 |
TIsiSubBlock sbResourceConf( |
|
2327 |
msg, |
|
2328 |
GPDS_RESOURCE_CONF, |
|
2329 |
EIsiSubBlockTypeId8Len8 ); |
|
2330 |
||
2331 |
TSatUtility::AppendWord( GPDS_RES_ID_CC_FOR_GPRS, msg ); |
|
2332 |
TSatUtility::AppendWord( GPDS_RES_ID_MASK_CC_FOR_GPRS, msg); |
|
2333 |
||
2334 |
sbResourceConf.CompleteSubBlock(); |
|
2335 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2336 |
return iPnSend->Send( |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2337 |
PN_GPDS, |
0 | 2338 |
iTsySatMessaging->GetTransactionId(), |
2339 |
GPDS_RESOURCE_CONF_REQ, |
|
2340 |
msg ); |
|
2341 |
} |
|
2342 |
||
2343 |
// ----------------------------------------------------------------------------- |
|
2344 |
// CSatMessHandler::GpdsResourceControlReq |
|
2345 |
// Sends a GPDS_RESOURCE_CONNTROL_REQ ISI message. |
|
2346 |
// ----------------------------------------------------------------------------- |
|
2347 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2348 |
TInt CSatMessHandler::GpdsResourceControlReq( |
0 | 2349 |
TUint8 aTransId, |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2350 |
const TDesC8& aMsg |
0 | 2351 |
) |
2352 |
{ |
|
2353 |
TFLOGSTRING("TSY:CSatMessHandler::GpdsResourceControlReq"); |
|
2354 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GPDSRESOURCECONTROLREQ, "CSatMessHandler::GpdsResourceControlReq" ); |
|
2355 |
||
2356 |
return iPnSend->Send( |
|
2357 |
PN_GPDS, |
|
2358 |
aTransId, |
|
2359 |
GPDS_RESOURCE_CONTROL_REQ, |
|
2360 |
aMsg ); |
|
2361 |
} |
|
2362 |
||
2363 |
// ----------------------------------------------------------------------------- |
|
2364 |
// CSatMessHandler::SetPollingInterval |
|
2365 |
// Set Polling Interval, sending a request to sim server |
|
2366 |
// ----------------------------------------------------------------------------- |
|
2367 |
// |
|
2368 |
void CSatMessHandler::SetPollingInterval( TUint8 aTraId, TUint8 aValue ) |
|
2369 |
{ |
|
2370 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SETPOLLINGINTERVAL, "CSatMessHandler::SetPollingInterval" ); |
|
2371 |
TFLOGSTRING("TSY:CSatMessHandler::SetPollingInterval"); |
|
2372 |
||
2373 |
iPollingInterval = aValue; |
|
2374 |
||
2375 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
2376 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
2377 |
isiMsg.Set8bit( |
|
2378 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_TRANSID, |
|
2379 |
aTraId ); |
|
2380 |
isiMsg.Set8bit( |
|
2381 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_MESSAGEID, |
|
2382 |
UICC_CAT_REQ ); |
|
2383 |
isiMsg.Set8bit( |
|
2384 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_SERVICETYPE, |
|
2385 |
UICC_CAT_POLLING_SET ); |
|
2386 |
isiMsg.Set8bit( |
|
2387 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_NSB, |
|
2388 |
1 ); |
|
2389 |
||
2390 |
// Add UICC_SB_POLLING_SET |
|
2391 |
TBuf8<SIZE_UICC_SB_POLLING_SET> uiccSbPollingBuf( 0 ); |
|
2392 |
TIsiSubBlock uiccSbPolling( |
|
2393 |
uiccSbPollingBuf, |
|
2394 |
UICC_SB_POLLING_SET, |
|
2395 |
EIsiSubBlockTypeId16Len16 ); |
|
2396 |
||
2397 |
// Polling interval |
|
2398 |
uiccSbPollingBuf.Append( aValue >> 8 ); |
|
2399 |
uiccSbPollingBuf.Append( aValue ); |
|
2400 |
||
2401 |
// 2x filler |
|
2402 |
uiccSbPollingBuf.Append( KPadding ); |
|
2403 |
uiccSbPollingBuf.Append( KPadding ); |
|
2404 |
||
2405 |
// Append subblock to ISI message |
|
2406 |
isiMsg.CopyData( |
|
2407 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_REQ, |
|
2408 |
uiccSbPolling.CompleteSubBlock() ); |
|
2409 |
||
2410 |
iPnSend->Send( isiMsg.Complete() ); |
|
2411 |
} |
|
2412 |
||
2413 |
||
2414 |
// ----------------------------------------------------------------------------- |
|
2415 |
// CSatMessHandler::TimerMgmtTerminalResp |
|
2416 |
// Constructs and sends the Local information response to phonet |
|
2417 |
// ----------------------------------------------------------------------------- |
|
2418 |
// |
|
2419 |
TInt CSatMessHandler::TimerMgmtTerminalResp |
|
2420 |
( |
|
2421 |
TUint8 aTransId, // Transaction id |
|
2422 |
TDes8& aCommandDetails, // command details |
|
2423 |
TUint8 aGeneralResult, // General result |
|
2424 |
TUint8 aTimerValue[3], // Timer Value |
|
2425 |
TUint8 aTimerId, // Timer Identifier |
|
2426 |
TUint8 aAdditionalInfo // Additional info |
|
2427 |
) |
|
2428 |
{ |
|
2429 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_TIMERMGMTTERMINALRESP, "CSatMessHandler::TimerMgmtTerminalResp" ); |
|
2430 |
TFLOGSTRING("TSY:CSatMessHandler::TimerMgmtTerminalResp"); |
|
2431 |
||
2432 |
// Create and append response data |
|
2433 |
TTlv tlvSpecificData; |
|
2434 |
||
2435 |
//create General Result TLV here |
|
2436 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
2437 |
||
2438 |
//General result |
|
2439 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
2440 |
||
2441 |
//include timer value and id only when command is performed successfully |
|
2442 |
if( RSat::KSuccess == aGeneralResult ) |
|
2443 |
{ |
|
2444 |
||
2445 |
//Timer Id |
|
2446 |
//Value KTlvTimerIdentifierTagCRBitOn ( 0xA4 ) is added, |
|
2447 |
//because used KTlvTimerIdentifierTag ( 0x24 ) doesn't |
|
2448 |
//include comprehension bit in tag the value and it is expected |
|
2449 |
//to be present in indications and terminal responses. |
|
2450 |
tlvSpecificData.AddTag( KTlvTimerIdentifierTagCRBitOn ); |
|
2451 |
||
2452 |
tlvSpecificData.AddByte( aTimerId ); |
|
2453 |
||
2454 |
//Timer value is included when the Command Qualifier is indicating |
|
2455 |
//"deactivate" or "get the current value of the timer" |
|
2456 |
if ( aCommandDetails[4] ) |
|
2457 |
{ |
|
2458 |
tlvSpecificData.AddTag( KTlvTimerValueTag ); |
|
2459 |
//Timer value in semi-octets |
|
2460 |
tlvSpecificData.AddByte( aTimerValue[0] ); //hours |
|
2461 |
tlvSpecificData.AddByte( aTimerValue[1] ); //minutes |
|
2462 |
tlvSpecificData.AddByte( aTimerValue[2] ); //seconds |
|
2463 |
} |
|
2464 |
} |
|
2465 |
else if( RSat::KContradictionWithTimerState != aGeneralResult && |
|
2466 |
RSat::KErrorRequiredValuesMissing != aGeneralResult && |
|
2467 |
RSat::KCmdDataNotUnderstood != aGeneralResult && |
|
2468 |
RSat::KCmdTypeNotUnderstood != aGeneralResult ) |
|
2469 |
{ |
|
2470 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
2471 |
} |
|
2472 |
else |
|
2473 |
{ |
|
2474 |
TFLOGSTRING("TSY: CSatMessHandler::TimerMgmtTerminalResp, Unknown result."); |
|
2475 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_TIMERMGMTTERMINALRESP, "CSatMessHandler::TimerMgmtTerminalResp, Unknown result." ); |
|
2476 |
} |
|
2477 |
||
2478 |
return UiccCatReqTerminalResponse( |
|
2479 |
aCommandDetails, |
|
2480 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
2481 |
aTransId ); |
|
2482 |
} |
|
2483 |
||
2484 |
||
2485 |
// ----------------------------------------------------------------------------- |
|
2486 |
// CSatMessHandler::TimerExpirationInd |
|
2487 |
// Constructs TimerExpiration and calls SendAtkEnvelopeNtf to send the indication |
|
2488 |
// ----------------------------------------------------------------------------- |
|
2489 |
// |
|
2490 |
TInt CSatMessHandler::TimerExpirationInd |
|
2491 |
( |
|
2492 |
TUint8 aTransId, // Transaction id |
|
2493 |
TUint8 aTimerId, // Timer Identifier |
|
2494 |
TUint8 aTimerValue[3] // Timer Value |
|
2495 |
) |
|
2496 |
{ |
|
2497 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_TIMEREXPIRATIONIND, "CSatMessHandler::TimerExpirationInd" ); |
|
2498 |
TFLOGSTRING("TSY:CSatMessHandler::TimerExpirationInd"); |
|
2499 |
||
2500 |
TTlv data; |
|
2501 |
||
2502 |
data.Begin( KBerTlvTimerExpirationTag ); |
|
2503 |
||
2504 |
//Create Device Identity TLV |
|
2505 |
//Device identity tag |
|
2506 |
data.AddTag( KTlvDeviceIdentityTag ); |
|
2507 |
//Source device identity = ME |
|
2508 |
data.AddByte( KMe ); |
|
2509 |
//Destination device identity = SIM |
|
2510 |
data.AddByte( KSim ); |
|
2511 |
||
2512 |
//Value KTlvTimerIdentifierTagCRBitOn ( 0xA4 ) is added, |
|
2513 |
//because used KTlvTimerIdentifierTag ( 0x24 ) doesn't |
|
2514 |
//include comprehension bit in tag the value and it is expected |
|
2515 |
//to be present in indications and terminal responses. |
|
2516 |
data.AddTag( KTlvTimerIdentifierTagCRBitOn ); |
|
2517 |
data.AddByte( aTimerId); |
|
2518 |
//Timer value in semi-octets |
|
2519 |
data.AddTag( KTlvTimerValueTag ); |
|
2520 |
data.AddByte( aTimerValue[0] ); //hours |
|
2521 |
data.AddByte( aTimerValue[1] ); //minutes |
|
2522 |
data.AddByte( aTimerValue[2] ); //seconds |
|
2523 |
||
2524 |
return UiccCatReqEnvelope( aTransId, data.End() ); |
|
2525 |
} |
|
2526 |
||
2527 |
// ----------------------------------------------------------------------------- |
|
2528 |
// CSatMessHandler::RefreshResult |
|
2529 |
// Method to analyze refresh result from SIM Server. |
|
2530 |
// Called by CSatMessHandler::SimAtkResp. |
|
2531 |
// ----------------------------------------------------------------------------- |
|
2532 |
// |
|
2533 |
void CSatMessHandler::RefreshResult( TUint8 aStatus ) // UICC server status |
|
2534 |
{ |
|
2535 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_REFRESHRESULT, "CSatMessHandler::RefreshResult" ); |
|
2536 |
TFLOGSTRING("TSY:CSatMessHandler::RefreshResult"); |
|
2537 |
||
2538 |
TUint8 result( RSat::KSuccess ); |
|
2539 |
TUint8 additionalInfo( 0 ); |
|
2540 |
TInt ret( KErrNone ); |
|
2541 |
||
2542 |
if ( iRefreshRequestIsOn ) |
|
2543 |
{ |
|
2544 |
switch ( aStatus ) |
|
2545 |
{ |
|
2546 |
case UICC_STATUS_OK: |
|
2547 |
{ |
|
2548 |
// Refresh is done! |
|
2549 |
TFLOGSTRING("TSY: CSatMessHandler::RefreshResult, ISA has performed refresh successfully "); |
|
2550 |
TFLOGSTRING("TSY: CSatMessHandler::RefreshResult, Inform S60 to re-read SIM data"); |
|
2551 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_REFRESHRESULT, "CSatMessHandler::RefreshResult, ISA has performed refresh successfully " ); |
|
2552 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_REFRESHRESULT, "CSatMessHandler::RefreshResult, Inform S60 to re-read SIM data" ); |
|
2553 |
||
2554 |
// Read service table |
|
2555 |
if ( CSatNotifyRefresh::KCacheEFSST & |
|
2556 |
iTsySatMessaging->GetNotifyRefresh()->CachedFiles() ) |
|
2557 |
{ |
|
2558 |
// Re-read EF-UST |
|
2559 |
// Call control in USSD is supported only in SIM, byte 6 |
|
2560 |
if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
2561 |
{ |
|
2562 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte6, 5 ); |
|
2563 |
} |
|
2564 |
||
2565 |
// Call control, byte 4 from service table |
|
2566 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte4, 3 ); |
|
2567 |
#ifdef INFO_PP_ATK_MO_SM_CONTROL |
|
2568 |
// Check MO SMS control is supported by product profile |
|
2569 |
// USIM: byte 4, SIM: byte 5 |
|
2570 |
TUint8 serviceTableTrIdMoSms( KUiccTrIdServiceTableByte4 ); |
|
2571 |
TUint8 serviceTableOffsetMoSms( 3 ); |
|
2572 |
if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
2573 |
{ |
|
2574 |
// Transaction ID and byte offset for SIM |
|
2575 |
serviceTableTrIdMoSms = KUiccTrIdServiceTableByte5; |
|
2576 |
serviceTableOffsetMoSms = 4; |
|
2577 |
} |
|
2578 |
if ( iMoSmsSupportedInPp ) |
|
2579 |
{ |
|
2580 |
// ...and by SIM service table |
|
2581 |
UiccReadServiceTableReq( |
|
2582 |
serviceTableTrIdMoSms, |
|
2583 |
serviceTableOffsetMoSms ); |
|
2584 |
} |
|
2585 |
#else |
|
2586 |
// If flag not defined, check feature availability only |
|
2587 |
// from USIM |
|
2588 |
UiccReadServiceTableReq( |
|
2589 |
serviceTableTrIdMoSms, |
|
2590 |
serviceTableOffsetMoSms ); |
|
2591 |
#endif // INFO_PP_ATK_MO_SM_CONTROL |
|
2592 |
} |
|
2593 |
break; |
|
2594 |
} |
|
2595 |
default: |
|
2596 |
{ |
|
2597 |
TFLOGSTRING2("TSY: CSatMessHandler::RefreshResult, refresh failed, UICC STATUS: 0x%x", aStatus ); |
|
2598 |
OstTraceExt1( TRACE_NORMAL, DUP4_CSATMESSHANDLER_REFRESHRESULT, "CSatMessHandler::RefreshResult, refresh failed, UICC STATUS: 0x%hhx", aStatus ); |
|
2599 |
result = RSat::KMeUnableToProcessCmd; |
|
2600 |
additionalInfo = RSat::KNoSpecificMeProblem; |
|
2601 |
ret = KErrGeneral; |
|
2602 |
break; |
|
2603 |
} |
|
2604 |
} |
|
2605 |
||
2606 |
if ( RSat::KSuccess != result ) |
|
2607 |
{ |
|
2608 |
// If result was not successfull then send terminal response |
|
2609 |
// Otherwise terminal response is sent by the Client. |
|
2610 |
RefreshTerminalResp( |
|
2611 |
iTsySatMessaging->GetNotifyRefresh()->GetTransactionId(), |
|
2612 |
iTsySatMessaging->GetNotifyRefresh()->GetCmdDetails(), |
|
2613 |
result, |
|
2614 |
additionalInfo ); |
|
2615 |
} |
|
2616 |
// Complete refresh to the client even if it was not successfully, |
|
2617 |
// for buffer cleaning purposes. Also this way the Client will know |
|
2618 |
// that refresh was terminated. |
|
2619 |
iTsySatMessaging->GetNotifyRefresh()->CompleteRequest( ret ); |
|
2620 |
// Refresh is now handled, clear refresh flag |
|
2621 |
iRefreshRequestIsOn = EFalse; |
|
2622 |
} |
|
2623 |
} |
|
2624 |
||
2625 |
||
2626 |
// ----------------------------------------------------------------------------- |
|
2627 |
// CSatMessHandler::SendSmsReportReq |
|
2628 |
// Send a Sms-Pp report to SMS server using a request |
|
2629 |
// ----------------------------------------------------------------------------- |
|
2630 |
// |
|
2631 |
void CSatMessHandler::SendSmsReportReq |
|
2632 |
( |
|
2633 |
TUint8 aTransId, |
|
2634 |
TDesC8& aData |
|
2635 |
) |
|
2636 |
{ |
|
2637 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDSMSREPORTREQ, "CSatMessHandler::SendSmsReportReq" ); |
|
2638 |
TFLOGSTRING("CSatMessHandler::SendSmsReportReq"); |
|
2639 |
||
2640 |
iPnSend->Send( PN_SMS, aTransId, SMS_RECEIVED_MSG_REPORT_REQ, aData ); |
|
2641 |
} |
|
2642 |
||
2643 |
// ----------------------------------------------------------------------------- |
|
2644 |
// CSatMessHandler::SmsResourceConfReq |
|
2645 |
// Send a request to SMS server |
|
2646 |
// ----------------------------------------------------------------------------- |
|
2647 |
// |
|
2648 |
void CSatMessHandler::SmsResoureConfReq |
|
2649 |
( |
|
2650 |
TUint8 aTransId, |
|
2651 |
TUint8 aMsgId, |
|
2652 |
TDesC8& aData |
|
2653 |
) |
|
2654 |
{ |
|
2655 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SMSRESOURCECONFREQ, "CSatMessHandler::SmsResourceConfReq" ); |
|
2656 |
TFLOGSTRING("CSatMessHandler::SmsResourceConfReq"); |
|
2657 |
||
2658 |
iPnSend->Send( PN_SMS, aTransId, aMsgId, aData ); |
|
2659 |
} |
|
2660 |
||
2661 |
// ----------------------------------------------------------------------------- |
|
2662 |
// CSatMessHandler::SetPollingResult |
|
2663 |
// Sends terminal response according to the response coming from Sim server |
|
2664 |
// to a request having a service type KSimStSetPolling. |
|
2665 |
// This method handles both PollingInterval and PollingOff proactive commands. |
|
2666 |
// Called by SimAtkResp. |
|
2667 |
// ----------------------------------------------------------------------------- |
|
2668 |
// |
|
2669 |
void CSatMessHandler::SetPollingResult( |
|
2670 |
TUint8 aStatus, |
|
2671 |
TUint8 aTransId, |
|
2672 |
TUint8 aInterval |
|
2673 |
) |
|
2674 |
{ |
|
2675 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SETPOLLINGRESULT, "CSatMessHandler::SetPollingResult" ); |
|
2676 |
TFLOGSTRING("TSY:CSatMessHandler::SetPollingResult "); |
|
2677 |
||
2678 |
if ( UICC_STATUS_OK == aStatus ) |
|
2679 |
{ |
|
2680 |
// The response can be from a PollInterval or a PollingOff command |
|
2681 |
if ( iPollingOff ) |
|
2682 |
{ |
|
2683 |
TFLOGSTRING("TSY:CSatMessHandler::SetPollingResult, iPollingOff = ETrue"); |
|
2684 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_SETPOLLINGRESULT, "CSatMessHandler::SetPollingResult, iPollingOff = ETrue" ); |
|
2685 |
PollingOffTerminalResp( |
|
2686 |
aTransId, |
|
2687 |
iTsySatMessaging->GetNotifyPollingOff()->GetCmdDetails(), |
|
2688 |
RSat::KSuccess, |
|
2689 |
RSat::KNoAdditionalInfo ); |
|
2690 |
} |
|
2691 |
else |
|
2692 |
{ |
|
2693 |
TFLOGSTRING("TSY:CSatMessHandler::SetPollingResult, iPollingOff = EFalse"); |
|
2694 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_SETPOLLINGRESULT, "CSatMessHandler::SetPollingResult, iPollingOff = EFalse" ); |
|
2695 |
PollIntervalTerminalResp( |
|
2696 |
aTransId, |
|
2697 |
iTsySatMessaging->GetNotifyPollInterval()->GetCmdDetails(), |
|
2698 |
RSat::KSuccess, |
|
2699 |
RSat::KNoAdditionalInfo, |
|
2700 |
aInterval ); |
|
2701 |
} |
|
2702 |
} |
|
2703 |
else |
|
2704 |
{ |
|
2705 |
if ( iPollingOff ) |
|
2706 |
{ |
|
2707 |
// PollingOff was actually not executed, then set iPollingOff to false |
|
2708 |
iPollingOff = EFalse; |
|
2709 |
PollingOffTerminalResp( |
|
2710 |
aTransId, |
|
2711 |
iTsySatMessaging->GetNotifyPollingOff()->GetCmdDetails(), |
|
2712 |
RSat::KMeUnableToProcessCmd, |
|
2713 |
RSat::KNoSpecificMeProblem ); |
|
2714 |
} |
|
2715 |
else |
|
2716 |
{ |
|
2717 |
// If last request rejected and request was over 25 seconds, |
|
2718 |
// renew the request with legacy maximum. Otherwise there was |
|
2719 |
// an actual error |
|
2720 |
if ( iLongPollIntervalReq ) |
|
2721 |
{ |
|
2722 |
SetPollingInterval(aTransId, KMaxLegacyPollInterval ); |
|
2723 |
iLongPollIntervalReq = EFalse; |
|
2724 |
} |
|
2725 |
else |
|
2726 |
{ |
|
2727 |
PollIntervalTerminalResp( |
|
2728 |
aTransId, |
|
2729 |
iTsySatMessaging->GetNotifyPollInterval()->GetCmdDetails(), |
|
2730 |
RSat::KMeUnableToProcessCmd, |
|
2731 |
RSat::KNoSpecificMeProblem, |
|
2732 |
aInterval ); |
|
2733 |
} |
|
2734 |
} |
|
2735 |
} |
|
2736 |
||
2737 |
// Terminal Response is sent, reset flag |
|
2738 |
iLongPollIntervalReq = EFalse; |
|
2739 |
} |
|
2740 |
||
2741 |
// ----------------------------------------------------------------------------- |
|
2742 |
// CSatMessHandler::CheckProactiveCommand |
|
2743 |
// Method to check validity of received proactive command. |
|
2744 |
// Checked fields are: Proactive command tag, length, device id and |
|
2745 |
// command details tag. |
|
2746 |
// ----------------------------------------------------------------------------- |
|
2747 |
// |
|
2748 |
TInt CSatMessHandler::CheckProactiveCommand |
|
2749 |
( |
|
2750 |
const TIsiReceiveC& aIsiMessage // received isi message |
|
2751 |
) |
|
2752 |
{ |
|
2753 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_CHECKPROACTIVECOMMAND, "CSatMessHandler::CheckProactiveCommand" ); |
|
2754 |
TFLOGSTRING("TSY:CSatMessHandler::CheckProactiveCommand"); |
|
2755 |
||
2756 |
TTlv data; |
|
2757 |
// Get ber tlv |
|
2758 |
CBerTlv berTlv; |
|
2759 |
TBuf8<5> commandDetailsTlv; // 5 = command details data length |
|
2760 |
||
2761 |
// BerTlv method checks Proactive command tag 'D0'. |
|
2762 |
if ( KErrNone == berTlv.BerTlv( aIsiMessage ) ) |
|
2763 |
{ |
|
2764 |
TInt ret( KErrNone ); |
|
2765 |
TUint8 generalResult( 0 ); |
|
2766 |
||
2767 |
CTlv commandDetails; |
|
2768 |
CTlv deviceId; |
|
2769 |
// Get length part of TLV |
|
2770 |
TUint16 length( berTlv.GetLength() ); |
|
2771 |
||
2772 |
// compare TLVs length value and real length |
|
2773 |
if ( length > KOneByteLengthLimit ) |
|
2774 |
{ |
|
2775 |
// 5 = Proactive command tag + two byte length tag + length + SW1 |
|
2776 |
// + SW2 |
|
2777 |
// GetSize returns total size. |
|
2778 |
if ( ( length + 5 ) != berTlv.GetSize() ) |
|
2779 |
{ |
|
2780 |
// result |
|
2781 |
generalResult = RSat::KCmdDataNotUnderstood; |
|
2782 |
ret = KErrCorrupt; |
|
2783 |
} |
|
2784 |
} |
|
2785 |
// 4 = Proactive command tag + length + SW1 + SW2 |
|
2786 |
else if ( ( length + 4 ) != berTlv.GetSize() ) |
|
2787 |
{ |
|
2788 |
// result |
|
2789 |
generalResult = RSat::KCmdDataNotUnderstood; |
|
2790 |
ret = KErrCorrupt; |
|
2791 |
} |
|
2792 |
else if ( KErrNone != CheckTlvObjects( berTlv ) ) |
|
2793 |
{ |
|
2794 |
// result |
|
2795 |
generalResult = RSat::KCmdDataNotUnderstood; |
|
2796 |
ret = KErrCorrupt; |
|
2797 |
} |
|
2798 |
||
2799 |
// Check command details tlv and device id tlv |
|
2800 |
else if ( ( KErrNotFound == berTlv.TlvByTagValue( &commandDetails, |
|
2801 |
KTlvCommandDetailsTag ) ) |
|
2802 |
|| ( KErrNotFound == berTlv.TlvByTagValue( &deviceId, |
|
2803 |
KTlvDeviceIdentityTag ) ) ) |
|
2804 |
{ |
|
2805 |
// result |
|
2806 |
generalResult = RSat::KErrorRequiredValuesMissing; |
|
2807 |
ret = KErrCorrupt; |
|
2808 |
} |
|
2809 |
||
2810 |
// Check that len of command details is correct |
|
2811 |
else if( 5 != commandDetails.GetSize() ) |
|
2812 |
{ |
|
2813 |
generalResult = RSat::KCmdDataNotUnderstood; |
|
2814 |
ret = KErrCorrupt; |
|
2815 |
} |
|
2816 |
else |
|
2817 |
{ |
|
2818 |
TFLOGSTRING("TSY: CSatMessHandler::CheckProactiveCommand. Proactive command Ok."); |
|
2819 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_CHECKPROACTIVECOMMAND, "CSatMessHandler::CheckProactiveCommand Proactive command Ok." ); |
|
2820 |
} |
|
2821 |
||
2822 |
if ( KErrCorrupt == ret ) |
|
2823 |
{ |
|
2824 |
if ( !berTlv.TlvByTagValue( &commandDetails, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2825 |
KTlvCommandDetailsTag ) && |
0 | 2826 |
5 == commandDetails.GetSize() ) |
2827 |
{ |
|
2828 |
commandDetailsTlv.Copy( commandDetails.Data() ); |
|
2829 |
} |
|
2830 |
else |
|
2831 |
{ |
|
2832 |
// The SIM shall interpret a Terminal Response with a command |
|
2833 |
// number '00' as belonging to the last proactive command |
|
2834 |
// having been sent to the ME. |
|
2835 |
// See 3GPP TS 11.14 |
|
2836 |
commandDetailsTlv.FillZ( 5 ); // 5 = command details data length |
|
2837 |
} |
|
2838 |
||
2839 |
data.AddTag( KTlvResultTag ); |
|
2840 |
data.AddByte( generalResult ); |
|
2841 |
||
2842 |
UiccCatReqTerminalResponse( |
|
2843 |
commandDetailsTlv, |
|
2844 |
data.GetDataWithoutTopLevelTag(), |
|
2845 |
aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ); |
|
2846 |
return KErrCorrupt; |
|
2847 |
} |
|
2848 |
||
2849 |
return KErrNone; |
|
2850 |
} |
|
2851 |
// 'D0' is missing in the begin of the proactive command. |
|
2852 |
data.AddTag( KTlvResultTag ); |
|
2853 |
// result |
|
2854 |
data.AddByte( RSat::KErrorRequiredValuesMissing ); |
|
2855 |
// Set command details tlv to Zero, because method to read command details |
|
2856 |
// does not work if 'D0' is missing... |
|
2857 |
commandDetailsTlv.FillZ( 5 ); // 5 = command details data length |
|
2858 |
UiccCatReqTerminalResponse( |
|
2859 |
commandDetailsTlv, |
|
2860 |
data.GetDataWithoutTopLevelTag(), |
|
2861 |
aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ); |
|
2862 |
return KErrCorrupt; |
|
2863 |
} |
|
2864 |
||
2865 |
// ----------------------------------------------------------------------------- |
|
2866 |
// CSatMessHandler::MoreTimeTerminalResp |
|
2867 |
// Constructs and sends the More Time response to phonet |
|
2868 |
// ----------------------------------------------------------------------------- |
|
2869 |
// |
|
2870 |
TInt CSatMessHandler::MoreTimeTerminalResp |
|
2871 |
( |
|
2872 |
TUint8 aTransId, // Transaction id |
|
2873 |
TDes8& aCommandDetails, // Command details |
|
2874 |
TUint8 aGeneralResult // General result |
|
2875 |
) |
|
2876 |
{ |
|
2877 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_MORETIMETERMINALRESP, "CSatMessHandler::MoreTimeTerminalResp" ); |
|
2878 |
TFLOGSTRING("TSY:CSatMessHandler::MoreTimeTerminalResp"); |
|
2879 |
||
2880 |
// Create and append response data |
|
2881 |
TTlv tlvSpecificData; |
|
2882 |
||
2883 |
//create General Result TLV here |
|
2884 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
2885 |
||
2886 |
//General result |
|
2887 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
2888 |
||
2889 |
return UiccCatReqTerminalResponse( |
|
2890 |
aCommandDetails, |
|
2891 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
2892 |
aTransId ); |
|
2893 |
} |
|
2894 |
||
2895 |
// ----------------------------------------------------------------------------- |
|
2896 |
// CSatMessHandler::SmsCbRoutingReq |
|
2897 |
// Sends a request to Sms server to allow routing of Cell Broadcast messages. |
|
2898 |
// ----------------------------------------------------------------------------- |
|
2899 |
// |
|
2900 |
TInt CSatMessHandler::SmsCbRoutingReq |
|
2901 |
( |
|
2902 |
TUint8 aTransId, // Transaction Id |
|
2903 |
TUint8 aRoutingCommand // Routing command |
|
2904 |
) |
|
2905 |
{ |
|
2906 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SMSCBROUTINGREQ, "CSatMessHandler::SmsCbRoutingReq" ); |
|
2907 |
TFLOGSTRING("TSY:CSatMessHandler::SmsRoutingReq"); |
|
2908 |
||
2909 |
TInt ret( KErrNone ); |
|
2910 |
||
2911 |
// Routing is ongoing |
|
2912 |
iSmsCbRoutingComplete = EFalse; |
|
2913 |
||
2914 |
// TBuf8<SIZE_SMS_CB_ROUTING_REQ> because we are sending [U]SIM EF CBMID Message |
|
2915 |
// Subscription; |
|
2916 |
TBuf8<SIZE_SMS_CB_ROUTING_REQ> data; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2917 |
|
0 | 2918 |
// Append Routing command |
2919 |
data.Append( aRoutingCommand ); |
|
2920 |
// Append Subscription number |
|
2921 |
data.Append( SMS_NEW_SUBSCRIPTION ); |
|
2922 |
// append Subscription type |
|
2923 |
data.Append( SMS_TYPE_SIM ); |
|
2924 |
// Append Filler bytes |
|
2925 |
data.AppendFill( KPadding, 2 ); |
|
2926 |
// Append no of Subblocks |
|
2927 |
data.Append( 0 ); |
|
2928 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2929 |
// Send Subscription request |
0 | 2930 |
ret = iPnSend->Send( PN_SMS, aTransId, SMS_CB_ROUTING_REQ, |
2931 |
data ); |
|
2932 |
||
2933 |
return ret; |
|
2934 |
} |
|
2935 |
||
2936 |
// ----------------------------------------------------------------------------- |
|
2937 |
// CSatMessHandler::SmsCbRoutingResp |
|
2938 |
// Handles response from Sms server for a request of type SmsGsmTempCbRoutingReq. |
|
2939 |
// ----------------------------------------------------------------------------- |
|
2940 |
// |
|
2941 |
void CSatMessHandler::SmsCbRoutingResp |
|
2942 |
( |
|
2943 |
const TIsiReceiveC& aIsiMessage |
|
2944 |
) |
|
2945 |
{ |
|
2946 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SMSCBROUTINGRESP, "CSatMessHandler::SmsCbRoutingResp" ); |
|
2947 |
TFLOGSTRING("TSY:CSatMessHandler::SmsCbRoutingResp"); |
|
2948 |
||
2949 |
TUint8 cause( aIsiMessage.Get8bit( |
|
2950 |
ISI_HEADER_SIZE + SMS_CB_ROUTING_RESP_OFFSET_SMSCAUSE ) ); |
|
2951 |
||
2952 |
switch ( cause ) |
|
2953 |
{ |
|
2954 |
case SMS_ERR_CS_INACTIVE: |
|
2955 |
case SMS_ERR_SUBJECT_COUNT_OVERFLOW: |
|
2956 |
case SMS_ERR_DCS_COUNT_OVERFLOW: |
|
2957 |
{ |
|
2958 |
TFLOGSTRING2("TSY:CSatMessHandler::SmsCbRoutingResp \ |
|
2959 |
Routing req failed on temporary problem: %d", cause ); |
|
2960 |
OstTraceExt1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_SMSCBROUTINGRESP, "CSatMessHandler::SmsCbRoutingResp Routing req failed on temporary problem: %hhu", cause ); |
|
2961 |
iSmsCbRoutingComplete = EFalse; |
|
2962 |
break; |
|
2963 |
} |
|
2964 |
case SMS_OK: |
|
2965 |
case SMS_ERR_INVALID_SUBSCRIPTION_NR: |
|
2966 |
case SMS_ERR_INVALID_PARAMETER: |
|
2967 |
case SMS_ERR_ALL_SUBSCRIPTIONS_ALLOCATED: |
|
2968 |
default: |
|
2969 |
{ |
|
2970 |
// Routing req was either completed successfully, or permanent |
|
2971 |
// problem occured. In both cases, no need to retry. |
|
2972 |
iSmsCbRoutingComplete = ETrue; |
|
2973 |
break; |
|
2974 |
} |
|
2975 |
} |
|
2976 |
} |
|
2977 |
||
2978 |
||
2979 |
// ----------------------------------------------------------------------------- |
|
2980 |
// CSatMessHandler::SmsResourceConfInd |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
2981 |
// Handles Indication from SMS Server for resource configuration Startup |
0 | 2982 |
// and reconfigure condition . |
2983 |
// ----------------------------------------------------------------------------- |
|
2984 |
// |
|
2985 |
||
2986 |
void CSatMessHandler::SmsResourceConfInd |
|
2987 |
( |
|
2988 |
const TIsiReceiveC& aIsiMessage |
|
2989 |
) |
|
2990 |
{ |
|
2991 |
TFLOGSTRING("TSY:CSatMoSmsCtrl::SmsResourceConfIndReceived: Response for Resource confoguration Indication, Receive Indication from SMS server"); |
|
2992 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMOSMSCTRL_SMSRESOURCECONFINDRECEIVED, "CSatMoSmsCtrl::SmsResourceRespReceived: Response for Resource Configuration Ind, Receive indication from SMS server" ); |
|
2993 |
||
2994 |
// To check The receive indication is for startup or reconfiguration |
|
2995 |
if ( SMS_RES_CONF_STARTUP == aIsiMessage.Get8bit( ISI_HEADER_SIZE |
|
2996 |
+ SMS_RESOURCE_CONF_IND_OFFSET_CONFSTATUS ) ) |
|
2997 |
{ |
|
2998 |
TUint sbStartOffset( 0 ); |
|
2999 |
// Check if resource control is requested for MO SM. |
|
3000 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
3001 |
ISI_HEADER_SIZE + SIZE_SMS_RESOURCE_CONF_IND, |
|
3002 |
SMS_SB_RESOURCE_CONF_REQUIRED, |
|
3003 |
EIsiSubBlockTypeId16Len16, |
|
3004 |
sbStartOffset ) ) |
|
3005 |
{ |
|
3006 |
TUint16 resource( aIsiMessage.Get16bit( sbStartOffset + |
|
3007 |
SMS_SB_RESOURCE_CONF_REQUIRED_OFFSET_RESPP ) ); |
|
3008 |
// Check MO SMS control is supported by SIM service table |
|
3009 |
if ( SMS_RES_ID_CONF_MO_SM_INIT == resource ) |
|
3010 |
{ |
|
3011 |
if ( UICC_CARD_TYPE_UICC == iCardType ) |
|
3012 |
{ |
|
3013 |
// USIM: Read MO-SMS control from byte 4 |
|
3014 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte4, 3 ); |
|
3015 |
} |
|
3016 |
else if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
3017 |
{ |
|
3018 |
// SIM: Read MO-SMS control from byte 5 |
|
3019 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte5, 4 ); |
|
3020 |
} |
|
3021 |
} |
|
3022 |
} |
|
3023 |
} |
|
3024 |
} |
|
3025 |
||
3026 |
// ----------------------------------------------------------------------------- |
|
3027 |
// CSatMessHandler::NetCellInfoGetReq |
|
3028 |
// Creates NET_CELL_INFO_GET_REQ ISI message and sends it to Phonet |
|
3029 |
// ----------------------------------------------------------------------------- |
|
3030 |
// |
|
3031 |
TInt CSatMessHandler::NetCellInfoGetReq |
|
3032 |
( |
|
3033 |
TUint8 aTransId |
|
3034 |
) |
|
3035 |
{ |
|
3036 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETCELLINFOGETREQ, "CSatMessHandler::NetCellInfoGetReq" ); |
|
3037 |
TFLOGSTRING("TSY:CSatMessHandler::NetCellInfoGetReq"); |
|
3038 |
||
3039 |
TBuf8<1> noData; |
|
3040 |
return iPnSend->Send( |
|
3041 |
PN_MODEM_NETWORK, |
|
3042 |
aTransId, |
|
3043 |
NET_CELL_INFO_GET_REQ, |
|
3044 |
noData ); |
|
3045 |
} |
|
3046 |
||
3047 |
// ----------------------------------------------------------------------------- |
|
3048 |
// CSatMessHandler::NetCellInfoGetResp |
|
3049 |
// Breaks a NET_CELL_INFO_GET_RESP ISI-message and if this response is for |
|
3050 |
// local info proactive command then send a terminal response to the sim card. |
|
3051 |
// ----------------------------------------------------------------------------- |
|
3052 |
// |
|
3053 |
void CSatMessHandler::NetCellInfoGetResp |
|
3054 |
( |
|
3055 |
const TIsiReceiveC& aIsiMessage |
|
3056 |
) |
|
3057 |
{ |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3058 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETCELLINFOGETRESP, "CSatMessHandler::NetCellInfoGetResp" ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3059 |
TFLOGSTRING("TSY: CSatMessHandler::NetCellInfoGetResp"); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3060 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3061 |
TUint8 successCode( aIsiMessage.Get8bit( |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3062 |
ISI_HEADER_SIZE + NET_CELL_INFO_GET_RESP_OFFSET_SUCCESSCODE ) ); |
0 | 3063 |
|
3064 |
TBuf<1> additionalInfo; |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3065 |
additionalInfo.Zero(); |
0 | 3066 |
|
3067 |
// Default result |
|
3068 |
TUint8 result( RSat::KMeUnableToProcessCmd ); |
|
3069 |
||
3070 |
// Store recieved network parameters |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3071 |
TInt retValue( StoreNetServiceStatus( aIsiMessage ) ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3072 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3073 |
if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoAccTechStatus() ) |
0 | 3074 |
{ |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3075 |
if ( NET_CAUSE_OK == successCode ) |
0 | 3076 |
{ |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3077 |
if ( KErrNone == retValue ) |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3078 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3079 |
if ( NET_SERVICE == iLocInfo.iRegStatus |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3080 |
|| NET_LIMITED_SERVICE == iLocInfo.iRegStatus ) |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3081 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3082 |
result = RSat::KSuccess; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3083 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3084 |
else |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3085 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3086 |
// No service. |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3087 |
additionalInfo.Append( RSat::KNoService ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3088 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3089 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3090 |
// No else, result already set. |
0 | 3091 |
} |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3092 |
// No else, result already set. |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3093 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3094 |
// Clear local info access technology flag |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3095 |
iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoAccTechStatus( ETrue ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3096 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3097 |
else |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3098 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3099 |
switch ( iLocInfo.iRegStatus ) |
0 | 3100 |
{ |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3101 |
case NET_SERVICE: |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3102 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3103 |
result = RSat::KSuccess; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3104 |
break; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3105 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3106 |
case NET_LIMITED_SERVICE: |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3107 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3108 |
result = RSat::KSuccessLimitedService; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3109 |
break; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3110 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3111 |
case NET_NO_COVERAGE: |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3112 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3113 |
// Default result value already set |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3114 |
additionalInfo.Append( RSat::KNoService ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3115 |
break; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3116 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3117 |
default: |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3118 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3119 |
// Default result value already set |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3120 |
TFLOGSTRING2("TSY: CSatMessHandler::NetCellInfoGetResp - Unexpected iRegStatus: %d", iLocInfo.iRegStatus ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3121 |
OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETCELLINFOGETRESP, "CSatMessHandler::NetCellInfoGetResp Unexpected iRegStatus: %d", iLocInfo.iRegStatus ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3122 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3123 |
additionalInfo.Append( RSat::KNoSpecificMeProblem ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3124 |
break; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3125 |
} |
0 | 3126 |
} |
3127 |
} |
|
3128 |
||
3129 |
TInt trId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ); |
|
3130 |
||
3131 |
// Check if this response is for provide local info proactive command. |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3132 |
if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus() |
0 | 3133 |
&& iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId() |
3134 |
== trId ) |
|
3135 |
{ |
|
3136 |
// Send terminal response |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3137 |
LocalInfoTerminalResp( |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3138 |
iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId(), |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3139 |
iTsySatMessaging->GetNotifyLocalInfo()->GetCmdDetails(), |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3140 |
result, |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3141 |
additionalInfo ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3142 |
|
0 | 3143 |
// Clear local info flag |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3144 |
iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue ); |
0 | 3145 |
} |
3146 |
} |
|
3147 |
||
3148 |
||
3149 |
// ----------------------------------------------------------------------------- |
|
3150 |
// CSatMessHandler::GssCsServiceReq |
|
3151 |
// Constructs GSS_CS_SERVICE_REQ ISI message. |
|
3152 |
// ----------------------------------------------------------------------------- |
|
3153 |
// |
|
3154 |
TInt CSatMessHandler::GssCsServiceReq |
|
3155 |
( |
|
3156 |
TUint8 aTransId, // Transaction Id |
|
3157 |
TUint8 aOperation // Gss operation |
|
3158 |
) |
|
3159 |
{ |
|
3160 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSSCSSERVICEREQ, "CSatMessHandler::GssCsServiceReq" ); |
|
3161 |
TFLOGSTRING("TSY: CSatMessHandler::GssCsServiceReq "); |
|
3162 |
||
3163 |
TBuf8<2> data; |
|
3164 |
data.Append( aOperation ); |
|
3165 |
data.Append( 0x00 ); // number of subblocks |
|
3166 |
return iPnSend->Send( PN_GSS, aTransId, GSS_CS_SERVICE_REQ, data ); |
|
3167 |
} |
|
3168 |
||
3169 |
// ----------------------------------------------------------------------------- |
|
3170 |
// CSatMessHandler::GssCsServiceResp |
|
3171 |
// Breaks GSS_CS_SERVICE_RESP ISI message. |
|
3172 |
// ----------------------------------------------------------------------------- |
|
3173 |
// |
|
3174 |
void CSatMessHandler::GssCsServiceResp |
|
3175 |
( |
|
3176 |
const TIsiReceiveC& aIsiMessage // Received isi messge |
|
3177 |
) |
|
3178 |
{ |
|
3179 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSSCSSERVICERESP, "CSatMessHandler::GssCsServiceResp" ); |
|
3180 |
TFLOGSTRING("CSatMessHandler::GssCsServiceResp "); |
|
3181 |
||
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3182 |
if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus() ) |
0 | 3183 |
{ |
3184 |
TUint8 generalResult ( RSat::KSuccess ); |
|
3185 |
||
3186 |
// Provide local info proactive command is ongoing |
|
3187 |
||
3188 |
TBuf<1> additionalInfo; |
|
3189 |
additionalInfo.Zero(); |
|
3190 |
||
3191 |
// Get transaction id |
|
3192 |
TUint8 transId( |
|
3193 |
iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId() ); |
|
3194 |
// Get command details tlv |
|
3195 |
TBuf8<5> commandDetails; |
|
3196 |
commandDetails = |
|
3197 |
iTsySatMessaging->GetNotifyLocalInfo()->GetCmdDetails(); |
|
3198 |
||
3199 |
// If this is a Timing advance response and message includes subblocks |
|
3200 |
if ( GSS_ATK_TIMING_ADVANCE_GET == aIsiMessage.Get8bit( |
|
3201 |
ISI_HEADER_SIZE + GSS_CS_SERVICE_RESP_OFFSET_OPERATION ) |
|
3202 |
&& |
|
3203 |
0 < aIsiMessage.Get8bit( |
|
3204 |
ISI_HEADER_SIZE + GSS_CS_SERVICE_RESP_OFFSET_NBROFSUBBLOCKS ) ) |
|
3205 |
{ |
|
3206 |
// GSS_ATK_TIMING_ADVANCE sub block |
|
3207 |
||
3208 |
// SubBlock offset |
|
3209 |
TUint sbOffset( 0 ); |
|
3210 |
||
3211 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
3212 |
ISI_HEADER_SIZE + SIZE_GSS_CS_SERVICE_RESP, |
|
3213 |
GSS_ATK_TIMING_ADVANCE, |
|
3214 |
EIsiSubBlockTypeId8Len8, |
|
3215 |
sbOffset) ) |
|
3216 |
{ |
|
3217 |
// Store Timing Advance Status |
|
3218 |
iTaStatus = aIsiMessage.Get8bit( |
|
3219 |
sbOffset + GSS_ATK_TIMING_ADVANCE_OFFSET_TASTATUS ); |
|
3220 |
||
3221 |
TFLOGSTRING2("TSY: CSatMessHandler::GssCsServiceResp iTaStatus=%d", iTaStatus); |
|
3222 |
OstTraceExt1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_GSSCSSERVICERESP, "CSatMessHandler::GssCsServiceResp iTaStatus: %hhu", iTaStatus ); |
|
3223 |
||
3224 |
// Store timing advance |
|
3225 |
iTimingAdvance = aIsiMessage.Get8bit( |
|
3226 |
sbOffset + GSS_ATK_TIMING_ADVANCE_OFFSET_TIMINGADVANCE ); |
|
3227 |
||
3228 |
TFLOGSTRING2("TSY: CSatMessHandler::GssCsServiceResp \ |
|
3229 |
iTimingAdvance=%d", iTimingAdvance); |
|
3230 |
OstTraceExt1( TRACE_NORMAL, DUP2_CSATMESSHANDLER_GSSCSSERVICERESP, "CSatMessHandler::GssCsServiceResp iTimingAdvance: %hhu", iTimingAdvance ); |
|
3231 |
||
3232 |
if ( GSS_TIMING_ADVANCE_NOT_AVAILABLE == iTimingAdvance ) |
|
3233 |
{ |
|
3234 |
generalResult = RSat::KMeUnableToProcessCmd; |
|
3235 |
} |
|
3236 |
} |
|
3237 |
else |
|
3238 |
{ |
|
3239 |
generalResult = RSat::KErrorRequiredValuesMissing; |
|
3240 |
} |
|
3241 |
||
3242 |
// Call local info terminal response method to send |
|
3243 |
// terminal response to the sim card. |
|
3244 |
LocalInfoTerminalResp( transId, |
|
3245 |
commandDetails, |
|
3246 |
generalResult, |
|
3247 |
additionalInfo ); |
|
3248 |
||
3249 |
// Clear local info flag |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3250 |
iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue ); |
0 | 3251 |
} |
3252 |
else |
|
3253 |
{ |
|
3254 |
// No service |
|
3255 |
additionalInfo.Append( RSat::KNoService ); |
|
3256 |
||
3257 |
// Clear local info flag |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3258 |
iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue ); |
0 | 3259 |
|
3260 |
// Call local info terminal response method to send |
|
3261 |
// terminal response to the sim card. |
|
3262 |
LocalInfoTerminalResp( transId, |
|
3263 |
commandDetails, |
|
3264 |
RSat::KMeUnableToProcessCmd, |
|
3265 |
additionalInfo ); |
|
3266 |
} |
|
3267 |
} |
|
3268 |
} |
|
3269 |
||
3270 |
// ----------------------------------------------------------------------------- |
|
3271 |
// CSatMessHandler::GssCsServiceFailResp |
|
3272 |
// Breaks a GSS_CS_SERVICE_FAIL_RESP ISI message. |
|
3273 |
// ----------------------------------------------------------------------------- |
|
3274 |
// |
|
3275 |
void CSatMessHandler::GssCsServiceFailResp |
|
3276 |
( |
|
3277 |
const TIsiReceiveC& aIsiMessage // Received isi messge |
|
3278 |
) |
|
3279 |
{ |
|
3280 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GSSCSSERVICEFAILRESP, "CSatMessHandler::GssCsServiceFailResp" ); |
|
3281 |
TFLOGSTRING("CSatMessHandler::GssCsServiceFailResp "); |
|
3282 |
||
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3283 |
if ( iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus() ) |
0 | 3284 |
{ |
3285 |
if ( GSS_ATK_TIMING_ADVANCE_GET == aIsiMessage.Get8bit( |
|
3286 |
ISI_HEADER_SIZE + GSS_CS_SERVICE_RESP_OFFSET_OPERATION ) ) |
|
3287 |
{ |
|
3288 |
TBuf<1> additionalInfo; |
|
3289 |
additionalInfo.Zero(); |
|
3290 |
additionalInfo.Append( RSat::KNoService ); |
|
3291 |
// Get transaction id |
|
3292 |
TUint8 transId( |
|
3293 |
iTsySatMessaging->GetNotifyLocalInfo()->GetTransactionId() ); |
|
3294 |
// Get command details tlv |
|
3295 |
TBuf8<5> commandDetails; |
|
3296 |
commandDetails = |
|
3297 |
iTsySatMessaging->GetNotifyLocalInfo()->GetCmdDetails(); |
|
3298 |
||
3299 |
// Call local info terminal response method to send |
|
3300 |
// terminal response to the sim card. |
|
3301 |
LocalInfoTerminalResp( transId, |
|
3302 |
commandDetails, |
|
3303 |
RSat::KMeUnableToProcessCmd, |
|
3304 |
additionalInfo ); |
|
3305 |
||
3306 |
// Clear local info flag |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
3307 |
iTsySatMessaging->GetNotifyLocalInfo()->LocalInfoStatus( ETrue ); |
0 | 3308 |
} |
3309 |
} |
|
3310 |
} |
|
3311 |
||
3312 |
// ----------------------------------------------------------------------------- |
|
3313 |
// CSatMessHandler::LanguageNotificationTerminalResp |
|
3314 |
// Constructs LanguageNotification specific part of terminal |
|
3315 |
// response and calls SendTerminalResponse to send the terminal response |
|
3316 |
// ----------------------------------------------------------------------------- |
|
3317 |
// |
|
3318 |
TInt CSatMessHandler::LanguageNotificationTerminalResp |
|
3319 |
( |
|
3320 |
TUint8 aTransId, // Transaction id |
|
3321 |
TDes8& aCommandDetails, // Comamnd number |
|
3322 |
TUint8 aGeneralResult, // General result |
|
3323 |
TUint8 aAdditionalInfo // additional info |
|
3324 |
) |
|
3325 |
{ |
|
3326 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_LANGUAGENOTIFICATIONTERMINALRESP, "CSatMessHandler::LanguageNotificationTerminalResp" ); |
|
3327 |
TFLOGSTRING("TSY:CSatMessHandler::LanguageNotificationTerminalResp"); |
|
3328 |
||
3329 |
TTlv tlvSpecificData; |
|
3330 |
// Create general result TLV here |
|
3331 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
3332 |
||
3333 |
// General result |
|
3334 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
3335 |
||
3336 |
if ( RSat::KSuccess != aGeneralResult ) |
|
3337 |
{ |
|
3338 |
tlvSpecificData.AddByte( aAdditionalInfo ); |
|
3339 |
} |
|
3340 |
||
3341 |
return UiccCatReqTerminalResponse( |
|
3342 |
aCommandDetails, |
|
3343 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
3344 |
aTransId ); |
|
3345 |
} |
|
3346 |
||
3347 |
// ----------------------------------------------------------------------------- |
|
3348 |
// CSatMessHandler::NetTimeInd |
|
3349 |
// Break's a NET_TIME_IND isi-message and stores time zone information. |
|
3350 |
// Time zone is needed in provide local information proactive command. |
|
3351 |
// ----------------------------------------------------------------------------- |
|
3352 |
// |
|
3353 |
void CSatMessHandler::NetTimeInd |
|
3354 |
( |
|
3355 |
const TIsiReceiveC& aIsiMessage |
|
3356 |
) |
|
3357 |
{ |
|
3358 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETTIMEIND, "CSatMessHandler::NetTimeInd" ); |
|
3359 |
TFLOGSTRING("TSY: CSatMessHandler::NetTimeInd"); |
|
3360 |
||
3361 |
// NET_TIME_INFO is mandatory sub block |
|
3362 |
||
3363 |
// SubBlock offset |
|
3364 |
TUint sbOffset( 0 ); |
|
3365 |
||
3366 |
// Find NET_TIME_INFO subblock |
|
3367 |
TInt ret ( aIsiMessage.FindSubBlockOffsetById( |
|
3368 |
ISI_HEADER_SIZE + SIZE_NET_TIME_IND, |
|
3369 |
NET_TIME_INFO, |
|
3370 |
EIsiSubBlockTypeId8Len8, |
|
3371 |
sbOffset ) ); |
|
3372 |
||
3373 |
if ( KErrNone == ret ) |
|
3374 |
{ |
|
3375 |
// Get timezone |
|
3376 |
// If the time zone is invalid or time zone is unknown, all bits are |
|
3377 |
// set to 1 (including B6). |
|
3378 |
iTimeZone = aIsiMessage.Get8bit( sbOffset + NET_TIME_INFO_OFFSET_TIMEZONE ); |
|
3379 |
TFLOGSTRING2("TSY: CSatMessHandler::NetTimeInd, Time zone: 0x%x", iTimeZone ); |
|
3380 |
OstTraceExt1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETTIMEIND, "CSatMessHandler::NetTimeInd Time zone: %hhu", iTimeZone ); |
|
3381 |
} |
|
3382 |
} |
|
3383 |
||
3384 |
// ----------------------------------------------------------------------------- |
|
3385 |
// CSatMessHandler::OpenChannelTerminalResp |
|
3386 |
// Constructs Open Channel specific part of terminal |
|
3387 |
// response and calls SendTerminalResponse to send the terminal response. |
|
3388 |
// ----------------------------------------------------------------------------- |
|
3389 |
// |
|
3390 |
TInt CSatMessHandler::OpenChannelTerminalResp |
|
3391 |
( |
|
3392 |
TUint8 aTransId, // Transaction Id |
|
3393 |
TDes8& aCommandDetails, // Command details |
|
3394 |
TUint8 aGeneralResult, // General Result |
|
3395 |
TDes8& aAdditionalInfo, // Additional Info |
|
3396 |
TUint8 aBearerType, // Bearer type |
|
3397 |
TDesC8& aBearer, // Bearer |
|
3398 |
TUint16 aBufferSize // Buffer size |
|
3399 |
) |
|
3400 |
{ |
|
3401 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_OPENCHANNELTERMINALRESP, "CSatMessHandler::OpenChannelTerminalResp" ); |
|
3402 |
TFLOGSTRING("CSatMessHandler::OpenChannelTerminalResp"); |
|
3403 |
||
3404 |
// Create and append response data |
|
3405 |
TTlv tlvSpecificData; |
|
3406 |
||
3407 |
//create General Result TLV here |
|
3408 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
3409 |
||
3410 |
//General result |
|
3411 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
3412 |
||
3413 |
if ( ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
3414 |
|| ( RSat::KNetworkUnableToProcessCmd == aGeneralResult ) |
|
3415 |
|| ( RSat::KInteractionWithCCPermanentError == aGeneralResult ) |
|
3416 |
|| ( RSat::KErrorRequiredValuesMissing == aGeneralResult ) |
|
3417 |
|| ( RSat::KBearerIndepProtocolError == aGeneralResult ) ) |
|
3418 |
{ |
|
3419 |
if( aAdditionalInfo.Length()) |
|
3420 |
// UNSuccessful result neccessitating additional info byte |
|
3421 |
tlvSpecificData.AddByte( aAdditionalInfo[1] ); |
|
3422 |
} |
|
3423 |
else if ( RSat::KSuccess == aGeneralResult |
|
3424 |
|| ( RSat::KPartialComprehension == aGeneralResult ) |
|
3425 |
|| ( RSat::KMissingInformation == aGeneralResult ) |
|
3426 |
|| ( RSat::KPerformedWithModifications == aGeneralResult ) |
|
3427 |
|| ( RSat::KSuccessRequestedIconNotDisplayed == aGeneralResult ) ) |
|
3428 |
{ |
|
3429 |
// Successful result: append Channel Status using |
|
3430 |
// additional info. |
|
3431 |
for ( TInt i=0; i<aAdditionalInfo.Length();i+=4 ) |
|
3432 |
{ |
|
3433 |
tlvSpecificData.AddTag( KTlvChannelStatusTag ); |
|
3434 |
tlvSpecificData.AddByte( aAdditionalInfo[i+1] ); |
|
3435 |
tlvSpecificData.AddByte( aAdditionalInfo[i+3] ); |
|
3436 |
} |
|
3437 |
} |
|
3438 |
else |
|
3439 |
{ |
|
3440 |
TFLOGSTRING("TSY: CSatMessHandler::OpenChannelTerminalResp, General result did not match."); |
|
3441 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_OPENCHANNELTERMINALRESP, "CSatMessHandler::OpenChannelTerminalResp, General result did not match." ); |
|
3442 |
} |
|
3443 |
||
3444 |
// For any result: |
|
3445 |
// Append Bearer Description data |
|
3446 |
||
3447 |
if ( aBearer.Length() ) |
|
3448 |
{ |
|
3449 |
tlvSpecificData.AddTag( KTlvBearerDescriptionTag ); |
|
3450 |
tlvSpecificData.AddByte( aBearerType ); |
|
3451 |
tlvSpecificData.AddData( aBearer ); |
|
3452 |
} |
|
3453 |
else |
|
3454 |
{ |
|
3455 |
// Well, if Sat Server doesn't provide it, |
|
3456 |
// then what values should we use in here?? |
|
3457 |
||
3458 |
} |
|
3459 |
// Append Buffer Size |
|
3460 |
tlvSpecificData.AddTag( KTlvBufferSizeTag ); |
|
3461 |
tlvSpecificData.AddByte( TUint8( (aBufferSize&0xFF00)>>8 )); |
|
3462 |
tlvSpecificData.AddByte( TUint8( aBufferSize&0x00FF ) ); |
|
3463 |
||
3464 |
return UiccCatReqTerminalResponse( |
|
3465 |
aCommandDetails, |
|
3466 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
3467 |
aTransId ); |
|
3468 |
} |
|
3469 |
||
3470 |
// ----------------------------------------------------------------------------- |
|
3471 |
// CSatMessHandler::GetChannelStatusTerminalResp |
|
3472 |
// Constructs Get Channel Status specific part of terminal |
|
3473 |
// response and calls SendTerminalResponse method to send it. |
|
3474 |
// ----------------------------------------------------------------------------- |
|
3475 |
// |
|
3476 |
TInt CSatMessHandler::GetChannelStatusTerminalResp |
|
3477 |
( |
|
3478 |
TUint8 aTransId, |
|
3479 |
TDes8 &aCommandDetails, |
|
3480 |
TUint8 aGeneralResult, |
|
3481 |
const TDes8& aAdditionalInfo |
|
3482 |
) |
|
3483 |
{ |
|
3484 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GETCHANNELSTATUSTERMINALRESP, "CSatMessHandler::GetChannelStatusTerminalResp" ); |
|
3485 |
TFLOGSTRING("CSatMessHandler::GetChannelStatusTerminalResp"); |
|
3486 |
TTlv tlvSpecificData; |
|
3487 |
// Append general result tag |
|
3488 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
3489 |
// Append general result |
|
3490 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
3491 |
||
3492 |
if ( ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
3493 |
|| ( RSat::KNetworkUnableToProcessCmd == aGeneralResult ) |
|
3494 |
|| ( RSat::KInteractionWithCCPermanentError == aGeneralResult ) |
|
3495 |
|| ( RSat::KErrorRequiredValuesMissing == aGeneralResult ) |
|
3496 |
|| ( RSat::KBearerIndepProtocolError == aGeneralResult ) ) |
|
3497 |
{ |
|
3498 |
// UNSuccessful result neccessitating additional info byte |
|
3499 |
tlvSpecificData.AddData( aAdditionalInfo ); |
|
3500 |
} |
|
3501 |
else if ( RSat::KSuccess == aGeneralResult ) |
|
3502 |
{ |
|
3503 |
// Length check is carried out in |
|
3504 |
// CSatNotifyGetChannelStatus::TerminalResponseL |
|
3505 |
for ( TInt i=0; i<aAdditionalInfo.Length();i+=4 ) |
|
3506 |
{ |
|
3507 |
tlvSpecificData.AddTag( KTlvChannelStatusTag ); |
|
3508 |
tlvSpecificData.AddByte( aAdditionalInfo[i+1] ); |
|
3509 |
tlvSpecificData.AddByte( aAdditionalInfo[i+3] ); |
|
3510 |
} |
|
3511 |
||
3512 |
} |
|
3513 |
else |
|
3514 |
{ |
|
3515 |
TFLOGSTRING("CSatMessHandler::GetChannelStatusTerminalResp - mandatory channel status missing"); |
|
3516 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_GETCHANNELSTATUSTERMINALRESP, "CSatMessHandler::GetChannelStatusTerminalResp - mandatory channel status missing" ); |
|
3517 |
} |
|
3518 |
||
3519 |
return UiccCatReqTerminalResponse( |
|
3520 |
aCommandDetails, |
|
3521 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
3522 |
aTransId ); |
|
3523 |
} |
|
3524 |
||
3525 |
// ----------------------------------------------------------------------------- |
|
3526 |
// CSatMessHandler::CloseChannelTerminalResp |
|
3527 |
// Constructs Close Channel specific part of terminal |
|
3528 |
// response and calls SendTerminalResponse method to send it. |
|
3529 |
// ----------------------------------------------------------------------------- |
|
3530 |
// |
|
3531 |
TInt CSatMessHandler::CloseChannelTerminalResp |
|
3532 |
( |
|
3533 |
TUint8 aTransId, |
|
3534 |
TDes8 &aCommandDetails, |
|
3535 |
TUint8 aGeneralResult, |
|
3536 |
const TDes8& aAdditionalInfo |
|
3537 |
) |
|
3538 |
{ |
|
3539 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_CLOSECHANNELTERMINALRESP, "CSatMessHandler::CloseChannelTerminalResp" ); |
|
3540 |
TFLOGSTRING("CSatMessHandler::CloseChannelTerminalResp"); |
|
3541 |
TTlv tlvSpecificData; |
|
3542 |
// Append general result tag |
|
3543 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
3544 |
// Append general result |
|
3545 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
3546 |
||
3547 |
if ( ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
3548 |
|| ( RSat::KNetworkUnableToProcessCmd == aGeneralResult ) |
|
3549 |
|| ( RSat::KInteractionWithCCPermanentError == aGeneralResult ) |
|
3550 |
|| ( RSat::KErrorRequiredValuesMissing == aGeneralResult ) |
|
3551 |
|| ( RSat::KBearerIndepProtocolError == aGeneralResult ) ) |
|
3552 |
{ |
|
3553 |
// UNSuccessful result neccessitating additional info byte |
|
3554 |
tlvSpecificData.AddData( aAdditionalInfo ); |
|
3555 |
} |
|
3556 |
||
3557 |
// Successful result: no additional info, |
|
3558 |
// no parameters |
|
3559 |
||
3560 |
return UiccCatReqTerminalResponse( |
|
3561 |
aCommandDetails, |
|
3562 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
3563 |
aTransId ); |
|
3564 |
} |
|
3565 |
||
3566 |
// ----------------------------------------------------------------------------- |
|
3567 |
// CSatMessHandler::SendDataTerminalResp |
|
3568 |
// Constructs Send Data specific part of terminal |
|
3569 |
// response and calls SendTerminalResponse method to send it. |
|
3570 |
// ----------------------------------------------------------------------------- |
|
3571 |
// |
|
3572 |
TInt CSatMessHandler::SendDataTerminalResp |
|
3573 |
( |
|
3574 |
TUint8 aTransId, |
|
3575 |
TDes8 &aCommandDetails, |
|
3576 |
TUint8 aGeneralResult, |
|
3577 |
const TDes8& aAdditionalInfo, |
|
3578 |
TUint8 aChannelDataLength |
|
3579 |
) |
|
3580 |
{ |
|
3581 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDDATATERMINALRESP, "CSatMessHandler::SendDataTerminalResp" ); |
|
3582 |
TFLOGSTRING("CSatMessHandler::SendDataTerminalResp"); |
|
3583 |
TTlv tlvSpecificData; |
|
3584 |
// Append general result tag |
|
3585 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
3586 |
// Append general result |
|
3587 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
3588 |
if ( ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
3589 |
|| ( RSat::KNetworkUnableToProcessCmd == aGeneralResult ) |
|
3590 |
|| ( RSat::KInteractionWithCCPermanentError == aGeneralResult ) |
|
3591 |
|| ( RSat::KErrorRequiredValuesMissing == aGeneralResult ) |
|
3592 |
|| ( RSat::KBearerIndepProtocolError == aGeneralResult ) ) |
|
3593 |
{ |
|
3594 |
// UNSuccessful result neccessitating additional info byte |
|
3595 |
tlvSpecificData.AddData( aAdditionalInfo ); |
|
3596 |
} |
|
3597 |
else if (( RSat::KSuccess == aGeneralResult ) |
|
3598 |
|| ( RSat::KSuccessRequestedIconNotDisplayed == aGeneralResult )) |
|
3599 |
{ |
|
3600 |
// Successful result: |
|
3601 |
// append Channel Status |
|
3602 |
tlvSpecificData.AddTag( KTlvChannelDataLengthTag ); |
|
3603 |
tlvSpecificData.AddByte( aChannelDataLength ); |
|
3604 |
} |
|
3605 |
else |
|
3606 |
{ |
|
3607 |
TFLOGSTRING("TSY: CSatMessHandler::SendDataTerminalResp, General result did not match."); |
|
3608 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_SENDDATATERMINALRESP, "CSatMessHandler::SendDataTerminalResp, General result did not match." ); |
|
3609 |
} |
|
3610 |
||
3611 |
return UiccCatReqTerminalResponse( |
|
3612 |
aCommandDetails, |
|
3613 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
3614 |
aTransId ); |
|
3615 |
} |
|
3616 |
||
3617 |
// ----------------------------------------------------------------------------- |
|
3618 |
// CSatMessHandler::ReceiveDataTerminalResp |
|
3619 |
// Constructs Receive Data specific part of terminal |
|
3620 |
// response and calls SendTerminalResponse method to send it. |
|
3621 |
// ----------------------------------------------------------------------------- |
|
3622 |
// |
|
3623 |
TInt CSatMessHandler::ReceiveDataTerminalResp |
|
3624 |
( |
|
3625 |
TUint8 aTransId, |
|
3626 |
TDes8& aCommandDetails, |
|
3627 |
TUint8 aGeneralResult, |
|
3628 |
const TDes8& aAdditionalInfo, |
|
3629 |
TUint8 aChannelDataLength |
|
3630 |
) |
|
3631 |
{ |
|
3632 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_RECEIVEDATATERMINALRESP, "CSatMessHandler::ReceiveDataTerminalResp" ); |
|
3633 |
TFLOGSTRING("CSatMessHandler::ReceiveDataTerminalResp"); |
|
3634 |
TTlv tlvSpecificData; |
|
3635 |
// Append general result tag |
|
3636 |
tlvSpecificData.AddTag( KTlvResultTag ); |
|
3637 |
// Append general result |
|
3638 |
tlvSpecificData.AddByte( aGeneralResult ); |
|
3639 |
if ( ( RSat::KMeUnableToProcessCmd == aGeneralResult ) |
|
3640 |
|| ( RSat::KNetworkUnableToProcessCmd == aGeneralResult ) |
|
3641 |
|| ( RSat::KInteractionWithCCPermanentError == aGeneralResult ) |
|
3642 |
|| ( RSat::KErrorRequiredValuesMissing == aGeneralResult ) |
|
3643 |
|| ( RSat::KBearerIndepProtocolError == aGeneralResult ) ) |
|
3644 |
{ |
|
3645 |
// UNSuccessful result neccessitating additional info byte |
|
3646 |
tlvSpecificData.AddData( aAdditionalInfo ); |
|
3647 |
} |
|
3648 |
else if (( RSat::KSuccess == aGeneralResult ) |
|
3649 |
|| ( RSat::KSuccessRequestedIconNotDisplayed == aGeneralResult ) |
|
3650 |
|| ( RSat::KMissingInformation == aGeneralResult )) |
|
3651 |
{ |
|
3652 |
// Successful result: |
|
3653 |
//append Channel Data using additional info |
|
3654 |
tlvSpecificData.AddTag( KTlvChannelDataTag ); |
|
3655 |
tlvSpecificData.AddData( aAdditionalInfo ); |
|
3656 |
// Channel data length |
|
3657 |
tlvSpecificData.AddTag( KTlvChannelDataLengthTag ); |
|
3658 |
tlvSpecificData.AddByte( aChannelDataLength ); |
|
3659 |
} |
|
3660 |
else |
|
3661 |
{ |
|
3662 |
TFLOGSTRING("TSY: CSatMessHandler::ReceiveDataTerminalResp, General result did not match."); |
|
3663 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_RECEIVEDATATERMINALRESP, "CSatMessHandler::ReceiveDataTerminalResp, General result did not match." ); |
|
3664 |
} |
|
3665 |
||
3666 |
return UiccCatReqTerminalResponse( |
|
3667 |
aCommandDetails, |
|
3668 |
tlvSpecificData.GetDataWithoutTopLevelTag(), |
|
3669 |
aTransId ); |
|
3670 |
} |
|
3671 |
||
3672 |
||
3673 |
// ----------------------------------------------------------------------------- |
|
3674 |
// CSatMessHandler::SendSmsResourceReq |
|
3675 |
// Send a response to SMS server after reception of SmsResourceInd. |
|
3676 |
// This response tells whether the SMS can be sent or not. |
|
3677 |
// ----------------------------------------------------------------------------- |
|
3678 |
// |
|
3679 |
TInt CSatMessHandler::SendSmsResourceReq |
|
3680 |
( |
|
3681 |
TUint8 aTransId, |
|
3682 |
TDesC8& aData, |
|
3683 |
TUint8 aReceiverObject |
|
3684 |
) |
|
3685 |
{ |
|
3686 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDSMSRESOURCERESP, "CSatMessHandler::SendSmsResourceResp" ); |
|
3687 |
TFLOGSTRING("TSY:CSatMessHandler::SendSmsResourceResp"); |
|
3688 |
||
3689 |
TIsiSend isimsg( iPnSend->SendBufferDes() ); |
|
3690 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RECEIVEROBJECT, aReceiverObject ); |
|
3691 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_SMS ); |
|
3692 |
isimsg.Set8bit( ISI_HEADER_OFFSET_TRANSID , aTransId ); |
|
3693 |
isimsg.Set8bit( ISI_HEADER_OFFSET_MESSAGEID, SMS_RESOURCE_REQ ); |
|
3694 |
isimsg.CopyData( ISI_HEADER_SIZE + SMS_RESOURCE_REQ_OFFSET_FILLERBYTE1, |
|
3695 |
aData ); |
|
3696 |
||
3697 |
// add padding |
|
3698 |
while ( iPnSend->SendBufferDes().Length() % 4 ) |
|
3699 |
{ |
|
3700 |
iPnSend->SendBufferDes().Append( 0x00 ); |
|
3701 |
} |
|
3702 |
||
3703 |
//send message |
|
3704 |
return iPnSend->Send( isimsg.Complete() ); |
|
3705 |
} |
|
3706 |
||
3707 |
// ----------------------------------------------------------------------------- |
|
3708 |
// CSatMessHandler::SsStatusInd |
|
3709 |
// Break's a SS_STATUS_IND isi-message and stores status information |
|
3710 |
// ----------------------------------------------------------------------------- |
|
3711 |
// |
|
3712 |
void CSatMessHandler::SsStatusInd |
|
3713 |
( |
|
3714 |
const TIsiReceiveC& aIsiMessage |
|
3715 |
) |
|
3716 |
{ |
|
3717 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SSSTATUSIND, "CSatMessHandler::SsStatusInd" ); |
|
3718 |
TFLOGSTRING("TSY: CSatMessHandler::SsStatusInd"); |
|
3719 |
||
3720 |
TUint8 ssStatus = aIsiMessage.Get8bit( ISI_HEADER_SIZE |
|
3721 |
+ SS_STATUS_IND_OFFSET_SSSTATUSINDICATION ); |
|
3722 |
||
3723 |
if( ( SS_STATUS_REQUEST_SERVICE_BUSY == ssStatus ) |
|
3724 |
|| ( SS_STATUS_REQUEST_SERVICE_START == ssStatus ) ) |
|
3725 |
{ |
|
3726 |
iSsStatus = ESsBusy; |
|
3727 |
} |
|
3728 |
else if( ( SS_GSM_STATUS_REQUEST_USSD_BUSY == ssStatus ) |
|
3729 |
|| ( SS_GSM_STATUS_REQUEST_USSD_START == ssStatus ) ) |
|
3730 |
{ |
|
3731 |
iSsStatus = EUssdBusy; |
|
3732 |
} |
|
3733 |
else |
|
3734 |
{ |
|
3735 |
iSsStatus = ENotBusy; |
|
3736 |
} |
|
3737 |
} |
|
3738 |
||
3739 |
// ----------------------------------------------------------------------------- |
|
3740 |
// CSatMessHandler::AdditionalInfoNeeded |
|
3741 |
// Checks if given result requires an additional info byte(s) |
|
3742 |
// ----------------------------------------------------------------------------- |
|
3743 |
// |
|
3744 |
TBool CSatMessHandler::AdditionalInfoNeeded |
|
3745 |
( |
|
3746 |
const TUint8 aGeneralResult |
|
3747 |
) |
|
3748 |
{ |
|
3749 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_ADDITIONALINFONEEDED, "CSatMessHandler::AdditionalInfoNeeded" ); |
|
3750 |
// NOTE: This method shall not be used with SendSS proactive command as its |
|
3751 |
// additional info handling differs from other commands. |
|
3752 |
||
3753 |
TBool ret( EFalse ); |
|
3754 |
||
3755 |
switch ( aGeneralResult ) |
|
3756 |
{ |
|
3757 |
// This list is based on 3GPP TS 11.14 chapter 12.12 |
|
3758 |
case RSat::KMeUnableToProcessCmd: |
|
3759 |
case RSat::KNetworkUnableToProcessCmd: |
|
3760 |
case RSat::KLaunchBrowserError: |
|
3761 |
case RSat::KSsReturnError: |
|
3762 |
case RSat::KSmsRpError: |
|
3763 |
case RSat::KUssdReturnError: |
|
3764 |
case RSat::KMultipleCardCmdsError: |
|
3765 |
case RSat::KInteractionWithCCPermanentError: |
|
3766 |
case RSat::KBearerIndepProtocolError: |
|
3767 |
{ |
|
3768 |
ret = ETrue; |
|
3769 |
break; |
|
3770 |
} |
|
3771 |
default: |
|
3772 |
{ |
|
3773 |
// do nothing. ret is already set to EFalse |
|
3774 |
break; |
|
3775 |
} |
|
3776 |
} |
|
3777 |
return ret; |
|
3778 |
} |
|
3779 |
||
3780 |
||
3781 |
// ----------------------------------------------------------------------------- |
|
3782 |
// CSatMessHandler:: ReceiveMessageL |
|
3783 |
// Called by phonet receiver when an ISI message |
|
3784 |
// has been received |
|
3785 |
// ----------------------------------------------------------------------------- |
|
3786 |
// |
|
3787 |
void CSatMessHandler::ReceiveMessageL |
|
3788 |
( |
|
3789 |
const TIsiReceiveC& aIsiMessage |
|
3790 |
) |
|
3791 |
{ |
|
3792 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_RECEIVEMESSAGEL, "CSatMessHandler::ReceiveMessageL" ); |
|
3793 |
TFLOGSTRING("TSY: CSatMessHandler::ReceiveMessageL"); |
|
3794 |
||
3795 |
// Get ISI message resource and id |
|
3796 |
TInt resource ( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) ); |
|
3797 |
||
3798 |
// Received AtkSwDataNtf-message can be response for an envelope |
|
3799 |
// or terminal response. Responses for TR and failed envelopes (SIM busy) |
|
3800 |
// are handled in AtkServerMessageReceivedL. All other cases are passed |
|
3801 |
// ProactiveProcedureMessageReceivedL-method |
|
3802 |
TBool handled( EFalse ); |
|
3803 |
||
3804 |
switch ( resource ) |
|
3805 |
{ |
|
3806 |
case PN_SS: |
|
3807 |
{ |
|
3808 |
SsServerMessageReceived( aIsiMessage ); |
|
3809 |
break; |
|
3810 |
} |
|
3811 |
case PN_PHONE_INFO: |
|
3812 |
{ |
|
3813 |
PhoneInfoMessageReceived( aIsiMessage ); |
|
3814 |
break; |
|
3815 |
} |
|
3816 |
case PN_MODEM_NETWORK: |
|
3817 |
{ |
|
3818 |
NetServerMessageReceived( aIsiMessage ); |
|
3819 |
break; |
|
3820 |
} |
|
3821 |
case PN_GSS: |
|
3822 |
{ |
|
3823 |
GsmStackServerMessageReceived( aIsiMessage ); |
|
3824 |
break; |
|
3825 |
} |
|
3826 |
case PN_SMS: |
|
3827 |
{ |
|
3828 |
SmsServerMessageReceived( aIsiMessage ); |
|
3829 |
break; |
|
3830 |
} |
|
3831 |
case PN_UICC: |
|
3832 |
{ |
|
3833 |
handled = UiccServerMessageReceived( aIsiMessage ); |
|
3834 |
break; |
|
3835 |
} |
|
3836 |
default: |
|
3837 |
{ |
|
3838 |
// Do nothing |
|
3839 |
break; |
|
3840 |
} |
|
3841 |
} |
|
3842 |
||
3843 |
if ( !handled ) |
|
3844 |
{ |
|
3845 |
ProactiveProcedureMessageReceivedL( aIsiMessage ); |
|
3846 |
} |
|
3847 |
} |
|
3848 |
||
3849 |
// ----------------------------------------------------------------------------- |
|
3850 |
// CSatMessHandler::HandleError |
|
3851 |
// Handles CSatMessHandler's errors that comes via PhoNetReceiver |
|
3852 |
// RunError method. |
|
3853 |
// ----------------------------------------------------------------------------- |
|
3854 |
// |
|
3855 |
void CSatMessHandler::HandleError |
|
3856 |
( |
|
3857 |
const TIsiReceiveC& /*aIsiMessage*/, |
|
3858 |
TInt /*aErrorCode*/ |
|
3859 |
) |
|
3860 |
{ |
|
3861 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_HANDLEERROR, "CSatMessHandler::HandleError" ); |
|
3862 |
// No implementation |
|
3863 |
} |
|
3864 |
||
3865 |
||
3866 |
// ----------------------------------------------------------------------------- |
|
3867 |
// CSatMessHandler::NetRatInd |
|
3868 |
// Breaks a NET_RAT_IND isi-message |
|
3869 |
// ----------------------------------------------------------------------------- |
|
3870 |
// |
|
3871 |
void CSatMessHandler::NetRatInd |
|
3872 |
( |
|
3873 |
const TIsiReceiveC& aIsiMessage // ISI message |
|
3874 |
) |
|
3875 |
{ |
|
3876 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_NETRATIND, "CSatMessHandler::NetRatInd" ); |
|
3877 |
TFLOGSTRING("TSY:CSatMessHandler::NetRatInd"); |
|
3878 |
||
3879 |
// Check the presence of subblocks |
|
3880 |
if ( 0 != aIsiMessage.Get8bit( |
|
3881 |
ISI_HEADER_SIZE + NET_RAT_IND_OFFSET_SUBBLOCKCOUNT ) ) |
|
3882 |
{ |
|
3883 |
// Subblock offset |
|
3884 |
TUint sbOffset( 0 ); |
|
3885 |
||
3886 |
// NET_RAT_INFO sub block |
|
3887 |
TInt ret = aIsiMessage.FindSubBlockOffsetById( |
|
3888 |
ISI_HEADER_SIZE + SIZE_NET_RAT_IND, |
|
3889 |
NET_RAT_INFO, |
|
3890 |
EIsiSubBlockTypeId8Len8, |
|
3891 |
sbOffset ); |
|
3892 |
||
3893 |
// Check if NET_RAT_INFO sub block is present |
|
3894 |
if( KErrNone == ret ) |
|
3895 |
{ |
|
3896 |
// Get ratName |
|
3897 |
TUint8 ratName( aIsiMessage.Get8bit( |
|
3898 |
sbOffset + NET_RAT_INFO_OFFSET_RATNAME ) ); |
|
3899 |
||
3900 |
switch ( ratName ) |
|
3901 |
{ |
|
3902 |
case NET_GSM_RAT: |
|
3903 |
{ |
|
3904 |
iCurrentAccTech = KNetworkModeGsm; |
|
3905 |
iTsySatMessaging->GetEventDownload() |
|
3906 |
->SendAccessTechnologyChangeEnvelope( KNetworkModeGsm ); |
|
3907 |
break; |
|
3908 |
} |
|
3909 |
case NET_UMTS_RAT: |
|
3910 |
{ |
|
3911 |
iCurrentAccTech = KNetworkModeUtran; |
|
3912 |
iTsySatMessaging->GetEventDownload() |
|
3913 |
->SendAccessTechnologyChangeEnvelope( KNetworkModeUtran ); |
|
3914 |
break; |
|
3915 |
} |
|
3916 |
default: |
|
3917 |
{ |
|
3918 |
// Do nothing |
|
3919 |
break; |
|
3920 |
} |
|
3921 |
} |
|
3922 |
} |
|
3923 |
TFLOGSTRING2("TSY:CSatMessHandler::NetRatInd - Current Acc Tech: %d",iCurrentAccTech); |
|
3924 |
OstTraceExt1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_NETRATIND, "CSatMessHandler::NetRatInd - Current Acc Tech: %hhu", iCurrentAccTech ); |
|
3925 |
} |
|
3926 |
||
3927 |
} |
|
3928 |
||
3929 |
// ----------------------------------------------------------------------------- |
|
3930 |
// CSatMessHandler::LocationInfo |
|
3931 |
// Getter for location information structure |
|
3932 |
// ----------------------------------------------------------------------------- |
|
3933 |
// |
|
3934 |
const CSatMessHandler::TLocationInfo& CSatMessHandler::LocationInfo() |
|
3935 |
{ |
|
3936 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_LOCATIONINFO, "CSatMessHandler::LocationInfo" ); |
|
3937 |
// Extended Cell Id is provided only if both USIM and |
|
3938 |
// 3G network are present. |
|
3939 |
if ( KNetworkModeUtran != iCurrentAccTech |
|
3940 |
|| UICC_CARD_TYPE_UICC != iCardType ) |
|
3941 |
{ |
|
3942 |
// Exclude the extended Cell Id |
|
3943 |
||
3944 |
iLocInfo.iCellId.SetLength( 2 ); |
|
3945 |
} |
|
3946 |
else |
|
3947 |
{ |
|
3948 |
iLocInfo.iCellId.SetLength( 4 ); |
|
3949 |
} |
|
3950 |
||
3951 |
return iLocInfo; |
|
3952 |
} |
|
3953 |
||
3954 |
// ----------------------------------------------------------------------------- |
|
3955 |
// CSatMessHandler::SendPnAtkMessage |
|
3956 |
// Sends a PN_ATK message with the given data, sets also possible filler bytes |
|
3957 |
// ----------------------------------------------------------------------------- |
|
3958 |
// |
|
3959 |
TInt CSatMessHandler::SendPnAtkMessage |
|
3960 |
( |
|
3961 |
const TUint8 aReceiverObject, |
|
3962 |
const TUint8 aTransactionId, |
|
3963 |
const TInt aMessageId, |
|
3964 |
const TDesC8& aData |
|
3965 |
) |
|
3966 |
{ |
|
3967 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SENDPNATKMESSAGE, "CSatMessHandler::SendPnAtkMessage" ); |
|
3968 |
TFLOGSTRING("TSY:CSatMessHandler::SendPnAtkMessage"); |
|
3969 |
||
3970 |
TBuf8<KLengthTwoBytes> data; |
|
3971 |
data.Append( aTransactionId ); |
|
3972 |
data.Append( aMessageId ); |
|
3973 |
||
3974 |
// Create send buffer (sets the msg length to NULL) |
|
3975 |
TIsiSend isimsg( iPnSend->SendBufferDes() ); |
|
3976 |
||
3977 |
// Set the receiver object and resource ID |
|
3978 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RECEIVEROBJECT, aReceiverObject ); |
|
3979 |
isimsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_ATK ); |
|
3980 |
// Set Transaction ID and Msg ID at the end of the message buffer |
|
3981 |
isimsg.CopyData( ISI_HEADER_SIZE, data ); |
|
3982 |
// Copy the message data at the end of the message buffer |
|
3983 |
isimsg.CopyData( ( ISI_HEADER_SIZE + KLengthTwoBytes ), aData ); |
|
3984 |
||
3985 |
// Add padding(s) |
|
3986 |
while ( iPnSend->SendBufferDes().Length() % 4 ) |
|
3987 |
{ |
|
3988 |
iPnSend->SendBufferDes().Append( 0x00 ); |
|
3989 |
} |
|
3990 |
||
3991 |
// Send message |
|
3992 |
return iPnSend->Send( isimsg.Complete() ); |
|
3993 |
} |
|
3994 |
||
3995 |
// ----------------------------------------------------------------------------- |
|
3996 |
// CSatMessHandler::UiccApplCmdResp |
|
3997 |
// (other items were commented in a header). |
|
3998 |
// ----------------------------------------------------------------------------- |
|
3999 |
// |
|
4000 |
void CSatMessHandler::UiccApplCmdResp( const TIsiReceiveC& aIsiMessage ) |
|
4001 |
{ |
|
4002 |
TFLOGSTRING("TSY: CSatMessHandler::UiccApplCmdResp"); |
|
4003 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCAPPLCMDRESP, "CSatMessHandler::UiccApplCmdResp" ); |
|
4004 |
||
4005 |
TInt error( KErrNone ); |
|
4006 |
// Get transaction ID, status and service type |
|
4007 |
TUint8 trId( aIsiMessage.Get8bit( |
|
4008 |
ISI_HEADER_SIZE + UICC_APPL_CMD_RESP_OFFSET_TRANSID ) ); |
|
4009 |
TUint8 status( aIsiMessage.Get8bit( |
|
4010 |
ISI_HEADER_SIZE + UICC_APPL_CMD_RESP_OFFSET_STATUS ) ); |
|
4011 |
TUint8 serviceType( aIsiMessage.Get8bit( |
|
4012 |
ISI_HEADER_SIZE + |
|
4013 |
UICC_APPL_CMD_RESP_OFFSET_SERVICETYPE ) ); |
|
4014 |
||
4015 |
// Card type |
|
4016 |
iCardType = aIsiMessage.Get8bit( |
|
4017 |
ISI_HEADER_SIZE + UICC_APPL_CMD_RESP_OFFSET_CARDTYPE ); |
|
4018 |
||
4019 |
// Read file data from UICC_SB_FILE_DATA |
|
4020 |
TInt fileDataLength( 0 ); |
|
4021 |
TPtrC8 fileData; |
|
4022 |
TUint uiccSbFileDataOffset( 0 ); |
|
4023 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
4024 |
ISI_HEADER_SIZE + SIZE_UICC_APPL_CMD_RESP, |
|
4025 |
UICC_SB_FILE_DATA, |
|
4026 |
EIsiSubBlockTypeId16Len16, |
|
4027 |
uiccSbFileDataOffset ) ) |
|
4028 |
{ |
|
4029 |
fileDataLength = aIsiMessage.Get32bit( |
|
4030 |
uiccSbFileDataOffset + UICC_SB_FILE_DATA_OFFSET_DATALENGTH ); |
|
4031 |
fileData.Set( aIsiMessage.GetData( |
|
4032 |
uiccSbFileDataOffset + UICC_SB_FILE_DATA_OFFSET_DATA, |
|
4033 |
fileDataLength ) ); |
|
4034 |
} |
|
4035 |
else // Subblock is mandatory |
|
4036 |
{ |
|
4037 |
TFLOGSTRING("TSY: CSatMessHandler::UiccApplCmdResp - Mandatory subblock UICC_SB_FILE_DATA not found"); |
|
4038 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_UICCAPPLCMDRESP, "CSatMessHandler::UiccApplCmdResp - Mandatory subblock UICC_SB_FILE_DATA not found" ); |
|
4039 |
error = KErrNotFound; |
|
4040 |
} |
|
4041 |
||
4042 |
switch( trId ) |
|
4043 |
{ |
|
4044 |
// Call control, SMS PP DD, USIM MO-SMS control |
|
4045 |
case KUiccTrIdServiceTableByte4: |
|
4046 |
{ |
|
4047 |
if ( KErrNone == error ) |
|
4048 |
{ |
|
4049 |
TUint8 usedBitMaskSmsPpDd( KSmsPpDdBitMaskUsim ); |
|
4050 |
if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
4051 |
{ |
|
4052 |
usedBitMaskSmsPpDd = KSmsPpDdBitMaskSim; |
|
4053 |
} |
|
4054 |
else |
|
4055 |
{ |
|
4056 |
// MO SMS control status, only in case of USIM |
|
4057 |
SimMoSmsControlAvail( |
|
4058 |
fileData[0] & KMoSmsControlBitMaskUsim ); |
|
4059 |
} |
|
4060 |
// Get status of SMS PP DD and report to DataDownload |
|
4061 |
iTsySatMessaging->GetDataDownload()->SmsPpDlSupported( |
|
4062 |
( fileData[0] & usedBitMaskSmsPpDd ) ? ETrue : EFalse ); |
|
4063 |
} |
|
4064 |
break; |
|
4065 |
} |
|
4066 |
// MO SMS control ( this transaction ID is used for SIM only ) |
|
4067 |
case KUiccTrIdServiceTableByte5: |
|
4068 |
{ |
|
4069 |
if ( KErrNone == error ) |
|
4070 |
{ |
|
4071 |
SimMoSmsControlAvail( fileData[0] & KMoSmsControlBitMaskSim ); |
|
4072 |
} |
|
4073 |
break; |
|
4074 |
} |
|
4075 |
// USSD in Call Control ( this transaction ID is used for SIM only ) |
|
4076 |
case KUiccTrIdServiceTableByte6: |
|
4077 |
{ |
|
4078 |
iTsySatMessaging->SetStatusOfUssdSupport( |
|
4079 |
fileData[0] & KMoUssdCallControlBitMaskSim ); |
|
4080 |
break; |
|
4081 |
} |
|
4082 |
// SAT icon |
|
4083 |
case KUiccTrIdReadSatIcon: |
|
4084 |
{ |
|
4085 |
TBuf8<1> infoNotSet( 0 ); |
|
4086 |
iTsySatMessaging->GetSatIcon()-> |
|
4087 |
CompleteIconRequest( error, fileData, infoNotSet ); |
|
4088 |
break; |
|
4089 |
} |
|
4090 |
// SAT icon instance |
|
4091 |
case KUiccTrIdReadIconInstancePhase1: |
|
4092 |
case KUiccTrIdReadIconInstancePhase2: |
|
4093 |
case KUiccTrIdReadIconClut: |
|
4094 |
{ |
|
4095 |
if ( KUiccTrIdReadIconInstancePhase1 == trId ) |
|
4096 |
{ |
|
4097 |
// See image instance data context coding from |
|
4098 |
// 3GPP 31.102 v8.3.0. ANNEX B |
|
4099 |
// Save image coding scaheme |
|
4100 |
iImageCodingScheme = fileData[2]; |
|
4101 |
// File ID of instance is in bytes 4 and 5 |
|
4102 |
// Read instance file in phase 2 |
|
4103 |
TUint16 fileId( ( fileData[3] << 8 ) | fileData[4] ); |
|
4104 |
UiccReadSatIconInstanceReq( fileId ); |
|
4105 |
} |
|
4106 |
else // Instance data and clut are set here |
|
4107 |
{ |
|
4108 |
TPtrC8 data; |
|
4109 |
TBuf8<6> info; |
|
4110 |
TUint8 width( fileData[0] ); |
|
4111 |
TUint8 heigth( fileData[1] ); |
|
4112 |
TUint8 colorDepth( 1 ); |
|
4113 |
TUint16 clutOffset( 0 ); |
|
4114 |
TUint offset( 2 ); // instance data offset in basic coding |
|
4115 |
||
4116 |
// Set in case of coulor image coding |
|
4117 |
iNumberOfClut = 0; |
|
4118 |
||
4119 |
info.Append( width ); |
|
4120 |
info.Append( heigth ); |
|
4121 |
||
4122 |
// Colour image coding scheme |
|
4123 |
if ( KBlackAndWhite != iImageCodingScheme ) |
|
4124 |
{ |
|
4125 |
colorDepth = fileData[2]; |
|
4126 |
iNumberOfClut = fileData[3]; |
|
4127 |
clutOffset = ( fileData[4] << 8 | fileData[5] ); |
|
4128 |
offset = 6; |
|
4129 |
||
4130 |
// Save clut data for clut request. |
|
4131 |
// So it is not needed to read instance file from UICC |
|
4132 |
// again. |
|
4133 |
TInt clutLength( KClutEntrySize * iNumberOfClut ); |
|
4134 |
if ( 0 == clutLength ) |
|
4135 |
{ |
|
4136 |
clutLength = KClutEntrySize * 256; |
|
4137 |
} |
|
4138 |
iClutData.Set( fileData.Mid( clutOffset, clutLength )); |
|
4139 |
} |
|
4140 |
||
4141 |
info.Append( colorDepth ); |
|
4142 |
info.Append( iNumberOfClut ); |
|
4143 |
info.Append( 0x00 ); // offset (default value added) |
|
4144 |
info.Append( 0x00 ); // offset (default value added) |
|
4145 |
||
4146 |
TUint lengthInBits( width * heigth * colorDepth ); |
|
4147 |
TUint lengthInBytes( lengthInBits / 8 ); |
|
4148 |
||
4149 |
// There might be rounding error in statement above, if |
|
4150 |
// length in bits is not evenly divisible by 8 ( one byte ). |
|
4151 |
if ( lengthInBits % 8 ) |
|
4152 |
{ |
|
4153 |
lengthInBytes++; |
|
4154 |
} |
|
4155 |
||
4156 |
data.Set( fileData.Mid( offset, lengthInBytes ) ); |
|
4157 |
iTsySatMessaging->GetSatIcon()-> |
|
4158 |
CompleteIconRequest( error, data, info); |
|
4159 |
} |
|
4160 |
break; |
|
4161 |
} |
|
4162 |
default: |
|
4163 |
{ |
|
4164 |
break; |
|
4165 |
} |
|
4166 |
} // End of switch( trId ) |
|
4167 |
} |
|
4168 |
||
4169 |
||
4170 |
// ----------------------------------------------------------------------------- |
|
4171 |
// CSatMessHandler::UiccCatInd |
|
4172 |
// Breaks UICC_CAT_IND ISI-message. |
|
4173 |
// ----------------------------------------------------------------------------- |
|
4174 |
// |
|
4175 |
void CSatMessHandler::UiccCatInd |
|
4176 |
( |
|
4177 |
const TIsiReceiveC& aIsiMessage // Received ISI message |
|
4178 |
) |
|
4179 |
{ |
|
4180 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCCATIND, "CSatMessHandler::UiccCatInd" ); |
|
4181 |
TFLOGSTRING("TSY: CSatMessHandler::UiccCatInd"); |
|
4182 |
||
4183 |
// UICC status |
|
4184 |
TUint8 serviceType( aIsiMessage.Get8bit( |
|
4185 |
ISI_HEADER_SIZE + UICC_CAT_IND_OFFSET_SERVICETYPE ) ); |
|
4186 |
||
4187 |
if ( UICC_READY == serviceType ) |
|
4188 |
{ |
|
4189 |
// Card type |
|
4190 |
iCardType = aIsiMessage.Get8bit( |
|
4191 |
ISI_HEADER_SIZE + UICC_CAT_IND_OFFSET_CARDTYPE ); |
|
4192 |
||
4193 |
// Application file ID is concluded from card type |
|
4194 |
if ( UICC_CARD_TYPE_UICC == iCardType ) |
|
4195 |
{ |
|
4196 |
// ADF USIM is used, ID = '7FFF' |
|
4197 |
TBuf8<2> umtsFileId; |
|
4198 |
umtsFileId.Append( 0x7F ); |
|
4199 |
umtsFileId.Append( 0xFF ); |
|
4200 |
iApplFileId.Copy( umtsFileId ); |
|
4201 |
} |
|
4202 |
else if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
4203 |
{ |
|
4204 |
// DF GSM is used, ID = '7F20' |
|
4205 |
TBuf8<2> gsmFileId; |
|
4206 |
gsmFileId.Append( 0x7F ); |
|
4207 |
gsmFileId.Append( 0x20 ); |
|
4208 |
iApplFileId.Copy( gsmFileId ); |
|
4209 |
} |
|
4210 |
// No else, initialized to 'FFFF' in constructor. |
|
4211 |
||
4212 |
// Send terminal profile |
|
4213 |
UiccTerminalProfileReq(); |
|
4214 |
} |
|
4215 |
// Proactive command was fetched from SIM |
|
4216 |
else if ( UICC_CAT_FETCHED_CMD == serviceType ) |
|
4217 |
{ |
|
4218 |
if ( KErrNone == CheckProactiveCommand( aIsiMessage ) ) |
|
4219 |
{ |
|
4220 |
iTsySatMessaging->PCmdReceivedL( aIsiMessage ); |
|
4221 |
} |
|
4222 |
else |
|
4223 |
{ |
|
4224 |
TFLOGSTRING("TSY: Received SAT message was not valid!"); |
|
4225 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_UICCCATIND, "CSatMessHandler::UiccCatInd. Received SAT message was not valid!" ); |
|
4226 |
} |
|
4227 |
} |
|
4228 |
} |
|
4229 |
||
4230 |
// ----------------------------------------------------------------------------- |
|
4231 |
// CSatMessHandler::InfoPpReadReq |
|
4232 |
// Construct a INFO_PP_READ_REQ ISI message |
|
4233 |
// ----------------------------------------------------------------------------- |
|
4234 |
// |
|
4235 |
TInt CSatMessHandler::InfoPpReadReq |
|
4236 |
( |
|
4237 |
const TUint8 aReqType // request type |
|
4238 |
) |
|
4239 |
{ |
|
4240 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_INFOPPREADREQ, "CSatMessHandler::InfoPpReadReq" ); |
|
4241 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadReq" ); |
|
4242 |
||
4243 |
// Construct INFO_PP_READ_REQ message (INFO_BATCH_TYPE + |
|
4244 |
// sub block count + INFO_SB_PP sub block) |
|
4245 |
TBuf8<2 + SIZE_INFO_SB_PP> infoPpReadReq; |
|
4246 |
||
4247 |
//set pp batch reading to read specific product profile, thus 0. |
|
4248 |
infoPpReadReq.Append( INFO_PP_PROD_PROFILE_FEATURE ); |
|
4249 |
||
4250 |
// add sub block |
|
4251 |
infoPpReadReq.Append( 1 ); // number of sub blocks |
|
4252 |
||
4253 |
// create INFO_SB_PP sub block |
|
4254 |
TIsiSubBlock sbPPSubBlock( infoPpReadReq, INFO_SB_PP, |
|
4255 |
EIsiSubBlockTypeId8Len8 ); |
|
4256 |
// Add 0x00 as the Dynamic Value ID, used to read a static value |
|
4257 |
infoPpReadReq.Append( 0x00 ); |
|
4258 |
||
4259 |
// Add 0x01 as the length of the product profile, reading only one profile |
|
4260 |
infoPpReadReq.Append( 0x01 ); |
|
4261 |
||
4262 |
// Add the product profile feature number being requested |
|
4263 |
infoPpReadReq.Append( aReqType ); |
|
4264 |
||
4265 |
// Value of the product profile is 0x00, since reading |
|
4266 |
infoPpReadReq.Append( 0x00 ); |
|
4267 |
||
4268 |
// complete sub block and append to INFO_PP_READ_REQ |
|
4269 |
sbPPSubBlock.CompleteSubBlock(); |
|
4270 |
||
4271 |
TUint8 tempTraId( iTsySatMessaging->GetTransactionId() ); |
|
4272 |
||
4273 |
#ifdef INFO_PP_ATK_MO_SM_CONTROL |
|
4274 |
if ( INFO_PP_ATK_MO_SM_CONTROL == aReqType ) |
|
4275 |
{ |
|
4276 |
// Save transaction id to separate actions in InfoPpReadResp. |
|
4277 |
// INFO_PP_ATK_MO_SM_CONTROL is the only PP flag which causes actions |
|
4278 |
// if response is unsuccessful and there can be several simultaneous |
|
4279 |
// PP queries ongoing |
|
4280 |
iInfoPpMoSmsTraId = tempTraId; |
|
4281 |
} |
|
4282 |
#endif |
|
4283 |
||
4284 |
//create the isi message |
|
4285 |
return iPnSend->Send( |
|
4286 |
PN_INFO, |
|
4287 |
tempTraId, |
|
4288 |
INFO_PP_READ_REQ, |
|
4289 |
infoPpReadReq ); |
|
4290 |
} |
|
4291 |
||
4292 |
// ----------------------------------------------------------------------------- |
|
4293 |
// CSatMessHandler::InfoPpReadResp |
|
4294 |
// Breaks a INFO_PP_READ_RESP ISI-message. |
|
4295 |
// ----------------------------------------------------------------------------- |
|
4296 |
// |
|
4297 |
void CSatMessHandler::InfoPpReadResp |
|
4298 |
( |
|
4299 |
const TIsiReceiveC& aIsiMessage |
|
4300 |
) |
|
4301 |
{ |
|
4302 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp" ); |
|
4303 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp" ); |
|
4304 |
||
4305 |
TUint8 traId( aIsiMessage.Get8bit( ISI_HEADER_SIZE + |
|
4306 |
INFO_PP_READ_RESP_OFFSET_TRANSID ) ); |
|
4307 |
||
4308 |
TUint8 status( aIsiMessage.Get8bit( ISI_HEADER_SIZE + |
|
4309 |
INFO_PP_READ_RESP_OFFSET_STATUS ) ); |
|
4310 |
||
4311 |
TFLOGSTRING2("TSY: CSatMessHandler::InfoPpReadResp - Status: %d", |
|
4312 |
status ); |
|
4313 |
OstTraceExt1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp - Status: %hhu", status ); |
|
4314 |
||
4315 |
||
4316 |
switch ( status ) |
|
4317 |
{ |
|
4318 |
case INFO_OK: |
|
4319 |
{ |
|
4320 |
TUint sbInfoPpReadStartOffset( 0 ); |
|
4321 |
||
4322 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
4323 |
ISI_HEADER_SIZE + SIZE_INFO_PP_READ_RESP, INFO_SB_PP, |
|
4324 |
EIsiSubBlockTypeId8Len8, sbInfoPpReadStartOffset ) ) |
|
4325 |
{ |
|
4326 |
TInt length( aIsiMessage.Get8bit( sbInfoPpReadStartOffset + |
|
4327 |
INFO_SB_PP_OFFSET_STRLEN ) ); |
|
4328 |
||
4329 |
if ( length ) |
|
4330 |
{ |
|
4331 |
// Buffer to hold product profile feature and its |
|
4332 |
// corresponding value, thus buffer size is 2 |
|
4333 |
TBuf8<2> pPFeatures; |
|
4334 |
||
4335 |
// copy 2 bytes from product profile |
|
4336 |
// 1st byte = PP Feature |
|
4337 |
// 2nd byte = PP Value |
|
4338 |
pPFeatures.Copy( aIsiMessage.GetData( |
|
4339 |
sbInfoPpReadStartOffset + |
|
4340 |
INFO_SB_PP_OFFSET_PRODUCTPROFILE, 2 ) ); |
|
4341 |
||
4342 |
#ifdef INFO_PP_ATK_MO_SM_CONTROL |
|
4343 |
// Check that product profile is requested one |
|
4344 |
if ( INFO_PP_ATK_MO_SM_CONTROL == pPFeatures [0] ) |
|
4345 |
{ |
|
4346 |
//Get the value of the MO SMS control feature |
|
4347 |
if ( INFO_PP_FALSE != pPFeatures [1] ) |
|
4348 |
{ |
|
4349 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, MO SMS control supported by ME product profile" ); |
|
4350 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, MO SMS control supported by ME product profile" ); |
|
4351 |
iMoSmsSupportedInPp = ETrue; |
|
4352 |
// Continue MO SMS control check by checking |
|
4353 |
// feature availability from USIM |
|
4354 |
if ( UICC_CARD_TYPE_UICC == iCardType ) |
|
4355 |
{ |
|
4356 |
// USIM: Read MO-SMS control from byte 4 |
|
4357 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte4, 5 ); |
|
4358 |
} |
|
4359 |
else if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
4360 |
{ |
|
4361 |
// SIM: Read MO-SMS control from byte 5 |
|
4362 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte5, 6 ); |
|
4363 |
} |
|
4364 |
} |
|
4365 |
else |
|
4366 |
{ |
|
4367 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, MO SMS control not supported by ME product profile" ); |
|
4368 |
OstTrace0( TRACE_NORMAL, DUP3_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, MO SMS control not supported by ME product profile" ); |
|
4369 |
iMoSmsSupportedInPp = EFalse; |
|
4370 |
// Feature was not activated in product profile |
|
4371 |
// Set MoSmsCtrl object´s member |
|
4372 |
// iIsMoSmsCtrlActivated to EFalse |
|
4373 |
iTsySatMessaging->GetMoSmsCtrl()->Deactivate(); |
|
4374 |
} |
|
4375 |
} |
|
4376 |
#endif // INFO_PP_ATK_MO_SM_CONTROL |
|
4377 |
||
4378 |
#ifdef INFO_PP_ENHANCED_NETWORK_SELECTION |
|
4379 |
if ( INFO_PP_ENHANCED_NETWORK_SELECTION == pPFeatures [0] ) |
|
4380 |
{ |
|
4381 |
//Get the value of the ENS feature |
|
4382 |
if ( INFO_PP_FALSE != pPFeatures [1] ) |
|
4383 |
{ |
|
4384 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, INFO_PP_ENHANCED_NETWORK_SELECTION supported by ME product profile" ); |
|
4385 |
OstTrace0( TRACE_NORMAL, DUP8_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, INFO_PP_ENHANCED_NETWORK_SELECTION supported by ME product profile" ); |
|
4386 |
iEnsSupportedInPp = ETrue; |
|
4387 |
} |
|
4388 |
else |
|
4389 |
{ |
|
4390 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, INFO_PP_ENHANCED_NETWORK_SELECTION not supported by ME product profile" ); |
|
4391 |
OstTrace0( TRACE_NORMAL, DUP9_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, INFO_PP_ENHANCED_NETWORK_SELECTION not supported by ME product profile" ); |
|
4392 |
iEnsSupportedInPp = EFalse; |
|
4393 |
} |
|
4394 |
} |
|
4395 |
#endif // INFO_PP_ENHANCED_NETWORK_SELECTION |
|
4396 |
||
4397 |
#ifdef INFO_PP_SIM_OLD_POLL_INTERVAL |
|
4398 |
if ( INFO_PP_SIM_OLD_POLL_INTERVAL == pPFeatures [0] ) |
|
4399 |
{ |
|
4400 |
//Get the value of the SIM_POLL_INTERVAL control feature |
|
4401 |
if ( INFO_PP_FALSE != pPFeatures [1] ) |
|
4402 |
{ |
|
4403 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, INFO_PP_SIM_OLD_POLL_INTERVAL supported by ME product profile" ); |
|
4404 |
OstTrace0( TRACE_NORMAL, DUP4_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, INFO_PP_SIM_OLD_POLL_INTERVAL supported by ME product profile" ); |
|
4405 |
iOldPollIntervalSupportedInPp = ETrue; |
|
4406 |
} |
|
4407 |
else |
|
4408 |
{ |
|
4409 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, INFO_PP_SIM_OLD_POLL_INTERVAL not supported by ME product profile" ); |
|
4410 |
OstTrace0( TRACE_NORMAL, DUP5_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, INFO_PP_SIM_OLD_POLL_INTERVAL not supported by ME product profile" ); |
|
4411 |
iOldPollIntervalSupportedInPp = EFalse; |
|
4412 |
} |
|
4413 |
} |
|
4414 |
#endif // INFO_PP_SIM_OLD_POLL_INTERVAL |
|
4415 |
//no else |
|
4416 |
} |
|
4417 |
} |
|
4418 |
break; |
|
4419 |
} |
|
4420 |
case INFO_NO_NUMBER: |
|
4421 |
{ |
|
4422 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, Requested feature not defined in product profile" ); |
|
4423 |
OstTrace0( TRACE_NORMAL, DUP6_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, Requested feature not defined in product profile" ); |
|
4424 |
#ifdef INFO_PP_ATK_MO_SM_CONTROL |
|
4425 |
// Request was for INFO_PP_ATK_MO_SM_CONTROL |
|
4426 |
if ( traId == iInfoPpMoSmsTraId ) |
|
4427 |
{ |
|
4428 |
// If the MO SMS feature is not defined in product profile, |
|
4429 |
// internal Boolean used as feature supported ( for refresh ) |
|
4430 |
iMoSmsSupportedInPp = ETrue; |
|
4431 |
// Continue as usual by checking feature avalability from USIM |
|
4432 |
if ( UICC_CARD_TYPE_UICC == iCardType ) |
|
4433 |
{ |
|
4434 |
// USIM: Read MO-SMS control from byte 4 |
|
4435 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte4, 5 ); |
|
4436 |
} |
|
4437 |
else if ( UICC_CARD_TYPE_ICC == iCardType ) |
|
4438 |
{ |
|
4439 |
// SIM: Read MO-SMS control from byte 5 |
|
4440 |
UiccReadServiceTableReq( KUiccTrIdServiceTableByte5, 6 ); |
|
4441 |
} |
|
4442 |
} |
|
4443 |
#endif // INFO_PP_ATK_MO_SM_CONTROL |
|
4444 |
||
4445 |
break; |
|
4446 |
} |
|
4447 |
case INFO_FAIL: |
|
4448 |
default: |
|
4449 |
{ |
|
4450 |
TFLOGSTRING("TSY: CSatMessHandler::InfoPpReadResp, - default Requested feature not supported by ME product profile" ); |
|
4451 |
OstTrace0( TRACE_NORMAL, DUP7_CSATMESSHANDLER_INFOPPREADRESP, "CSatMessHandler::InfoPpReadResp, - default Requested feature not supported by ME product profile" ); |
|
4452 |
#ifdef INFO_PP_ATK_MO_SM_CONTROL |
|
4453 |
// Request was for INFO_PP_ATK_MO_SM_CONTROL |
|
4454 |
if ( traId == iInfoPpMoSmsTraId ) |
|
4455 |
{ |
|
4456 |
iMoSmsSupportedInPp = EFalse; |
|
4457 |
iTsySatMessaging->GetMoSmsCtrl()->Deactivate(); |
|
4458 |
} |
|
4459 |
#endif // INFO_PP_ATK_MO_SM_CONTROL |
|
4460 |
||
4461 |
break; |
|
4462 |
} |
|
4463 |
} |
|
4464 |
// Zero iInfoPpMoSmsTraId if used. Not used by default. |
|
4465 |
if ( traId == iInfoPpMoSmsTraId ) |
|
4466 |
{ |
|
4467 |
iInfoPpMoSmsTraId = 0; |
|
4468 |
} |
|
4469 |
} |
|
4470 |
||
4471 |
||
4472 |
// ----------------------------------------------------------------------------- |
|
4473 |
// CSatMessHandler::CheckTlvObjects |
|
4474 |
// Validates every simple tlv object from proactive command |
|
4475 |
// ----------------------------------------------------------------------------- |
|
4476 |
// |
|
4477 |
TInt CSatMessHandler::CheckTlvObjects( CBerTlv& berTlv ) |
|
4478 |
{ |
|
4479 |
TFLOGSTRING("TSY: CSatMessHandler::CheckTlvObjects" ); |
|
4480 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_CHECKTLVOBJECTS, "CSatMessHandler::CheckTlvObjects" ); |
|
4481 |
||
4482 |
TInt ret( KErrNone ); |
|
4483 |
TPtrC8 dataPtr = berTlv.Data(); |
|
4484 |
TUint16 berTlvLength( berTlv.GetLength() ); |
|
4485 |
TInt totalLength = 0; |
|
4486 |
||
4487 |
// index is set to beginning of data inside BER-TLV object. If length |
|
4488 |
// of BER-TLV object is coded as one byte, data starts from index 2 |
|
4489 |
// and if length of BER-TLV object is coded as two bytes, data starts |
|
4490 |
// from index 3. |
|
4491 |
TInt index = 2; |
|
4492 |
||
4493 |
if( KTwoByteLengthCoding == dataPtr[KTlvLengthStartPosition] ) |
|
4494 |
{ |
|
4495 |
// data len is coded as two bytes, let's increment these variables |
|
4496 |
// so that two byte len is handled correctly |
|
4497 |
index++; |
|
4498 |
} |
|
4499 |
||
4500 |
while( berTlvLength > ( index - 2 ) ) |
|
4501 |
{ |
|
4502 |
// now index points to tag of simple TLV object, let's increment |
|
4503 |
// index by one so that it points to length of the simple TLV object |
|
4504 |
index++; |
|
4505 |
||
4506 |
// totalLength is incremented by 2 so that tag & len fields of the current |
|
4507 |
// simple tlv object are calcucated to total length of BER TLV object |
|
4508 |
totalLength += 2; |
|
4509 |
||
4510 |
if( KTwoByteLengthCoding == dataPtr[index] ) |
|
4511 |
{ |
|
4512 |
// data len is coded as two bytes, let's increment these variables |
|
4513 |
// so that two byte len is handled correctly |
|
4514 |
index++; |
|
4515 |
totalLength++; |
|
4516 |
||
4517 |
// if length of the simple TLV value is coded with two bytes, |
|
4518 |
// length of the simple TLV value must be 128-255, otherwise |
|
4519 |
// it is treaded as error |
|
4520 |
if( 0x80 > dataPtr[index] || 0xFF < dataPtr[index] ) |
|
4521 |
{ |
|
4522 |
TFLOGSTRING2("TSY: CSatMessHandler::CheckTlvObjects: corrupted simple tlv obj, len: %d even it should be 128-255", dataPtr[index] ); |
|
4523 |
OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_CHECKTLVOBJECTS, "CSatMessHandler::CheckTlvObjects; corrupted simple tlv obj, len: %d even it should be 128-255", dataPtr[index] ); |
|
4524 |
ret = KErrCorrupt; |
|
4525 |
break; |
|
4526 |
} |
|
4527 |
} |
|
4528 |
||
4529 |
else |
|
4530 |
{ |
|
4531 |
// if length of the simple TLV value is coded with one byte, |
|
4532 |
// length of the simple TLV value must be 0-127, otherwise |
|
4533 |
// it is treaded as error |
|
4534 |
if( 0x80 <= dataPtr[index] ) |
|
4535 |
{ |
|
4536 |
TFLOGSTRING2("TSY: CSatMessHandler::CheckTlvObjects: corrupted simple tlv obj, len: %d even it should be 0-127", dataPtr[index] ); |
|
4537 |
OstTrace1( TRACE_NORMAL, DUP2_CSATMESSHANDLER_CHECKTLVOBJECTS, "CSatMessHandler::CheckTlvObjects; corrupted simple tlv obj, len: %d even it should be 0-127", dataPtr[index] ); |
|
4538 |
ret = KErrCorrupt; |
|
4539 |
break; |
|
4540 |
} |
|
4541 |
} |
|
4542 |
||
4543 |
// total length is incremented by data len of the current simple |
|
4544 |
// tlv object |
|
4545 |
totalLength += dataPtr[index]; |
|
4546 |
||
4547 |
// let's move index to beginning of next simple TLV object. So |
|
4548 |
// after incrementing the index, it points to next simple TLV |
|
4549 |
// object's tag value |
|
4550 |
index += dataPtr[index] + 1; |
|
4551 |
} // end of while |
|
4552 |
||
4553 |
// let's check does length from proactive command match to |
|
4554 |
// calculated length |
|
4555 |
if( berTlvLength != totalLength ) |
|
4556 |
{ |
|
4557 |
TFLOGSTRING3("TSY: CSatMessHandler::CheckTlvObjects: proactive command len (%d) and calculated len (%d) doesn't match", berTlvLength, totalLength ); |
|
4558 |
OstTraceExt2( TRACE_NORMAL, DUP3_CSATMESSHANDLER_CHECKTLVOBJECTS, "CSatMessHandler::CheckTlvObjects; proactive command len (%d) and calculated len (%d) doesn't match", berTlvLength, totalLength ); |
|
4559 |
ret = KErrCorrupt; |
|
4560 |
} |
|
4561 |
||
4562 |
return ret; |
|
4563 |
} |
|
4564 |
||
4565 |
||
4566 |
// ----------------------------------------------------------------------------- |
|
4567 |
// CSatMessHandler::SimMoSmsControlAvail |
|
4568 |
// Activate or deactivate MO SMS Control on SMS Server |
|
4569 |
// ----------------------------------------------------------------------------- |
|
4570 |
// |
|
4571 |
void CSatMessHandler::SimMoSmsControlAvail( TUint8 aStatus ) |
|
4572 |
{ |
|
4573 |
TFLOGSTRING("TSY: CSatMessHandler::SimMoSmsControlAvail" ); |
|
4574 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SIMMOSMSCONTROLAVAIL, "CSatMessHandler::SimMoSmsControlAvail" ); |
|
4575 |
||
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4576 |
if( SIM_SERV_OK == aStatus ) |
0 | 4577 |
{ |
4578 |
// Set MoSmsCtrl object´s member iIsMoSmsCtrlActivated to ETrue |
|
4579 |
iTsySatMessaging->GetMoSmsCtrl()->Activate(); |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4580 |
// Activate the MO-SMS Control in SMS server. This is done by |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4581 |
// sending a request SMS_RESOURCE_CONF_REQ to SMS server |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4582 |
TBuf8<SIZE_SMS_RESOURCE_CONF_REQ + SIZE_SMS_SB_RESOURCE_CONF> data; |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4583 |
// Append Configuration operation |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4584 |
data.Append( SMS_RES_CONF_SET ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4585 |
// Number of Subblocks |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4586 |
data.Append( 1 ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4587 |
// Add Subblock |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4588 |
//SMS_RESOURCE_IDS to zero SMS_RES_ID_MASK_MO_SM_INIT |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4589 |
TIsiSubBlock ResourceConfReqSb( |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4590 |
data, |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4591 |
SMS_SB_RESOURCE_CONF, |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4592 |
EIsiSubBlockTypeId16Len16 ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4593 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4594 |
TSatUtility::AppendWord( SMS_RES_ID_MO_SM_INIT, data ); |
0 | 4595 |
TSatUtility::AppendWord( SMS_RES_ID_MASK_MO_SM_INIT, data); |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4596 |
|
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4597 |
ResourceConfReqSb.CompleteSubBlock(); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4598 |
SmsResoureConfReq( |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4599 |
iTsySatMessaging->GetTransactionId(), |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4600 |
SMS_RESOURCE_CONF_REQ, |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4601 |
data ); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4602 |
} |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4603 |
// should not send SMS_RESOURCE_CONF_REQ if there is no MO SMS control enabled in SIM card |
0 | 4604 |
else |
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4605 |
{ |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4606 |
// Set MoSmsCtrl object´s member IsMoSmsCtrlDeActivated to EFalse |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4607 |
iTsySatMessaging->GetMoSmsCtrl()->Deactivate(); |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
4608 |
} |
0 | 4609 |
} |
4610 |
||
4611 |
// ----------------------------------------------------------------------------- |
|
4612 |
// CSatMessHandler::UiccTerminalProfileReq |
|
4613 |
// Send terminal profile |
|
4614 |
// ----------------------------------------------------------------------------- |
|
4615 |
// |
|
4616 |
void CSatMessHandler::UiccTerminalProfileReq() |
|
4617 |
{ |
|
4618 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCTERMINALPROFILEREQ, "CSatMessHandler::UiccTerminalProfileReq" ); |
|
4619 |
TFLOGSTRING("TSY: CSatMessHandler::UiccTerminalProfileReq"); |
|
4620 |
||
4621 |
// Pointer to terminal profile buffer |
|
4622 |
const TUint8* terminalProfilePtr( NULL ); |
|
4623 |
// Size of terminal profile |
|
4624 |
TInt sizeofTerminalProfile( 0 ); |
|
4625 |
||
4626 |
if ( UICC_CARD_TYPE_UICC == iCardType ) |
|
4627 |
{ |
|
4628 |
terminalProfilePtr = &KTerminalProfileUicc[0]; |
|
4629 |
sizeofTerminalProfile = sizeof( KTerminalProfileUicc ); |
|
4630 |
} |
|
4631 |
else // ICC type |
|
4632 |
{ |
|
4633 |
terminalProfilePtr = &KTerminalProfileIcc[0]; |
|
4634 |
sizeofTerminalProfile = sizeof( KTerminalProfileIcc ); |
|
4635 |
} |
|
4636 |
||
4637 |
// Create UICC_CAT_REQ message |
|
4638 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
4639 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
4640 |
isiMsg.Set8bit( |
|
4641 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_TRANSID, |
|
4642 |
KUiccTrIdCommon ); |
|
4643 |
isiMsg.Set8bit( |
|
4644 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_MESSAGEID, |
|
4645 |
UICC_CAT_REQ ); |
|
4646 |
isiMsg.Set8bit( |
|
4647 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_SERVICETYPE, |
|
4648 |
UICC_CAT_TERMINAL_PROFILE ); |
|
4649 |
isiMsg.Set8bit( ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_NSB, 1 ); |
|
4650 |
||
4651 |
// Create UICC_SB_TERMINAL_PROFILE subblock |
|
4652 |
TBuf8<KSizeOfTerminalProfileSb> terminalProfileBuf( 0 ); |
|
4653 |
TIsiSubBlock uiccSbTerminalProfile( |
|
4654 |
terminalProfileBuf, |
|
4655 |
UICC_SB_TERMINAL_PROFILE, |
|
4656 |
EIsiSubBlockTypeId16Len16 ); |
|
4657 |
||
4658 |
// 2x filler |
|
4659 |
terminalProfileBuf.Append( KUiccPadding ); |
|
4660 |
terminalProfileBuf.Append( KUiccPadding ); |
|
4661 |
||
4662 |
// Terminal profile length (16-bit) |
|
4663 |
terminalProfileBuf.Append( 0 ); |
|
4664 |
terminalProfileBuf.Append( sizeofTerminalProfile ); |
|
4665 |
||
4666 |
// Terminal profile |
|
4667 |
terminalProfileBuf.Append( terminalProfilePtr, sizeofTerminalProfile ); |
|
4668 |
||
4669 |
// Append subblock to ISI message |
|
4670 |
isiMsg.CopyData( |
|
4671 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_REQ, |
|
4672 |
uiccSbTerminalProfile.CompleteSubBlock() ); |
|
4673 |
||
4674 |
iPnSend->Send( isiMsg.Complete() ); |
|
4675 |
} |
|
4676 |
||
4677 |
||
4678 |
// ----------------------------------------------------------------------------- |
|
4679 |
// CSatMessHandler::UiccReadServiceTable |
|
4680 |
// (other items were commented in a header). |
|
4681 |
// ----------------------------------------------------------------------------- |
|
4682 |
// |
|
4683 |
TInt CSatMessHandler::UiccReadServiceTableReq( |
|
4684 |
TUint8 aTrId, |
|
4685 |
TUint16 aFileOffset ) |
|
4686 |
{ |
|
4687 |
TFLOGSTRING2("TSY: CSatMessHandler::UiccReadServiceTableReq, transaction ID: %d", aTrId ); |
|
4688 |
OstTraceExt1( TRACE_NORMAL, CSATMESSHANDLER_UICCREADSERVICETABLE, "CSatMessHandler::UiccReadServiceTableReq;aTrId=%hhu", aTrId ); |
|
4689 |
||
4690 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
4691 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
4692 |
isiMsg.Set8bit( |
|
4693 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_TRANSID, |
|
4694 |
aTrId ); |
|
4695 |
isiMsg.Set8bit( |
|
4696 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_MESSAGEID, |
|
4697 |
UICC_APPL_CMD_REQ ); |
|
4698 |
isiMsg.Set8bit( |
|
4699 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_SERVICETYPE, |
|
4700 |
UICC_APPL_READ_TRANSPARENT ); |
|
4701 |
isiMsg.Set8bit( |
|
4702 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_APPLID, |
|
4703 |
iApplicationId ); |
|
4704 |
isiMsg.Set8bit( |
|
4705 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_SESSIONID, |
|
4706 |
UICC_SESSION_ID_NOT_USED ); |
|
4707 |
isiMsg.Set16bit( |
|
4708 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_FILLERBYTE1, |
|
4709 |
KUiccPadding ); |
|
4710 |
isiMsg.Set8bit( |
|
4711 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_NSB, |
|
4712 |
KNumOfSbsInUiccApplCmdReq ); |
|
4713 |
||
4714 |
// UICC_SB_CLIENT |
|
4715 |
TBuf8<SIZE_UICC_SB_CLIENT> uiccSbClientBuf( 0 ); |
|
4716 |
TIsiSubBlock uiccSbClient( |
|
4717 |
uiccSbClientBuf, |
|
4718 |
UICC_SB_CLIENT, |
|
4719 |
EIsiSubBlockTypeId16Len16 ); |
|
4720 |
// 3x padding |
|
4721 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4722 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4723 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4724 |
uiccSbClientBuf.Append( iUiccClientId ); |
|
4725 |
// Append subblock to ISI message |
|
4726 |
isiMsg.CopyData( KUiccApplCmdReqOffset, uiccSbClient.CompleteSubBlock() ); |
|
4727 |
||
4728 |
// UICC_SB_TRANSPARENT |
|
4729 |
TBuf8<SIZE_UICC_SB_TRANSPARENT> uiccSbTransparentBuf( 0 ); |
|
4730 |
TIsiSubBlock uiccSbTransparent( |
|
4731 |
uiccSbTransparentBuf, |
|
4732 |
UICC_SB_TRANSPARENT, |
|
4733 |
EIsiSubBlockTypeId16Len16 ); |
|
4734 |
// File offset defines which service is read, 16-bit. |
|
4735 |
// Service table is max. 10 bytes so MSB bytes are set to 0 |
|
4736 |
uiccSbTransparentBuf.Append( 0 ); |
|
4737 |
uiccSbTransparentBuf.Append( aFileOffset ); |
|
4738 |
// Data amount, 16-bit |
|
4739 |
// Read only one byte -> MSB bits are set to 0 |
|
4740 |
uiccSbTransparentBuf.Append( 0 ); |
|
4741 |
uiccSbTransparentBuf.Append( 1 ); |
|
4742 |
// Append subblock to ISI message |
|
4743 |
isiMsg.CopyData( |
|
4744 |
KUiccApplCmdReqOffset + SIZE_UICC_SB_CLIENT, |
|
4745 |
uiccSbTransparent.CompleteSubBlock() ); |
|
4746 |
||
4747 |
// UICC_SB_APPL_PATH |
|
4748 |
TBuf8<KUiccSbApplPathSize> uiccSbApplPathBuf( 0 ); |
|
4749 |
TIsiSubBlock uiccSbApplPath( |
|
4750 |
uiccSbApplPathBuf, |
|
4751 |
UICC_SB_APPL_PATH, |
|
4752 |
EIsiSubBlockTypeId16Len16 ); |
|
4753 |
// File ID is '6F38', EF UST |
|
4754 |
uiccSbApplPathBuf.Append( KUiccElemFileServiceTable >> 8 ); |
|
4755 |
uiccSbApplPathBuf.Append( KUiccElemFileServiceTable ); |
|
4756 |
// File ID SFI, 8-bit |
|
4757 |
uiccSbApplPathBuf.Append( KUiccSfiServiceTable ); |
|
4758 |
// Filler, 8-bit |
|
4759 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
4760 |
// Length of the DF path, 8-bit |
|
4761 |
uiccSbApplPathBuf.Append( KUiccFilePathLengthServiceTable ); |
|
4762 |
// Filler, 8-bit |
|
4763 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
4764 |
// Application file path: |
|
4765 |
// master file ID + application file ID |
|
4766 |
uiccSbApplPathBuf.Append( KUiccMasterFileId >> 8 ); |
|
4767 |
uiccSbApplPathBuf.Append( KUiccMasterFileId ); |
|
4768 |
uiccSbApplPathBuf.Append( iApplFileId ); |
|
4769 |
||
4770 |
// Append subblock to ISI message |
|
4771 |
isiMsg.CopyData( |
|
4772 |
KUiccApplCmdReqOffset + SIZE_UICC_SB_CLIENT + SIZE_UICC_SB_TRANSPARENT, |
|
4773 |
uiccSbApplPath.CompleteSubBlock() ); |
|
4774 |
||
4775 |
return( iPnSend->Send( isiMsg.Complete() ) ); |
|
4776 |
} |
|
4777 |
||
4778 |
||
4779 |
// ----------------------------------------------------------------------------- |
|
4780 |
// CSatMessHandler::UiccReadSatIconReq |
|
4781 |
// (other items were commented in a header). |
|
4782 |
// ----------------------------------------------------------------------------- |
|
4783 |
// |
|
4784 |
TInt CSatMessHandler::UiccReadSatIconReq( |
|
4785 |
TUint8 aRecordNumber, |
|
4786 |
TUint8 aFileOffset, |
|
4787 |
TUint8 aDataAmount, |
|
4788 |
TUint8 aTrId ) |
|
4789 |
{ |
|
4790 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
4791 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
4792 |
isiMsg.Set8bit( |
|
4793 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_TRANSID, |
|
4794 |
aTrId ); |
|
4795 |
isiMsg.Set8bit( |
|
4796 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_MESSAGEID, |
|
4797 |
UICC_APPL_CMD_REQ ); |
|
4798 |
isiMsg.Set8bit( |
|
4799 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_SERVICETYPE, |
|
4800 |
UICC_APPL_READ_TRANSPARENT ); |
|
4801 |
isiMsg.Set8bit( |
|
4802 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_APPLID, |
|
4803 |
iApplicationId ); |
|
4804 |
isiMsg.Set8bit( |
|
4805 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_SESSIONID, |
|
4806 |
UICC_SESSION_ID_NOT_USED ); |
|
4807 |
isiMsg.Set16bit( |
|
4808 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_FILLERBYTE1, |
|
4809 |
KUiccPadding ); |
|
4810 |
isiMsg.Set8bit( |
|
4811 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_NSB, |
|
4812 |
KNumOfSbsInUiccApplCmdReq ); |
|
4813 |
||
4814 |
// UICC_SB_CLIENT |
|
4815 |
TBuf8<SIZE_UICC_SB_CLIENT> uiccSbClientBuf( 0 ); |
|
4816 |
TIsiSubBlock uiccSbClient( |
|
4817 |
uiccSbClientBuf, |
|
4818 |
UICC_SB_CLIENT, |
|
4819 |
EIsiSubBlockTypeId16Len16 ); |
|
4820 |
// 3x padding |
|
4821 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4822 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4823 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4824 |
uiccSbClientBuf.Append( iUiccClientId ); |
|
4825 |
// Append subblock to ISI message |
|
4826 |
isiMsg.CopyData( KUiccApplCmdReqOffset, uiccSbClient.CompleteSubBlock() ); |
|
4827 |
||
4828 |
// UICC_SB_LINEAR_FIXED |
|
4829 |
TBuf8<SIZE_UICC_SB_LINEAR_FIXED> uiccSbLinearFixedBuf( 0 ); |
|
4830 |
TIsiSubBlock uiccSbLinearFixed( |
|
4831 |
uiccSbLinearFixedBuf, |
|
4832 |
UICC_SB_LINEAR_FIXED, |
|
4833 |
EIsiSubBlockTypeId16Len16 ); |
|
4834 |
// Record number, 8-bit |
|
4835 |
uiccSbLinearFixedBuf.Append( aRecordNumber ); |
|
4836 |
// File offset, 8-bit |
|
4837 |
uiccSbLinearFixedBuf.Append( aFileOffset ); |
|
4838 |
// Data amount, 8-bit |
|
4839 |
uiccSbLinearFixedBuf.Append( aDataAmount ); |
|
4840 |
// Append subblock to ISI message |
|
4841 |
isiMsg.CopyData( |
|
4842 |
KUiccApplCmdReqOffset + SIZE_UICC_SB_CLIENT, |
|
4843 |
uiccSbLinearFixed.CompleteSubBlock() ); |
|
4844 |
||
4845 |
// UICC_SB_APPL_PATH |
|
4846 |
TBuf8<KUiccSbApplPathSize> uiccSbApplPathBuf( 0 ); |
|
4847 |
TIsiSubBlock uiccSbApplPath( |
|
4848 |
uiccSbApplPathBuf, |
|
4849 |
UICC_SB_APPL_PATH, |
|
4850 |
EIsiSubBlockTypeId16Len16 ); |
|
4851 |
// File ID is '4F20', EF IMG |
|
4852 |
uiccSbApplPathBuf.Append( KUiccElemFileImg >> 8 ); |
|
4853 |
uiccSbApplPathBuf.Append( KUiccElemFileImg ); |
|
4854 |
// File ID SFI, 8-bit |
|
4855 |
uiccSbApplPathBuf.Append( UICC_SFI_NOT_PRESENT ); |
|
4856 |
// Filler, 8-bit |
|
4857 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
4858 |
// Length of the DF path, 8-bit |
|
4859 |
uiccSbApplPathBuf.Append( KUiccFilePathLength ); |
|
4860 |
// Filler, 8-bit |
|
4861 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
4862 |
// Application file path: |
|
4863 |
// master file + application file + dedicated file + |
|
4864 |
// elementary file |
|
4865 |
uiccSbApplPathBuf.Append( KUiccMasterFileId >> 8 ); |
|
4866 |
uiccSbApplPathBuf.Append( KUiccMasterFileId ); |
|
4867 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileTelecom >> 8 ); |
|
4868 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileTelecom ); |
|
4869 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileGraphics >> 8 ); |
|
4870 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileGraphics ); |
|
4871 |
||
4872 |
// Append subblock to ISI message |
|
4873 |
isiMsg.CopyData( |
|
4874 |
KUiccApplCmdReqOffset + SIZE_UICC_SB_CLIENT + |
|
4875 |
SIZE_UICC_SB_LINEAR_FIXED, |
|
4876 |
uiccSbApplPath.CompleteSubBlock() ); |
|
4877 |
||
4878 |
return( iPnSend->Send( isiMsg.Complete() ) ); |
|
4879 |
} |
|
4880 |
||
4881 |
||
4882 |
// ----------------------------------------------------------------------------- |
|
4883 |
// CSatMessHandler::UiccReadSatIconInstanceReq |
|
4884 |
// (other items were commented in a header). |
|
4885 |
// ----------------------------------------------------------------------------- |
|
4886 |
// |
|
4887 |
TInt CSatMessHandler::UiccReadSatIconInstanceReq( TUint16 aFileId ) |
|
4888 |
{ |
|
4889 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
4890 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
4891 |
isiMsg.Set8bit( |
|
4892 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_TRANSID, |
|
4893 |
KUiccTrIdReadIconInstancePhase2 ); |
|
4894 |
isiMsg.Set8bit( |
|
4895 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_MESSAGEID, |
|
4896 |
UICC_APPL_CMD_REQ ); |
|
4897 |
isiMsg.Set8bit( |
|
4898 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_SERVICETYPE, |
|
4899 |
UICC_APPL_READ_TRANSPARENT ); |
|
4900 |
isiMsg.Set8bit( |
|
4901 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_APPLID, |
|
4902 |
iApplicationId ); |
|
4903 |
isiMsg.Set8bit( |
|
4904 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_SESSIONID, |
|
4905 |
UICC_SESSION_ID_NOT_USED ); |
|
4906 |
isiMsg.Set16bit( |
|
4907 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_FILLERBYTE1, |
|
4908 |
KUiccPadding ); |
|
4909 |
isiMsg.Set8bit( |
|
4910 |
ISI_HEADER_SIZE + UICC_APPL_CMD_REQ_OFFSET_NSB, |
|
4911 |
KNumOfSbsInUiccApplCmdReq ); |
|
4912 |
||
4913 |
// UICC_SB_CLIENT |
|
4914 |
TBuf8<SIZE_UICC_SB_CLIENT> uiccSbClientBuf( 0 ); |
|
4915 |
TIsiSubBlock uiccSbClient( |
|
4916 |
uiccSbClientBuf, |
|
4917 |
UICC_SB_CLIENT, |
|
4918 |
EIsiSubBlockTypeId16Len16 ); |
|
4919 |
// 3x padding |
|
4920 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4921 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4922 |
uiccSbClientBuf.Append( KUiccPadding ); |
|
4923 |
uiccSbClientBuf.Append( iUiccClientId ); |
|
4924 |
// Append subblock to ISI message |
|
4925 |
isiMsg.CopyData( KUiccApplCmdReqOffset, uiccSbClient.CompleteSubBlock() ); |
|
4926 |
||
4927 |
// UICC_SB_LINEAR_FIXED |
|
4928 |
TBuf8<SIZE_UICC_SB_TRANSPARENT> uiccSbTransparentBuf( 0 ); |
|
4929 |
TIsiSubBlock uiccSbTransparent( |
|
4930 |
uiccSbTransparentBuf, |
|
4931 |
UICC_SB_TRANSPARENT, |
|
4932 |
EIsiSubBlockTypeId16Len16 ); |
|
4933 |
// File offset, 8-bit |
|
4934 |
uiccSbTransparentBuf.Append( 0 ); |
|
4935 |
// Data amount, 8-bit |
|
4936 |
uiccSbTransparentBuf.Append( 0 ); |
|
4937 |
// Append subblock to ISI message |
|
4938 |
isiMsg.CopyData( |
|
4939 |
KUiccApplCmdReqOffset + SIZE_UICC_SB_CLIENT, |
|
4940 |
uiccSbTransparent.CompleteSubBlock() ); |
|
4941 |
||
4942 |
// UICC_SB_APPL_PATH |
|
4943 |
TBuf8<KUiccSbApplPathSize> uiccSbApplPathBuf( 0 ); |
|
4944 |
TIsiSubBlock uiccSbApplPath( |
|
4945 |
uiccSbApplPathBuf, |
|
4946 |
UICC_SB_APPL_PATH, |
|
4947 |
EIsiSubBlockTypeId16Len16 ); |
|
4948 |
// File ID is '4F20', EF IMG |
|
4949 |
uiccSbApplPathBuf.Append( aFileId >> 8 ); |
|
4950 |
uiccSbApplPathBuf.Append( aFileId ); |
|
4951 |
// File ID SFI, 8-bit |
|
4952 |
uiccSbApplPathBuf.Append( UICC_EF_ID_NOT_PRESENT ); |
|
4953 |
// Filler, 8-bit |
|
4954 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
4955 |
// Length of the DF path, 8-bit |
|
4956 |
uiccSbApplPathBuf.Append( KUiccFilePathLength ); |
|
4957 |
// Filler, 8-bit |
|
4958 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
4959 |
// Application file path: |
|
4960 |
// master file + application file + dedicated file + |
|
4961 |
// elementary file |
|
4962 |
uiccSbApplPathBuf.Append( KUiccMasterFileId >> 8 ); |
|
4963 |
uiccSbApplPathBuf.Append( KUiccMasterFileId ); |
|
4964 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileTelecom >> 8 ); |
|
4965 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileTelecom ); |
|
4966 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileGraphics >> 8 ); |
|
4967 |
uiccSbApplPathBuf.Append( KUiccDedicatedFileGraphics ); |
|
4968 |
||
4969 |
// Append subblock to ISI message |
|
4970 |
isiMsg.CopyData( |
|
4971 |
KUiccApplCmdReqOffset + SIZE_UICC_SB_CLIENT + |
|
4972 |
SIZE_UICC_SB_TRANSPARENT, |
|
4973 |
uiccSbApplPath.CompleteSubBlock() ); |
|
4974 |
||
4975 |
return( iPnSend->Send( isiMsg.Complete() ) ); |
|
4976 |
} |
|
4977 |
||
4978 |
||
4979 |
// ----------------------------------------------------------------------------- |
|
4980 |
// CSatMessHandler::UiccCatReq |
|
4981 |
// Create and send UICC_CAT_REQ ISI message |
|
4982 |
// ----------------------------------------------------------------------------- |
|
4983 |
// |
|
4984 |
TInt CSatMessHandler::UiccCatReq( TUint8 aCommand ) |
|
4985 |
{ |
|
4986 |
TFLOGSTRING("TSY: CSatMessHandler::UiccCatReq"); |
|
4987 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCCATREQ, "CSatMessHandler::UiccCatReq" ); |
|
4988 |
||
4989 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
4990 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
4991 |
isiMsg.Set8bit( |
|
4992 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_TRANSID, |
|
4993 |
KUiccTrIdCommon ); |
|
4994 |
isiMsg.Set8bit( |
|
4995 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_MESSAGEID, |
|
4996 |
UICC_CAT_REQ ); |
|
4997 |
isiMsg.Set8bit( |
|
4998 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_SERVICETYPE, |
|
4999 |
aCommand ); |
|
5000 |
||
5001 |
// No subblocks |
|
5002 |
isiMsg.Set8bit( |
|
5003 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_NSB, |
|
5004 |
0 ); |
|
5005 |
||
5006 |
return( iPnSend->Send( isiMsg.Complete() ) ); |
|
5007 |
} |
|
5008 |
||
5009 |
||
5010 |
// ----------------------------------------------------------------------------- |
|
5011 |
// CSatMessHandler::UiccCatReqRefresh |
|
5012 |
// Create and send UICC_CAT_REQ ISI message for refresh command |
|
5013 |
// ----------------------------------------------------------------------------- |
|
5014 |
// |
|
5015 |
TInt CSatMessHandler::UiccCatReqRefresh( |
|
5016 |
const TUint8 aTransId, // Transaction ID |
|
5017 |
const TUint8 aServiceType, // Type of refresh |
|
5018 |
TDes8& aFileList, // List of files |
|
5019 |
const TDesC8& aAid ) // Application ID (USIM) |
|
5020 |
{ |
|
5021 |
TFLOGSTRING("TSY: CSatMessHandler::UiccCatReqRefresh"); |
|
5022 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCCATREQREFRESH, "CSatMessHandler::UiccCatReqRefresh" ); |
|
5023 |
||
5024 |
TUint8 numOfSubblocks( 1 ); // One mandatory subblock UICC_SB_REFRESH |
|
5025 |
TUint8 uiccSbOffset( |
|
5026 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_REQ + SIZE_UICC_SB_REFRESH ); |
|
5027 |
||
5028 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
5029 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
5030 |
isiMsg.Set8bit( |
|
5031 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_TRANSID, |
|
5032 |
aTransId ); |
|
5033 |
isiMsg.Set8bit( |
|
5034 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_MESSAGEID, |
|
5035 |
UICC_CAT_REQ ); |
|
5036 |
isiMsg.Set8bit( |
|
5037 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_SERVICETYPE, |
|
5038 |
UICC_CAT_REFRESH ); |
|
5039 |
||
5040 |
// Add UICC_SB_REFRESH |
|
5041 |
TBuf8<SIZE_UICC_SB_REFRESH> uiccSbRefreshBuf( 0 ); |
|
5042 |
TIsiSubBlock uiccSbRefresh( |
|
5043 |
uiccSbRefreshBuf, |
|
5044 |
UICC_SB_REFRESH, |
|
5045 |
EIsiSubBlockTypeId16Len16 ); |
|
5046 |
// Type of refresh |
|
5047 |
uiccSbRefreshBuf.Append( aServiceType ); |
|
5048 |
// 3x filler |
|
5049 |
uiccSbRefreshBuf.Append( KUiccPadding ); |
|
5050 |
uiccSbRefreshBuf.Append( KUiccPadding ); |
|
5051 |
uiccSbRefreshBuf.Append( KUiccPadding ); |
|
5052 |
// Append subblock to ISI message |
|
5053 |
isiMsg.CopyData( |
|
5054 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_REQ, |
|
5055 |
uiccSbRefresh.CompleteSubBlock() ); |
|
5056 |
||
5057 |
// Add UICC_SB_AID if needed |
|
5058 |
if ( aAid.Length() ) |
|
5059 |
{ |
|
5060 |
numOfSubblocks++; |
|
5061 |
TBuf8<KMaxLengthUiccSbAid> uiccSbAidBuf( 0 ); |
|
5062 |
TIsiSubBlock uiccSbAid( |
|
5063 |
uiccSbAidBuf, |
|
5064 |
UICC_SB_AID, |
|
5065 |
EIsiSubBlockTypeId16Len16 ); |
|
5066 |
// AID length |
|
5067 |
uiccSbAidBuf.Append( aAid.Length() ); |
|
5068 |
// Add AID |
|
5069 |
uiccSbAidBuf.Append( aAid ); |
|
5070 |
// Append subblock to ISI message |
|
5071 |
isiMsg.CopyData( uiccSbOffset, uiccSbAid.CompleteSubBlock() ); |
|
5072 |
||
5073 |
// Calculate offset for next subblock |
|
5074 |
TUint16 lengthOfUiccSbAid( uiccSbAidBuf.Length() ); // Length of UICC_SB_AID |
|
5075 |
uiccSbOffset += lengthOfUiccSbAid; |
|
5076 |
} |
|
5077 |
||
5078 |
// Add UICC_SB_APPL_PATH subblock(s) if needed |
|
5079 |
while ( aFileList.Length() ) |
|
5080 |
{ |
|
5081 |
numOfSubblocks++; |
|
5082 |
// Search last file's start position |
|
5083 |
TInt position( aFileList.LocateReverse( KRefreshMasterFileHeader ) ); |
|
5084 |
if ( KErrNotFound == position ) |
|
5085 |
{ |
|
5086 |
// File path is corrupted |
|
5087 |
TFLOGSTRING("TSY: CSatMessHandler::SimAtkReq, File path is corrupted"); |
|
5088 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_UICCCATREQREFRESH, "CSatMessHandler::UiccCatReqRefresh,File path is corrupted" ); |
|
5089 |
break; |
|
5090 |
} |
|
5091 |
||
5092 |
// Length of file path |
|
5093 |
TUint8 length( (TUint8) ( aFileList.Length() - position ) ); |
|
5094 |
// File path |
|
5095 |
TBuf8<KUiccFilePathLength> filePath( |
|
5096 |
aFileList.Mid( position, length ) ); |
|
5097 |
// File ID is two last bytes |
|
5098 |
TBuf8<KUiccFileIdLength> fileId( |
|
5099 |
filePath.Mid( filePath.Length() - 2 ) ); |
|
5100 |
||
5101 |
TBuf8<SIZE_UICC_SB_APPL_PATH + KUiccFilePathLength> |
|
5102 |
uiccSbApplPathBuf( 0 ); |
|
5103 |
TIsiSubBlock uiccSbApplPath( |
|
5104 |
uiccSbApplPathBuf, |
|
5105 |
UICC_SB_APPL_PATH, |
|
5106 |
EIsiSubBlockTypeId16Len16 ); |
|
5107 |
// Append file ID |
|
5108 |
uiccSbApplPathBuf.Append( fileId ); |
|
5109 |
// File ID SFI is not known |
|
5110 |
uiccSbApplPathBuf.Append( UICC_SFI_NOT_PRESENT ); |
|
5111 |
// Filler |
|
5112 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
5113 |
// File path length in bytes |
|
5114 |
uiccSbApplPathBuf.Append( length ); |
|
5115 |
// Filler |
|
5116 |
uiccSbApplPathBuf.Append( KUiccPadding ); |
|
5117 |
// File path |
|
5118 |
uiccSbApplPathBuf.Append( filePath ); |
|
5119 |
// Append subblock to ISI message |
|
5120 |
isiMsg.CopyData( uiccSbOffset, uiccSbApplPath.CompleteSubBlock() ); |
|
5121 |
// Update subblock offset |
|
5122 |
uiccSbOffset += uiccSbApplPathBuf.Length(); |
|
5123 |
||
5124 |
// Remove already added file from buffer |
|
5125 |
aFileList.SetLength( aFileList.Length() - length ); |
|
5126 |
// Clear buffer for a new sub block |
|
5127 |
uiccSbApplPathBuf.Zero(); |
|
5128 |
} |
|
5129 |
||
5130 |
isiMsg.Set8bit( |
|
5131 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_NSB, |
|
5132 |
numOfSubblocks ); |
|
5133 |
||
5134 |
// set flag on that we are waiting a response for a refresh request |
|
5135 |
iRefreshRequestIsOn = ETrue; |
|
5136 |
||
5137 |
return( iPnSend->Send( isiMsg.Complete() ) ); |
|
5138 |
} |
|
5139 |
||
5140 |
||
5141 |
// ----------------------------------------------------------------------------- |
|
5142 |
// CSatMessHandler::UiccCatReqTerminalResponse |
|
5143 |
// Send UICC_CAT_REQ ISI message for sending terminal response to UICC |
|
5144 |
// ----------------------------------------------------------------------------- |
|
5145 |
// |
|
5146 |
TInt CSatMessHandler::UiccCatReqTerminalResponse( |
|
5147 |
const TDes8& aCommandDetails, // Command details tlv |
|
5148 |
const TDesC8& aBerTlvSpecificData, // BER-TLV specific data |
|
5149 |
const TUint8 aTransId ) |
|
5150 |
{ |
|
5151 |
TFLOGSTRING("TSY: CSatMessHandler::UiccCatReqTerminalResponse"); |
|
5152 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCCATREQTERMINALRESPONSE, "CSatMessHandler::UiccCatReqTerminalResponse" ); |
|
5153 |
||
5154 |
TIsiSend isiMsg( iPnSend->SendBufferDes() ); |
|
5155 |
isiMsg.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_UICC ); |
|
5156 |
isiMsg.Set8bit( |
|
5157 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_TRANSID, |
|
5158 |
aTransId ); |
|
5159 |
isiMsg.Set8bit( |
|
5160 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_MESSAGEID, |
|
5161 |
UICC_CAT_REQ ); |
|
5162 |
isiMsg.Set8bit( |
|
5163 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_SERVICETYPE, |
|
5164 |
UICC_CAT_TERMINAL_RESPONSE ); |
|
5165 |
// One subblock, UICC_SB_TERMINAL_RESPONSE |
|
5166 |
isiMsg.Set8bit( |
|
5167 |
ISI_HEADER_SIZE + UICC_CAT_REQ_OFFSET_NSB, |
|
5168 |
1 ); |
|
5169 |
||
5170 |
// UICC_SB_TERMINAL_RESPONSE |
|
5171 |
TBuf8<KMaxSizeOfUiccSbTerminalResponse> uiccSbTerminalResponseBuf( 0 ); |
|
5172 |
TIsiSubBlock uiccSbTerminalResponse( |
|
5173 |
uiccSbTerminalResponseBuf, |
|
5174 |
UICC_SB_TERMINAL_RESPONSE, |
|
5175 |
EIsiSubBlockTypeId16Len16 ); |
|
5176 |
||
5177 |
// 2x filler |
|
5178 |
uiccSbTerminalResponseBuf.Append( KUiccPadding ); |
|
5179 |
uiccSbTerminalResponseBuf.Append( KUiccPadding ); |
|
5180 |
||
5181 |
if ( aCommandDetails.Length() ) |
|
5182 |
{ |
|
5183 |
// Calculate terminal response data length |
|
5184 |
// 9 = command details lenght + device identity length |
|
5185 |
TUint16 lengthOfData( ( TUint16 ) ( 9 + aBerTlvSpecificData.Length() ) ); |
|
5186 |
// Terminal response data length (2 bytes) |
|
5187 |
uiccSbTerminalResponseBuf.Append( lengthOfData >> 8 ); |
|
5188 |
uiccSbTerminalResponseBuf.Append( lengthOfData ); |
|
5189 |
||
5190 |
// Add command details |
|
5191 |
uiccSbTerminalResponseBuf.Append( aCommandDetails ); |
|
5192 |
||
5193 |
// Add device identity TLV |
|
5194 |
// Device identity tag |
|
5195 |
uiccSbTerminalResponseBuf.Append( KTlvDeviceIdentityTag ); |
|
5196 |
// Device identity TLV length |
|
5197 |
uiccSbTerminalResponseBuf.Append( KTlvDeviceIdentityLength ); |
|
5198 |
// Source device identity = ME |
|
5199 |
uiccSbTerminalResponseBuf.Append( KMe ); |
|
5200 |
// Destination device identity = SIM |
|
5201 |
uiccSbTerminalResponseBuf.Append( KSim ); |
|
5202 |
||
5203 |
// Add TLV specific data |
|
5204 |
uiccSbTerminalResponseBuf.Append( aBerTlvSpecificData ); |
|
5205 |
} |
|
5206 |
else // Empty terminal response => length is zero |
|
5207 |
{ |
|
5208 |
uiccSbTerminalResponseBuf.Append( 0 ); |
|
5209 |
uiccSbTerminalResponseBuf.Append( 0 ); |
|
5210 |
} |
|
5211 |
||
5212 |
// Save terminal resp transaction id |
|
5213 |
iTerminalRespTraId = aTransId; |
|
5214 |
TFLOGSTRING2("TSY: CSatMessHandler::UiccCatReqTerminalResponse iTerminalRespTraId=%d", iTerminalRespTraId); |
|
5215 |
OstTrace1( TRACE_NORMAL, DUP1_CSATMESSHANDLER_UICCCATREQTERMINALRESPONSE, "CSatMessHandler::UiccCatReqTerminalResponse;iTerminalRespTraId=%d", iTerminalRespTraId ); |
|
5216 |
||
5217 |
// Append subblock to ISI message |
|
5218 |
isiMsg.CopyData( |
|
5219 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_REQ, |
|
5220 |
uiccSbTerminalResponse.CompleteSubBlock() ); |
|
5221 |
||
5222 |
return( iPnSend->Send( isiMsg.Complete() ) ); |
|
5223 |
} |
|
5224 |
||
5225 |
// ----------------------------------------------------------------------------- |
|
5226 |
// CSatMessHandler::UiccCatRespEnvelope |
|
5227 |
// Handles UICC response for envelope |
|
5228 |
// ----------------------------------------------------------------------------- |
|
5229 |
// |
|
5230 |
TBool CSatMessHandler::UiccCatRespEnvelope( const TIsiReceiveC& aIsiMessage ) |
|
5231 |
{ |
|
5232 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCCATENVELOPERESP, "CSatMessHandler::UiccCatRespEnvelope" ); |
|
5233 |
TFLOGSTRING("TSY:CSatMessHandler::UiccCatRespEnvelope"); |
|
5234 |
||
5235 |
TBool handled( EFalse ); |
|
5236 |
TUint8 trId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ); |
|
5237 |
||
5238 |
TUint uiccSbApduOffset( 0 ); |
|
5239 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
5240 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_RESP, |
|
5241 |
UICC_SB_APDU, |
|
5242 |
EIsiSubBlockTypeId16Len16, |
|
5243 |
uiccSbApduOffset ) ) |
|
5244 |
{ |
|
5245 |
TPtrC8 apduData; |
|
5246 |
TUint16 apduLength( aIsiMessage.Get16bit( |
|
5247 |
uiccSbApduOffset + UICC_SB_APDU_OFFSET_APDULENGTH ) ); |
|
5248 |
apduData.Set( aIsiMessage.GetData( |
|
5249 |
uiccSbApduOffset + UICC_SB_APDU_OFFSET_APDU, |
|
5250 |
apduLength ) ); |
|
5251 |
// Status bytes are two last bytes in APDU |
|
5252 |
TUint8 sw1( apduData[apduLength - 2] ); |
|
5253 |
TUint8 sw2( apduData[apduLength - 1] ); |
|
5254 |
||
5255 |
if ( KAtkSwDataNtfSw1NormalEnding == sw1 |
|
5256 |
&& KAtkSwDataNtfSw2NormalEnding == sw2 ) |
|
5257 |
{ |
|
5258 |
// SIM responded OK. Remove stored envelope. |
|
5259 |
iTsySatMessaging->GetSatTimer()->RemoveEnvelope( trId ); |
|
5260 |
} |
|
5261 |
else |
|
5262 |
{ |
|
5263 |
// Problems in envelope sending, resend envelope if appropriate. |
|
5264 |
if ( KErrNone == iTsySatMessaging->GetSatTimer()-> |
|
5265 |
ActivateEnvelopeResend( trId, sw1 ) ) |
|
5266 |
{ |
|
5267 |
TFLOGSTRING( "TSY:CSatMessHandler::UiccCatRespEnvelope, resending of envelope" ); |
|
5268 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_UICCCATENVELOPERESP, "CSatMessHandler::UiccCatRespEnvelope,resending of envelope" ); |
|
5269 |
// Envelope will be resent, mark as handled |
|
5270 |
handled = ETrue; |
|
5271 |
} |
|
5272 |
} |
|
5273 |
} |
|
5274 |
else // Subblock is mandatory |
|
5275 |
{ |
|
5276 |
TFLOGSTRING("TSY: CSatMessHandler::UiccCatRespEnvelope - Mandatory subblock UICC_SB_APDU not found"); |
|
5277 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_UICCCATENVELOPERESP, "CSatMessHandler::UiccCatRespEnvelope- Mandatory subblock UICC_SB_APDU not found" ); |
|
5278 |
} |
|
5279 |
||
5280 |
return handled; |
|
5281 |
} |
|
5282 |
||
5283 |
||
5284 |
// ----------------------------------------------------------------------------- |
|
5285 |
// CSatMessHandler::UiccCatRespTerminalResponse |
|
5286 |
// Handles UICC response for envelope |
|
5287 |
// ----------------------------------------------------------------------------- |
|
5288 |
// |
|
5289 |
TBool CSatMessHandler::UiccCatRespTerminalResponse( |
|
5290 |
const TIsiReceiveC& aIsiMessage ) |
|
5291 |
{ |
|
5292 |
OstTrace0( TRACE_NORMAL, DUP2_CSATMESSHANDLER_UICCCATRESPTERMINALRESPONSE, "CSatMessHandler::UiccCatRespTerminalResponse" ); |
|
5293 |
TFLOGSTRING("TSY:CSatMessHandler::UiccCatRespTerminalResponse"); |
|
5294 |
||
5295 |
TBool handled( EFalse ); |
|
5296 |
TUint8 trId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ) ); |
|
5297 |
||
5298 |
TUint uiccSbApduOffset( 0 ); |
|
5299 |
if ( KErrNone == aIsiMessage.FindSubBlockOffsetById( |
|
5300 |
ISI_HEADER_SIZE + SIZE_UICC_CAT_RESP, |
|
5301 |
UICC_SB_APDU, |
|
5302 |
EIsiSubBlockTypeId16Len16, |
|
5303 |
uiccSbApduOffset ) ) |
|
5304 |
{ |
|
5305 |
TPtrC8 apduData; |
|
5306 |
TUint16 apduLength( aIsiMessage.Get16bit( |
|
5307 |
uiccSbApduOffset + UICC_SB_APDU_OFFSET_APDULENGTH ) ); |
|
5308 |
apduData.Set( aIsiMessage.GetData( |
|
5309 |
uiccSbApduOffset + UICC_SB_APDU_OFFSET_APDU, |
|
5310 |
apduLength ) ); |
|
5311 |
// Status bytes are two last bytes in APDU |
|
5312 |
TUint8 sw1( apduData[apduLength - 2] ); |
|
5313 |
TUint8 sw2( apduData[apduLength - 1] ); |
|
5314 |
||
5315 |
if ( KAtkSwDataNtfSw1NormalEnding == sw1 |
|
5316 |
&& KAtkSwDataNtfSw2NormalEnding == sw2 ) |
|
5317 |
{ |
|
5318 |
TFLOGSTRING("CSatMessHandler::UiccCatRespTerminalResponse, - SIM SESSION END, 90 00 -"); |
|
5319 |
OstTrace0( TRACE_NORMAL, DUP1_CSATMESSHANDLER_UICCCATRESPTERMINALRESPONSE, "CSatMessHandler::UiccCatRespTerminalResponse" ); |
|
5320 |
||
5321 |
iTsySatMessaging->SessionEnd( aIsiMessage ); |
|
5322 |
||
5323 |
// Set flag to indicate that terminal response has been |
|
5324 |
// processed by the SIM with status '90 00'. |
|
5325 |
iTsySatMessaging->GetSatTimer()-> |
|
5326 |
SetProactiveCommandOnGoingStatus( EFalse ); |
|
5327 |
} |
|
5328 |
handled = ETrue; |
|
5329 |
||
5330 |
#ifdef INFO_PP_ENHANCED_NETWORK_SELECTION |
|
5331 |
// Only if SET UP EVENT LIST TR is sent |
|
5332 |
if ( iSetUpEventListTrSent ) |
|
5333 |
{ |
|
5334 |
iSetUpEventListTrSent = EFalse; |
|
5335 |
iTsySatMessaging->GetEventDownload()->ForceLocationStatusEnvelope(); |
|
5336 |
} |
|
5337 |
#endif // INFO_PP_ENHANCED_NETWORK_SELECTION |
|
5338 |
} |
|
5339 |
else // Subblock is not found |
|
5340 |
{ |
|
5341 |
TFLOGSTRING("TSY: CSatMessHandler::UiccCatRespTerminalResponse - Subblock UICC_SB_APDU not found"); |
|
5342 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_UICCCATRESPTERMINALRESPONSE, "CSatMessHandler::UiccCatRespTerminalResponse" ); |
|
5343 |
} |
|
5344 |
||
5345 |
return handled; |
|
5346 |
} |
|
5347 |
||
5348 |
||
5349 |
// ----------------------------------------------------------------------------- |
|
5350 |
// CSatMessHandler::GetApplicationId |
|
5351 |
// (other items were commented in a header). |
|
5352 |
// ----------------------------------------------------------------------------- |
|
5353 |
// |
|
5354 |
const TDesC8& CSatMessHandler::GetApplicationFileId() |
|
5355 |
{ |
|
5356 |
TFLOGSTRING("TSY: CSatMessHandler::GetApplicationId"); |
|
5357 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GETAPPLICATIONID, "CSatMessHandler::GetApplicationId" ); |
|
5358 |
return iApplFileId; |
|
5359 |
} |
|
5360 |
||
5361 |
||
5362 |
// ----------------------------------------------------------------------------- |
|
5363 |
// CSatMessHandler::SetSatReadyStatus |
|
5364 |
// Set status of iSatReady flag |
|
5365 |
// ----------------------------------------------------------------------------- |
|
5366 |
// |
|
5367 |
void CSatMessHandler::SetSatReadyStatus( TBool aSatReadyStatus ) |
|
5368 |
{ |
|
5369 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_SETSATREADYSTATUS, "CSatMessHandler::SetSatReadyStatus" ); |
|
5370 |
TFLOGSTRING("TSY: CSatMessHandler::SetSatReadyStatus"); |
|
5371 |
iSatReady = aSatReadyStatus; |
|
5372 |
} |
|
5373 |
||
5374 |
||
5375 |
// ----------------------------------------------------------------------------- |
|
5376 |
// CSatMessHandler::GetSatReadyStatus |
|
5377 |
// Set status of iSatReady flag |
|
5378 |
// ----------------------------------------------------------------------------- |
|
5379 |
// |
|
5380 |
TBool CSatMessHandler::GetSatReadyStatus() |
|
5381 |
{ |
|
5382 |
TFLOGSTRING("TSY: CSatMessHandler::GetSatReadyStatus"); |
|
5383 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GETSATREADYSTATUS, "CSatMessHandler::GetSatReadyStatus" ); |
|
5384 |
return iSatReady; |
|
5385 |
} |
|
5386 |
||
5387 |
||
5388 |
// ----------------------------------------------------------------------------- |
|
5389 |
// CSatMessHandler::GetTerminalProfileStatus |
|
5390 |
// Get status of iTerminalProfileSent flag |
|
5391 |
// ----------------------------------------------------------------------------- |
|
5392 |
// |
|
5393 |
TBool CSatMessHandler::GetTerminalProfileStatus() |
|
5394 |
{ |
|
5395 |
TFLOGSTRING("TSY: CSatMessHandler::GetTerminalProfileStatus"); |
|
5396 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GETTERMINALPROFILESTATUS, "CSatMessHandler::GetTerminalProfileStatus" ); |
|
5397 |
return iTerminalProfileSent; |
|
5398 |
} |
|
5399 |
||
5400 |
||
5401 |
// ----------------------------------------------------------------------------- |
|
5402 |
// CSatMessHandler::GetClut |
|
5403 |
// Get clut data |
|
5404 |
// ----------------------------------------------------------------------------- |
|
5405 |
// |
|
5406 |
const TDesC8& CSatMessHandler::GetClut() |
|
5407 |
{ |
|
5408 |
TFLOGSTRING("TSY: CSatMessHandler::SetImageInstanceRequestStatus"); |
|
5409 |
OstTrace0( TRACE_NORMAL, CSATMESSHANDLER_GETCLUT, "CSatMessHandler::GetClut" ); |
|
5410 |
return iClutData; |
|
5411 |
} |
|
5412 |
||
5413 |
||
5414 |
// End of file |