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