author | mikaruus <mika.a.ruuskanen@nokia.com> |
Wed, 21 Apr 2010 14:29:55 +0300 | |
changeset 8 | 6295dc2169f3 |
parent 5 | 8ccc39f9d787 |
child 9 | 8486d82aef45 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include "sateventdownload.h" // sat event download class |
|
22 |
#include "satmessaging.h" // sat messaging class |
|
23 |
#include "ber_tlv.h" // sat ber-tlv classes |
|
24 |
#include "satutil.h" // sat utility class |
|
25 |
||
26 |
#include <pn_const.h> // server id constants |
|
27 |
#include <tisi.h> // isi message |
|
28 |
#include <net_modemisi.h> // net server |
|
29 |
#include <call_modemisi.h> // Call Modem server |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
30 |
#include "OstTraceDefinitions.h" |
0 | 31 |
#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
|
32 |
#include "sateventdownloadTraces.h" |
0 | 33 |
#endif |
34 |
||
35 |
||
36 |
// CONSTANTS |
|
37 |
const TUint8 KMaxCallModemDetailedCause = 248; |
|
38 |
const TUint8 KCallModemOriginCsAddressMaxLength = 246; |
|
39 |
const TUint8 KMSBMask = 0x80; |
|
40 |
||
41 |
||
42 |
// ==================== MEMBER FUNCTIONS ==================================== |
|
43 |
||
44 |
// ----------------------------------------------------------------------------- |
|
45 |
// CSatEventDownload::CSatEventDownload |
|
46 |
// C++ default constructor can NOT contain any code, that |
|
47 |
// might leave. |
|
48 |
// ----------------------------------------------------------------------------- |
|
49 |
// |
|
50 |
CSatEventDownload::CSatEventDownload |
|
51 |
( |
|
52 |
CSatMessHandler* aSatMessHandler, |
|
53 |
CTsySatMessaging* aSatMessaging |
|
54 |
) |
|
55 |
: |
|
56 |
iSatMessHandler( aSatMessHandler ), |
|
57 |
iSatMessaging( aSatMessaging ), |
|
58 |
iSetUpCallOngoing( EFalse ), |
|
59 |
iForceLocationStatusEnvelope( EFalse ), |
|
60 |
iCallsOngoing( EFalse ), |
|
61 |
iLocationStatusEnvelopePending( EFalse ), |
|
62 |
iNetCellInfoIndReceived( EFalse ) |
|
63 |
{ |
|
64 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CSATEVENTDOWNLOAD, "CSatEventDownload::CSatEventDownload" ); |
|
65 |
iLocInfo.iOperatorCode.FillZ( iLocInfo.iOperatorCode.MaxLength() ); |
|
66 |
iLocInfo.iLac.FillZ( iLocInfo.iLac.MaxLength() ); |
|
67 |
iLocInfo.iCellId.FillZ( iLocInfo.iCellId.MaxLength() ); |
|
68 |
iLocInfo.iRegStatus = NET_NO_COVERAGE; |
|
69 |
} |
|
70 |
||
71 |
// ----------------------------------------------------------------------------- |
|
72 |
// CSatEventDownload::ConstructL |
|
73 |
// Symbian 2nd phase constructor can leave. |
|
74 |
// ----------------------------------------------------------------------------- |
|
75 |
// |
|
76 |
void CSatEventDownload::ConstructL() |
|
77 |
{ |
|
78 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CONSTRUCTL, "CSatEventDownload::ConstructL" ); |
|
79 |
// None. Reserved for future use. |
|
80 |
} |
|
81 |
||
82 |
||
83 |
// ----------------------------------------------------------------------------- |
|
84 |
// CSatEventDownload::NewL |
|
85 |
// Two-phased constructor. |
|
86 |
// ----------------------------------------------------------------------------- |
|
87 |
// |
|
88 |
CSatEventDownload* CSatEventDownload::NewL |
|
89 |
( |
|
90 |
CSatMessHandler* aSatMessHandler, |
|
91 |
CTsySatMessaging* aSatMessaging |
|
92 |
) |
|
93 |
{ |
|
94 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_NEWL, "CSatEventDownload::NewL" ); |
|
95 |
TFLOGSTRING("TSY: CSatEventDownload::NewL"); |
|
96 |
||
97 |
CSatEventDownload* self = |
|
98 |
new( ELeave ) CSatEventDownload( aSatMessHandler, aSatMessaging ); |
|
99 |
||
100 |
CleanupStack::PushL( self ); |
|
101 |
self->ConstructL(); |
|
102 |
CleanupStack::Pop( self ); |
|
103 |
||
104 |
return self; |
|
105 |
} |
|
106 |
||
107 |
||
108 |
// ----------------------------------------------------------------------------- |
|
109 |
// CSatEventDownload::~CSatEventDownload |
|
110 |
// C++ destructor |
|
111 |
// ----------------------------------------------------------------------------- |
|
112 |
// |
|
113 |
CSatEventDownload::~CSatEventDownload() |
|
114 |
{ |
|
115 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_CSATEVENTDOWNLOAD, "CSatEventDownload::~CSatEventDownload" ); |
|
116 |
TFLOGSTRING("TSY: CSatEventDownload::~CSatEventDownload"); |
|
117 |
} |
|
118 |
||
119 |
||
120 |
// ----------------------------------------------------------------------------- |
|
121 |
// CSatEventDownload::GetTransactionId |
|
122 |
// Generate transaction id for ISI message |
|
123 |
// ----------------------------------------------------------------------------- |
|
124 |
// |
|
125 |
TUint8 CSatEventDownload::GetTransactionId() |
|
126 |
{ |
|
127 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_GETTRANSACTIONID, "CSatEventDownload::GetTransactionId" ); |
|
128 |
TFLOGSTRING("TSY: CSatEventDownload::GetTransactionId"); |
|
129 |
return iSatMessaging->GetTransactionId(); |
|
130 |
} |
|
131 |
||
132 |
// ----------------------------------------------------------------------------- |
|
133 |
// CSatEventDownload::SetUpEventList |
|
134 |
// Sets up event list |
|
135 |
// ----------------------------------------------------------------------------- |
|
136 |
// |
|
137 |
void CSatEventDownload::SetUpEventList |
|
138 |
( |
|
139 |
TUint32 aEvents // bit mask of enabled events |
|
140 |
) |
|
141 |
{ |
|
142 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SETUPEVENTLIST, "CSatEventDownload::SetUpEventList" ); |
|
143 |
TFLOGSTRING("TSY: CSatEventDownload::SetUpEventList"); |
|
144 |
iEventList.Set( aEvents ); |
|
145 |
||
146 |
// Force sending of envelope at least once, if location status event set |
|
147 |
if ( iEventList.IsEnabled( RSat::KLocationStatus ) ) |
|
148 |
{ |
|
149 |
iForceLocationStatusEnvelope = ETrue; |
|
150 |
} |
|
151 |
// Reset flag if removal of event list or not location status event |
|
152 |
else |
|
153 |
{ |
|
154 |
iForceLocationStatusEnvelope = EFalse; |
|
155 |
} |
|
156 |
} |
|
157 |
||
158 |
// ----------------------------------------------------------------------------- |
|
159 |
// CSatEventDownload::SendMTCallEnvelope |
|
160 |
// Send MT call envelope to USIM. |
|
161 |
// ----------------------------------------------------------------------------- |
|
162 |
// |
|
163 |
TInt CSatEventDownload::SendMTCallEnvelope |
|
164 |
( |
|
165 |
TUint8 aTransactionId, // Transaction Identifier |
|
166 |
const TDesC8& aDiallingNumber, // Calling Party BCD number |
|
167 |
const TDesC8& aCalledPartySubAddress // Calling Party Subaddress |
|
168 |
) |
|
169 |
{ |
|
170 |
OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDMTCALLENVELOPE, "CSatEventDownload::SendMTCallEnvelope (transactionId=%hhu)", aTransactionId ); |
|
171 |
TFLOGSTRING2("TSY: CSatEventDownload::SendMTCallEnvelope\ |
|
172 |
(transactionId=%d)", TInt( aTransactionId ) ); |
|
173 |
||
174 |
TInt ret( KErrNone ); |
|
175 |
||
176 |
// create envelope |
|
177 |
TTlv envelope; |
|
178 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
179 |
||
180 |
// event list |
|
181 |
envelope.AddTag ( KTlvEventListTag ); |
|
182 |
envelope.AddByte( KEventMTCall ); |
|
183 |
||
184 |
// device identities |
|
185 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
186 |
envelope.AddByte( KNetwork ); |
|
187 |
envelope.AddByte( KSim ); |
|
188 |
||
189 |
// transaction identifier |
|
190 |
envelope.AddTag ( KTlvTransactionIdentifierTag ); |
|
191 |
envelope.AddByte( aTransactionId ); |
|
192 |
||
193 |
if ( aDiallingNumber.Length() ) |
|
194 |
{ |
|
195 |
envelope.AddTag( KTlvAddressTag ); |
|
196 |
// First byte contains TON/NPI, rest of the bytes address |
|
197 |
envelope.AddData( aDiallingNumber ); |
|
198 |
} |
|
199 |
||
200 |
if ( aCalledPartySubAddress.Length() ) |
|
201 |
{ |
|
202 |
// optional called party subaddress |
|
203 |
envelope.AddTag( KTlvSubaddressTag ); |
|
204 |
envelope.AddData( aCalledPartySubAddress ); |
|
205 |
} |
|
206 |
||
207 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
208 |
GetTransactionId(), envelope.End() ); |
|
209 |
||
210 |
return ret; |
|
211 |
} |
|
212 |
||
213 |
// ----------------------------------------------------------------------------- |
|
214 |
// CSatEventDownload::SendCallConnectedEnvelope |
|
215 |
// Send Call connected envelope to USIM. |
|
216 |
// ----------------------------------------------------------------------------- |
|
217 |
// |
|
218 |
TInt CSatEventDownload::SendCallConnectedEnvelope |
|
219 |
( |
|
220 |
TUint8 aTransactionId, // Transaction Identifier in the CONNECT message. |
|
221 |
TBool aNearEnd |
|
222 |
) |
|
223 |
{ |
|
224 |
OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDCALLCONNECTEDENVELOPE, "CSatEventDownload::SendCallConnectedEnvelope (transactionId=%hhu)", aTransactionId ); |
|
225 |
TFLOGSTRING2("TSY: CSatEventDownload::SendCallConnectedEnvelope\ |
|
226 |
(transactionId=%d)", TInt( aTransactionId ) ); |
|
227 |
||
228 |
TInt ret( KErrNone ); |
|
229 |
||
230 |
// create envelope |
|
231 |
TTlv envelope; |
|
232 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
233 |
||
234 |
// event list |
|
235 |
envelope.AddTag ( KTlvEventListTag ); |
|
236 |
envelope.AddByte( KEventCallConnected ); |
|
237 |
||
238 |
// device identities |
|
239 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
240 |
envelope.AddByte( aNearEnd ? KMe : KNetwork ); |
|
241 |
envelope.AddByte( KSim ); |
|
242 |
||
243 |
// transaction identifier |
|
244 |
envelope.AddTag ( KTlvTransactionIdentifierTag ); |
|
245 |
envelope.AddByte( aTransactionId ); |
|
246 |
||
247 |
// Check if the call is SetUpCall originated and it's an MO call |
|
248 |
if ( iSetUpCallOngoing && !aNearEnd ) |
|
249 |
{ |
|
250 |
// Store envelope to cache and it will be send after a terminal resp |
|
251 |
// of set up call. |
|
252 |
iSatMessaging->StoreCallConnectedEvent( envelope.End() ); |
|
253 |
} |
|
254 |
else |
|
255 |
{ |
|
256 |
// send envelope now |
|
257 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
258 |
GetTransactionId(), envelope.End() ); |
|
259 |
} |
|
260 |
||
261 |
return ret; |
|
262 |
} |
|
263 |
||
264 |
// ----------------------------------------------------------------------------- |
|
265 |
// CSatEventDownload::SendCallDisconnectedEnvelope |
|
266 |
// Send call disconnected event to USIM |
|
267 |
// ----------------------------------------------------------------------------- |
|
268 |
// |
|
269 |
TInt CSatEventDownload::SendCallDisconnectedEnvelope |
|
270 |
( |
|
271 |
TUint8 aTransactionId, |
|
272 |
TBool aNearEnd, |
|
273 |
TBool aCauseGiven, |
|
274 |
const TDesC8& aCause |
|
275 |
) |
|
276 |
{ |
|
277 |
OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDCALLDISCONNECTEDENVELOPE, "CSatEventDownload::SendCallDisconnectedEnvelope (transactionId=%hhu)", aTransactionId ); |
|
278 |
TFLOGSTRING2("TSY: CSatEventDownload::SendCallDisconnectedEnvelope\ |
|
279 |
(transactionId=%d)", TInt( aTransactionId ) ); |
|
280 |
||
281 |
TInt ret( KErrNone ); |
|
282 |
||
283 |
// create envelope |
|
284 |
TTlv envelope; |
|
285 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
286 |
||
287 |
// event list |
|
288 |
envelope.AddTag ( KTlvEventListTag ); |
|
289 |
envelope.AddByte( KEventCallDisconnected ); |
|
290 |
||
291 |
// device identities |
|
292 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
293 |
envelope.AddByte( aNearEnd ? KMe : KNetwork ); |
|
294 |
envelope.AddByte( KSim ); |
|
295 |
||
296 |
// transaction identifier |
|
297 |
envelope.AddTag ( KTlvTransactionIdentifierTag ); |
|
298 |
envelope.AddByte( aTransactionId ); |
|
299 |
||
300 |
// cause |
|
301 |
if ( aCauseGiven ) |
|
302 |
{ |
|
303 |
envelope.AddTag ( KTlvCauseTag ); |
|
304 |
envelope.AddData( aCause ); |
|
305 |
} |
|
306 |
||
307 |
// send |
|
308 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
309 |
GetTransactionId(), envelope.End() ); |
|
310 |
||
311 |
return ret; |
|
312 |
} |
|
313 |
||
314 |
// ----------------------------------------------------------------------------- |
|
315 |
// CSatEventDownload::SendLocationStatusEnvelope |
|
316 |
// Send location status event to USIM |
|
317 |
// ----------------------------------------------------------------------------- |
|
318 |
// |
|
319 |
TInt CSatEventDownload::SendLocationStatusEnvelope |
|
320 |
( |
|
321 |
const CSatMessHandler::TLocationInfo& aNewLocInfo |
|
322 |
) |
|
323 |
{ |
|
324 |
OstTrace1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE, "CSatEventDownload::SendLocationStatusEnvelope locationStatus = %d", aNewLocInfo.iRegStatus ); |
|
325 |
TFLOGSTRING2("TSY: CSatEventDownload::SendLocationStatusEnvelope \ |
|
326 |
locationStatus = %d", TInt( aNewLocInfo.iRegStatus ) ); |
|
327 |
||
328 |
TInt ret( KErrNone ); |
|
329 |
||
330 |
// Send location status envelope only if there |
|
331 |
// have been changes |
|
332 |
if ( ( iLocInfo.iRegStatus != aNewLocInfo.iRegStatus ) |
|
333 |
|| ( iLocInfo.iOperatorCode != aNewLocInfo.iOperatorCode ) |
|
334 |
|| ( iLocInfo.iLac != aNewLocInfo.iLac ) |
|
335 |
|| ( iLocInfo.iCellId != aNewLocInfo.iCellId ) |
|
336 |
|| iForceLocationStatusEnvelope ) |
|
337 |
{ |
|
338 |
TFLOGSTRING("TSY: CSatEventDownload::SendLocationStatusEnvelope \ |
|
339 |
Saving and sending"); |
|
340 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE, "CSatEventDownload::SendLocationStatusEnvelope Saving and sending" ); |
|
341 |
||
342 |
// Cache values |
|
343 |
iLocInfo = aNewLocInfo; |
|
344 |
||
345 |
// Create envelope |
|
346 |
TTlv envelope; |
|
347 |
envelope.Begin( KBerTlvEventDownloadTag ); |
|
348 |
||
349 |
// Event list |
|
350 |
envelope.AddTag( KTlvEventListTag ); |
|
351 |
envelope.AddByte( KEventLocationStatus ); |
|
352 |
||
353 |
// Device identities |
|
354 |
envelope.AddTag( KTlvDeviceIdentityTag ); |
|
355 |
envelope.AddByte( KMe ); |
|
356 |
envelope.AddByte( KSim ); |
|
357 |
||
358 |
// Locationstatus |
|
359 |
envelope.AddTag( KTlvLocationStatusTag ); |
|
360 |
||
361 |
switch ( iLocInfo.iRegStatus ) |
|
362 |
{ |
|
363 |
case NET_SERVICE: |
|
364 |
{ |
|
365 |
envelope.AddByte( KLocationStatusNormalService ); |
|
366 |
||
367 |
// Location information, this is included only if status |
|
368 |
// indicates normal service |
|
369 |
envelope.AddTag( KTlvLocationInformationTag ); |
|
370 |
envelope.AddData( iLocInfo.iOperatorCode ); |
|
371 |
envelope.AddData( iLocInfo.iLac ); |
|
372 |
envelope.AddData( iLocInfo.iCellId ); |
|
373 |
break; |
|
374 |
} |
|
375 |
case NET_LIMITED_SERVICE: |
|
376 |
{ |
|
377 |
envelope.AddByte( KLocationStatusLimitedService ); |
|
378 |
break; |
|
379 |
} |
|
380 |
case NET_NO_COVERAGE: |
|
381 |
default: |
|
382 |
{ |
|
383 |
envelope.AddByte( KLocationStatusNoService ); |
|
384 |
break; |
|
385 |
} |
|
386 |
} |
|
387 |
||
388 |
// Reset the flag |
|
389 |
iForceLocationStatusEnvelope = EFalse; |
|
390 |
||
391 |
// send |
|
392 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
393 |
GetTransactionId(), |
|
394 |
envelope.End() ); |
|
395 |
} |
|
396 |
else |
|
397 |
{ |
|
398 |
TFLOGSTRING("TSY: CSatEventDownload::SendLocationStatusEnvelope \ |
|
399 |
Location Info already received, envelope sending omitted."); |
|
400 |
OstTrace0( TRACE_NORMAL, DUP2_CSATEVENTDOWNLOAD_SENDLOCATIONSTATUSENVELOPE, "CSatEventDownload::SendLocationStatusEnvelope Location Info already received, envelope sending omitted." ); |
|
401 |
||
402 |
} |
|
403 |
||
404 |
iLocationStatusEnvelopePending = EFalse; |
|
405 |
||
406 |
return ret; |
|
407 |
} |
|
408 |
||
409 |
// ----------------------------------------------------------------------------- |
|
410 |
// CSatEventDownload::SendUserActivityEnvelope |
|
411 |
// Send user activity envelope to USIM |
|
412 |
// ----------------------------------------------------------------------------- |
|
413 |
// |
|
414 |
TInt CSatEventDownload::SendUserActivityEnvelope() |
|
415 |
{ |
|
416 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDUSERACTIVITYENVELOPE, "CSatEventDownload::SendUserActivityEnvelope" ); |
|
417 |
TFLOGSTRING("TSY: CSatEventDownload::SendUserActivityEnvelope"); |
|
418 |
||
419 |
TInt ret = KErrNone; |
|
420 |
||
421 |
if ( iEventList.IsEnabled(RSat::KUserActivity) ) |
|
422 |
{ |
|
423 |
// create envelope |
|
424 |
TTlv envelope; |
|
425 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
426 |
||
427 |
// event list |
|
428 |
envelope.AddTag ( KTlvEventListTag ); |
|
429 |
envelope.AddByte( KEventUserActivity ); |
|
430 |
||
431 |
// device identities |
|
432 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
433 |
envelope.AddByte( KMe ); |
|
434 |
envelope.AddByte( KSim ); |
|
435 |
||
436 |
// send |
|
437 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
438 |
GetTransactionId(), envelope.End() ); |
|
439 |
||
440 |
// remove from event list |
|
441 |
iEventList.Remove( RSat::KUserActivity ); |
|
442 |
} |
|
443 |
||
444 |
return ret; |
|
445 |
} |
|
446 |
||
447 |
// ----------------------------------------------------------------------------- |
|
448 |
// CSatEventDownload::SendIdleScreenAvailableEnvelope |
|
449 |
// Send idle screeen available event to USIM |
|
450 |
// ----------------------------------------------------------------------------- |
|
451 |
// |
|
452 |
TInt CSatEventDownload::SendIdleScreenAvailableEnvelope() |
|
453 |
{ |
|
454 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDIDLESCREENAVAILABLEENVELOPE, "CSatEventDownload::SendIdleScreenAvailableEnvelope" ); |
|
455 |
TFLOGSTRING("TSY: CSatEventDownload::SendIdleScreenAvailableEnvelope"); |
|
456 |
||
457 |
TInt ret = KErrNone; |
|
458 |
||
459 |
if ( iEventList.IsEnabled( RSat::KIdleScreenAvailable ) ) |
|
460 |
{ |
|
461 |
// create envelope |
|
462 |
TTlv envelope; |
|
463 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
464 |
||
465 |
// event list |
|
466 |
envelope.AddTag ( KTlvEventListTag ); |
|
467 |
envelope.AddByte( KEventIdleScreenAvailable ); |
|
468 |
||
469 |
// device identities |
|
470 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
471 |
envelope.AddByte( KDisplay ); |
|
472 |
envelope.AddByte( KSim ); |
|
473 |
||
474 |
// send |
|
475 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
476 |
GetTransactionId(), envelope.End() ); |
|
477 |
||
478 |
if( KErrNone == ret ) |
|
479 |
{ |
|
480 |
// remove from event list |
|
481 |
iEventList.Remove( RSat::KIdleScreenAvailable ); |
|
482 |
} |
|
483 |
} |
|
484 |
||
485 |
return ret; |
|
486 |
} |
|
487 |
||
488 |
// ----------------------------------------------------------------------------- |
|
489 |
// CSatEventDownload::SendBrowserTerminationEnvelope |
|
490 |
// Send browser termination event to USIM |
|
491 |
// ----------------------------------------------------------------------------- |
|
492 |
// |
|
493 |
TInt CSatEventDownload::SendBrowserTerminationEnvelope |
|
494 |
( |
|
495 |
RSat::TBrowserTerminationCause aCause |
|
496 |
) |
|
497 |
{ |
|
498 |
OstTrace1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDBROWSERTERMINATIONENVELOPE, "CSatEventDownload::SendBrowserTerminationEnvelope (cause=%d)", TInt(aCause) ); |
|
499 |
TFLOGSTRING2("TSY: CSatEventDownload::SendBrowserTerminationEnvelope\ |
|
500 |
(cause=%d)", TInt( aCause ) ); |
|
501 |
||
502 |
TInt ret = KErrNone; |
|
503 |
||
504 |
if ( iEventList.IsEnabled( RSat::KBrowserTermination ) ) |
|
505 |
{ |
|
506 |
// create envelope |
|
507 |
TTlv envelope; |
|
508 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
509 |
||
510 |
// event list |
|
511 |
envelope.AddTag ( KTlvEventListTag ); |
|
512 |
envelope.AddByte( KEventBrowserTermination ); |
|
513 |
||
514 |
// device identities |
|
515 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
516 |
envelope.AddByte( KMe ); |
|
517 |
envelope.AddByte( KSim ); |
|
518 |
||
519 |
// cause |
|
520 |
envelope.AddTag( KTlvBrowserTerminationCauseTag ); |
|
521 |
envelope.AddByte( |
|
522 |
TUint8( ( RSat::EUserTermination == aCause) ? |
|
523 |
KBrowserTerminationUser : KBrowserTerminationError) ); |
|
524 |
||
525 |
// send |
|
526 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
527 |
GetTransactionId(), envelope.End() ); |
|
528 |
} |
|
529 |
||
530 |
return ret; |
|
531 |
} |
|
532 |
||
533 |
// ----------------------------------------------------------------------------- |
|
534 |
// CSatEventDownload::SendLanguageSelectionEnvelope |
|
535 |
// Send Languate selection event to USIMSend Languate selection event to USIM |
|
536 |
// ----------------------------------------------------------------------------- |
|
537 |
// |
|
538 |
TInt CSatEventDownload::SendLanguageSelectionEnvelope |
|
539 |
( |
|
540 |
TUint16 aLanguage |
|
541 |
) |
|
542 |
{ |
|
543 |
OstTraceExt1( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDLANGUAGESELECTIONENVELOPE, "CSatEventDownload::SendLanguageSelectionEnvelope (language=%hu)", aLanguage ); |
|
544 |
TFLOGSTRING2("TSY: CSatEventDownload::SendLanguageSelectionEnvelope\ |
|
545 |
(language=%d)", TInt ( aLanguage ) ); |
|
546 |
||
547 |
TInt ret = KErrNone; |
|
548 |
||
549 |
if ( iEventList.IsEnabled( RSat::KLanguageSelection ) ) |
|
550 |
{ |
|
551 |
// create envelope |
|
552 |
TTlv envelope; |
|
553 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
554 |
||
555 |
// event list |
|
556 |
envelope.AddTag ( KTlvEventListTag ); |
|
557 |
envelope.AddByte( KEventLanguageSelection ); |
|
558 |
||
559 |
// device identities |
|
560 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
561 |
envelope.AddByte( KMe ); |
|
562 |
envelope.AddByte( KSim ); |
|
563 |
||
564 |
// language |
|
565 |
envelope.AddTag( KTlvLanguageTag ); |
|
566 |
envelope.AddByte( TUint8((aLanguage >> 8)&0x7f) ); // MSB |
|
567 |
envelope.AddByte( TUint8((aLanguage >> 0)&0x7f) ); // LSB |
|
568 |
||
569 |
// send |
|
570 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
571 |
GetTransactionId(), envelope.End() ); |
|
572 |
} |
|
573 |
||
574 |
return ret; |
|
575 |
} |
|
576 |
||
577 |
// ----------------------------------------------------------------------------- |
|
578 |
// CSatEventDownload::ExtFunc |
|
579 |
// Handles event download IPC requests originating from ETel. |
|
580 |
// ----------------------------------------------------------------------------- |
|
581 |
// |
|
582 |
TInt CSatEventDownload::ExtFunc |
|
583 |
( |
|
584 |
const TTsyReqHandle aTsyReqHandle, |
|
585 |
const TDataPackage& aPackage |
|
586 |
) |
|
587 |
{ |
|
588 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_EXTFUNC, "CSatEventDownload::ExtFunc" ); |
|
589 |
TFLOGSTRING("TSY: CSatEventDownload::ExtFunc"); |
|
590 |
||
591 |
TInt ret ( KErrNotSupported ); |
|
592 |
||
593 |
// get parameters (eventList, eventInfo) from package |
|
594 |
RSat::TEventDownloadBaseV2Pckg* eventInfoPckg = |
|
595 |
(RSat::TEventDownloadBaseV2Pckg*)aPackage.Des2n(); |
|
596 |
RSat::TEventDownloadBaseV2& eventInfo = (*eventInfoPckg)(); |
|
597 |
RSat::TEventList& singleEvent = *(RSat::TEventList*)aPackage.Ptr1(); |
|
598 |
||
599 |
if ( RSat::KSatV2 == eventInfo.ExtensionId() ) |
|
600 |
{ |
|
601 |
||
602 |
// branch and do whatever is necessary according to the event type.. |
|
603 |
switch ( singleEvent ) |
|
604 |
{ |
|
605 |
case RSat::KUserActivity: |
|
606 |
{ |
|
607 |
ret = SendUserActivityEnvelope(); |
|
608 |
break; |
|
609 |
} |
|
610 |
case RSat::KIdleScreenAvailable: |
|
611 |
{ |
|
612 |
ret = SendIdleScreenAvailableEnvelope(); |
|
613 |
break; |
|
614 |
} |
|
615 |
case RSat::KBrowserTermination: |
|
616 |
{ |
|
617 |
ret = SendBrowserTerminationEnvelope( |
|
618 |
((RSat::TBrowserTerminationEventV2*)&eventInfo)->iCause ); |
|
619 |
break; |
|
620 |
} |
|
621 |
case RSat::KLanguageSelection: |
|
622 |
{ |
|
623 |
ret = SendLanguageSelectionEnvelope( |
|
624 |
((RSat::TLanguageSelectionEventV2*)&eventInfo)->iLanguage ); |
|
625 |
break; |
|
626 |
} |
|
627 |
case RSat::KDataAvailable: |
|
628 |
{ |
|
629 |
// DataAvailable will trigger a ReceiveData PCmd |
|
630 |
ret = SendDataAvailableEnvelope( |
|
631 |
((RSat::TDataAvailableEventV2*)&eventInfo)->iStatus, |
|
632 |
((RSat::TDataAvailableEventV2*)&eventInfo)->iLength ); |
|
633 |
break; |
|
634 |
} |
|
635 |
case RSat::KChannelStatus: |
|
636 |
{ |
|
637 |
// when the ME detects one of the following changes: |
|
638 |
// - a link is error, or |
|
639 |
// - any other error, |
|
640 |
// which is not resulting from the execution of a proactive |
|
641 |
// command, the ME shall inform the SIM that this has occurred. |
|
642 |
ret = SendChannelStatusEnvelope( |
|
643 |
((RSat::TChannelStatusEventV2*)&eventInfo)->iStatus ); |
|
644 |
break; |
|
645 |
} |
|
646 |
||
647 |
// TSY is responsible for these events |
|
648 |
// but they are not reported to ETel |
|
649 |
//case RSat::KMTCall: |
|
650 |
//case RSat::KCallConnected: |
|
651 |
//case RSat::KCallDisconnected: |
|
652 |
//case RSat::KLocationStatus: |
|
653 |
//case RSat::KAccessTechnologyChange: |
|
654 |
||
655 |
// events that can be reported by client, but are not supported |
|
656 |
// by TSY |
|
657 |
//case RSat::KCardReaderStatus: |
|
658 |
//case RSat::KDisplayParamsChanges: |
|
659 |
//case RSat::KLocalConnection: |
|
660 |
default: |
|
661 |
{ |
|
662 |
ret = KErrNotSupported; |
|
663 |
break; |
|
664 |
} |
|
665 |
} // end switch |
|
666 |
||
667 |
} // end if |
|
668 |
||
669 |
// complete the request... |
|
670 |
iSatMessaging->ReqCompleted( aTsyReqHandle, ret ); |
|
671 |
return KErrNone; |
|
672 |
} |
|
673 |
||
674 |
// ----------------------------------------------------------------------------- |
|
675 |
// CSatEventDownload::Cancel |
|
676 |
// |
|
677 |
// ----------------------------------------------------------------------------- |
|
678 |
// |
|
679 |
TInt CSatEventDownload::Cancel |
|
680 |
( |
|
681 |
const TTsyReqHandle /*aTsyReqHandle*/ |
|
682 |
) |
|
683 |
{ |
|
684 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CANCEL, "CSatEventDownload::Cancel" ); |
|
685 |
TFLOGSTRING("TSY: CSatEventDownload::Cancel"); |
|
686 |
// since event download is served at once. |
|
687 |
// we don't have anything to do here |
|
688 |
return KErrNone; |
|
689 |
} |
|
690 |
||
691 |
// ----------------------------------------------------------------------------- |
|
692 |
// CSatEventDownload::CallModemMessageIndReceived |
|
693 |
// Handle CALL_MODEM_MESSAGE_IND indication |
|
694 |
// ----------------------------------------------------------------------------- |
|
695 |
// |
|
696 |
void CSatEventDownload::CallModemMessageIndReceived |
|
697 |
( |
|
698 |
const TIsiReceiveC& aIsiMessage // incoming ISI message |
|
699 |
) |
|
700 |
{ |
|
701 |
TFLOGSTRING("TSY: CSatEventDownload::CallModemMessageIndReceived"); |
|
702 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived" ); |
|
703 |
||
704 |
// CALL_MODEM_SB_DETAILED_CAUSE length max value is 248 |
|
705 |
TBuf8<KMaxCallModemDetailedCause> cause; |
|
706 |
TBool causeGiven( EFalse ); |
|
707 |
||
708 |
// extract call message, message direction and transaction id |
|
709 |
TUint8 callMessage( 0 ); |
|
710 |
TUint8 messageDirection( 0 ); |
|
711 |
TUint8 transactionId( 0 ); |
|
712 |
TUint sbStartOffset( 0 ); |
|
713 |
||
714 |
TInt retValue( aIsiMessage.FindSubBlockOffsetById( |
|
715 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND, |
|
716 |
CALL_MODEM_SB_MSG_INFO, |
|
717 |
EIsiSubBlockTypeId8Len8, |
|
718 |
sbStartOffset ) ); |
|
719 |
||
720 |
if ( KErrNone == retValue ) |
|
721 |
{ |
|
722 |
callMessage = aIsiMessage.Get8bit( |
|
723 |
sbStartOffset + CALL_MODEM_SB_MSG_INFO_OFFSET_MSG ); |
|
724 |
messageDirection = aIsiMessage.Get8bit( |
|
725 |
sbStartOffset + CALL_MODEM_SB_MSG_INFO_OFFSET_MSGDIR ); |
|
726 |
transactionId = aIsiMessage.Get8bit( |
|
727 |
sbStartOffset + CALL_MODEM_SB_MSG_INFO_OFFSET_TRANSACTIONID ); |
|
728 |
||
729 |
switch ( callMessage ) |
|
730 |
{ |
|
731 |
case CALL_MODEM_MSG_SETUP: |
|
732 |
{ |
|
733 |
if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection ) |
|
734 |
{ |
|
735 |
// Received event is mobile terminated call |
|
736 |
if ( iEventList.IsEnabled( RSat::KMTCall ) ) |
|
737 |
{ |
|
738 |
// 'Calling Party BCD Number IE'. |
|
739 |
TBuf8<KCallModemOriginCsAddressMaxLength> BCDAddress; |
|
740 |
// CALL_ORIGIN_SUBADDRESS, value range is 0 to 248 |
|
741 |
TPtrC8 subAddress; |
|
742 |
||
743 |
// Extract address and address type (=TON and NPI) |
|
744 |
retValue = aIsiMessage.FindSubBlockOffsetById( |
|
745 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND, |
|
746 |
CALL_MODEM_SB_ORIGIN_CS_ADDRESS, |
|
747 |
EIsiSubBlockTypeId8Len8, |
|
748 |
sbStartOffset ); |
|
749 |
||
750 |
if ( KErrNone == retValue ) |
|
751 |
{ |
|
752 |
TInt addressLength( aIsiMessage.Get8bit( |
|
753 |
sbStartOffset + |
|
754 |
CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDRLEN ) ); |
|
755 |
||
756 |
// Set address type (TON/NPI) in correct form |
|
757 |
BCDAddress.Append( aIsiMessage.Get8bit( |
|
758 |
sbStartOffset + |
|
759 |
CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDR ) |
|
760 |
| KMSBMask ); |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
761 |
// Append BCD address. Skip TON/NPI |
0 | 762 |
BCDAddress.Append( aIsiMessage.GetData( |
763 |
sbStartOffset + |
|
8
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
764 |
CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDR + 1, |
6295dc2169f3
New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
5
diff
changeset
|
765 |
addressLength - 1 ) ); |
0 | 766 |
} |
767 |
// Extract subaddress |
|
768 |
retValue = aIsiMessage.FindSubBlockOffsetById( |
|
769 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND, |
|
770 |
CALL_MODEM_SB_ORIGIN_SUBADDRESS, |
|
771 |
EIsiSubBlockTypeId8Len8, |
|
772 |
sbStartOffset ); |
|
773 |
||
774 |
if ( KErrNone == retValue ) |
|
775 |
{ |
|
776 |
TInt subAddressLength( aIsiMessage.Get8bit( |
|
777 |
sbStartOffset + |
|
778 |
CALL_MODEM_SB_ORIGIN_SUBADDRESS_OFFSET_ADDRLEN ) ); |
|
779 |
||
780 |
subAddress.Set( aIsiMessage.GetData( |
|
781 |
sbStartOffset + CALL_MODEM_SB_ORIGIN_SUBADDRESS_OFFSET_ADDR, |
|
782 |
subAddressLength ) ); |
|
783 |
} |
|
784 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived Send MT call event" ); |
|
785 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Send MT call event" ); |
|
786 |
||
787 |
SendMTCallEnvelope( |
|
788 |
transactionId, |
|
789 |
BCDAddress, |
|
790 |
subAddress ); |
|
791 |
} |
|
792 |
} |
|
793 |
break; |
|
794 |
} |
|
795 |
case CALL_MODEM_MSG_CONNECT: |
|
796 |
{ |
|
797 |
if ( iEventList.IsEnabled( RSat::KCallConnected ) ) |
|
798 |
{ |
|
799 |
if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection ) |
|
800 |
{ |
|
801 |
TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Creating a call"); |
|
802 |
OstTrace0( TRACE_NORMAL, DUP2_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Creating a call" ); |
|
803 |
||
804 |
SendCallConnectedEnvelope( |
|
805 |
transactionId, |
|
806 |
EFalse/*mobile originated*/ ); |
|
807 |
} |
|
808 |
else if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection ) |
|
809 |
{ |
|
810 |
TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Incoming call arrives"); |
|
811 |
OstTrace0( TRACE_NORMAL, DUP3_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Incoming call arrives" ); |
|
812 |
||
813 |
SendCallConnectedEnvelope( |
|
814 |
transactionId, |
|
815 |
ETrue/*mobile terminated*/); |
|
816 |
} |
|
817 |
} |
|
818 |
break; |
|
819 |
} |
|
820 |
case CALL_MODEM_MSG_RELEASE: |
|
821 |
{ |
|
822 |
if ( iEventList.IsEnabled( RSat::KCallDisconnected ) ) |
|
823 |
{ |
|
824 |
// extract cause |
|
825 |
retValue = aIsiMessage.FindSubBlockOffsetById( |
|
826 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND, |
|
827 |
CALL_MODEM_SB_DETAILED_CAUSE, |
|
828 |
EIsiSubBlockTypeId8Len8, |
|
829 |
sbStartOffset ); |
|
830 |
||
831 |
if ( KErrNone == retValue ) |
|
832 |
{ |
|
833 |
TInt causeLength( aIsiMessage.Get8bit( |
|
834 |
sbStartOffset + CALL_MODEM_SB_DETAILED_CAUSE_OFFSET_CAUSELEN ) ); |
|
835 |
cause.Copy( aIsiMessage.GetData( |
|
836 |
sbStartOffset + CALL_MODEM_SB_DETAILED_CAUSE_OFFSET_CAUSE, |
|
837 |
causeLength ) ); |
|
838 |
causeGiven = ETrue; |
|
839 |
} |
|
840 |
||
841 |
if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection ) |
|
842 |
{ |
|
843 |
// 2.33.11 Event Indications on Mobile Originated Call |
|
844 |
// Clearing (GSM) |
|
845 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MO call clearing "); |
|
846 |
OstTrace0( TRACE_NORMAL, DUP4_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived MO call clearing" ); |
|
847 |
||
848 |
SendCallDisconnectedEnvelope( |
|
849 |
transactionId, |
|
850 |
ETrue/*near end*/, |
|
851 |
causeGiven, |
|
852 |
cause ); |
|
853 |
} |
|
854 |
else if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection ) |
|
855 |
{ |
|
856 |
// 2.33.12 Event indications on Mobile Terminated Call |
|
857 |
// Clearing (GSM) |
|
858 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MT call clearing"); |
|
859 |
OstTrace0( TRACE_NORMAL, DUP7_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived MT call clearing" ); |
|
860 |
||
861 |
SendCallDisconnectedEnvelope( |
|
862 |
transactionId, |
|
863 |
EFalse/*far end*/, |
|
864 |
causeGiven, |
|
865 |
cause ); |
|
866 |
} |
|
867 |
else if ( CALL_MODEM_MSG_DIRECT_INTERNAL == messageDirection ) |
|
868 |
{ |
|
869 |
// 2.33.13 Event indications on radio link failure |
|
870 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived radiolink failure"); |
|
871 |
OstTrace0( TRACE_NORMAL, DUP5_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Radiolink failure" ); |
|
872 |
// In the case of a radio link timeout, the Cause data |
|
873 |
// object shall be included, with a value part of zero |
|
874 |
// length. |
|
875 |
causeGiven = ETrue; |
|
876 |
cause.Zero(); |
|
877 |
SendCallDisconnectedEnvelope( |
|
878 |
transactionId, |
|
879 |
ETrue/*near end*/, |
|
880 |
causeGiven, |
|
881 |
cause ); |
|
882 |
} |
|
883 |
} |
|
884 |
break; |
|
885 |
} |
|
886 |
default: |
|
887 |
{ |
|
888 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" ); |
|
889 |
OstTrace0( TRACE_NORMAL, DUP6_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" ); |
|
890 |
// do nothing |
|
891 |
break; |
|
892 |
} |
|
893 |
} |
|
894 |
} |
|
895 |
} |
|
896 |
||
897 |
// ----------------------------------------------------------------------------- |
|
898 |
// CSatEventDownload::SendDataAvailableEnvelope |
|
899 |
// Send data available event to USIM |
|
900 |
// ----------------------------------------------------------------------------- |
|
901 |
// |
|
902 |
TInt CSatEventDownload::SendDataAvailableEnvelope |
|
903 |
( |
|
904 |
RSat::TChannelStatus aStatus, // Status of the channel |
|
905 |
TInt8 aLength // Channel data length |
|
906 |
) |
|
907 |
{ |
|
908 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDDATAAVAILABLEENVELOPE, "CSatEventDownload::SendDataAvailableEnvelope" ); |
|
909 |
TFLOGSTRING( "TSY: CSatEventDownload::SendDataAvailableEnvelope" ); |
|
910 |
||
911 |
TInt ret = KErrNone; |
|
912 |
||
913 |
if ( iEventList.IsEnabled( RSat::KDataAvailable ) ) |
|
914 |
{ |
|
915 |
// create envelope |
|
916 |
TTlv envelope; |
|
917 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
918 |
||
919 |
// event list |
|
920 |
envelope.AddTag ( KTlvEventListTag ); |
|
921 |
envelope.AddByte( KEventDataAvailable ); |
|
922 |
||
923 |
// device identities |
|
924 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
925 |
envelope.AddByte( KMe ); |
|
926 |
envelope.AddByte( KSim ); |
|
927 |
||
928 |
// channel status |
|
929 |
envelope.AddTag( KTlvChannelStatusTag ); |
|
930 |
envelope.AddData( aStatus ); |
|
931 |
||
932 |
// channel data length |
|
933 |
envelope.AddTag( KTlvChannelDataLengthTag ); |
|
934 |
envelope.AddByte( aLength ); |
|
935 |
||
936 |
// send |
|
937 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
938 |
GetTransactionId(), envelope.End() ); |
|
939 |
} |
|
940 |
||
941 |
return ret; |
|
942 |
} |
|
943 |
||
944 |
// ----------------------------------------------------------------------------- |
|
945 |
// CSatEventDownload::SendChannelStatusEnvelope |
|
946 |
// Send channel status event to USIM |
|
947 |
// ----------------------------------------------------------------------------- |
|
948 |
// |
|
949 |
TInt CSatEventDownload::SendChannelStatusEnvelope |
|
950 |
( |
|
951 |
RSat::TChannelStatus aStatus // Status of the channel |
|
952 |
) |
|
953 |
{ |
|
954 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDCHANNELSTATUSENVELOPE, "CSatEventDownload::SendChannelStatusEnvelope" ); |
|
955 |
TFLOGSTRING("TSY: CSatEventDownload::SendChannelStatusEnvelope"); |
|
956 |
||
957 |
TInt ret = KErrNone; |
|
958 |
||
959 |
if ( iEventList.IsEnabled( RSat::KChannelStatus ) ) |
|
960 |
{ |
|
961 |
// create envelope |
|
962 |
TTlv envelope; |
|
963 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
964 |
||
965 |
// event list |
|
966 |
envelope.AddTag ( KTlvEventListTag ); |
|
967 |
envelope.AddByte( KEventChannelStatus ); |
|
968 |
||
969 |
// device identities |
|
970 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
971 |
envelope.AddByte( KMe ); |
|
972 |
envelope.AddByte( KSim ); |
|
973 |
||
974 |
// channel status |
|
975 |
envelope.AddTag( KTlvChannelStatusTag ); |
|
976 |
envelope.AddData( aStatus ); |
|
977 |
||
978 |
// send |
|
979 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
980 |
GetTransactionId(), envelope.End() ); |
|
981 |
} |
|
982 |
||
983 |
return ret; |
|
984 |
} |
|
985 |
||
986 |
// ----------------------------------------------------------------------------- |
|
987 |
// CSatEventDownload::MessageReceived |
|
988 |
// Handle received messages related to event download. |
|
989 |
// Called by CSatMessHandler::MessageReceivedL, when a new ISI message arrives. |
|
990 |
// Identifies call server CALL_STATUS_IND message and passes it to |
|
991 |
// CallStatusIndReceived. |
|
992 |
// ----------------------------------------------------------------------------- |
|
993 |
// |
|
994 |
TInt CSatEventDownload::MessageReceived |
|
995 |
( |
|
996 |
const TIsiReceiveC& aIsiMessage |
|
997 |
) |
|
998 |
{ |
|
999 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_MESSAGERECEIVED, "CSatEventDownload::MessageReceived" ); |
|
1000 |
TFLOGSTRING("TSY: CSatEventDownload::MessageReceived"); |
|
1001 |
// Get resource and message id's |
|
1002 |
TInt resource( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) ); |
|
1003 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ); |
|
1004 |
||
1005 |
if ( PN_MODEM_CALL == resource ) |
|
1006 |
{ |
|
1007 |
switch ( messageId ) |
|
1008 |
{ |
|
1009 |
case CALL_MODEM_MESSAGE_IND: |
|
1010 |
{ |
|
1011 |
if ( iEventList.IsEnabled( RSat::KMTCall ) |
|
1012 |
|| iEventList.IsEnabled( RSat::KCallConnected ) |
|
1013 |
|| iEventList.IsEnabled( RSat::KCallDisconnected ) ) |
|
1014 |
{ |
|
1015 |
// for call connected and disconnected events |
|
1016 |
CallModemMessageIndReceived( aIsiMessage ); |
|
1017 |
} |
|
1018 |
break; |
|
1019 |
} |
|
1020 |
case CALL_MODEM_PRESENT_IND: |
|
1021 |
{ |
|
1022 |
// Used only for location status event |
|
1023 |
if ( iEventList.IsEnabled( RSat::KLocationStatus ) ) |
|
1024 |
{ |
|
1025 |
TUint8 serverStatus( aIsiMessage.Get8bit( |
|
1026 |
ISI_HEADER_SIZE + |
|
1027 |
CALL_MODEM_PRESENT_IND_OFFSET_CALLPRESENT ) ); |
|
1028 |
// Upper three bits (5-7) indicate the underlying |
|
1029 |
// cellular system. We don't use them, let's AND them away |
|
1030 |
serverStatus &= 0x0F; |
|
1031 |
||
1032 |
if ( CALL_MODEM_NOT_PRESENT == serverStatus ) |
|
1033 |
{ |
|
1034 |
if ( iLocationStatusEnvelopePending ) |
|
1035 |
{ |
|
1036 |
// Location status event sent if ME is not busy |
|
1037 |
// on calls and envelope is pending |
|
1038 |
SendLocationStatusEnvelope( |
|
1039 |
iSatMessHandler->LocationInfo() ); |
|
1040 |
} |
|
1041 |
iCallsOngoing = EFalse; |
|
1042 |
} |
|
1043 |
else |
|
1044 |
{ |
|
1045 |
// There's active calls |
|
1046 |
iCallsOngoing = ETrue; |
|
1047 |
} |
|
1048 |
} |
|
1049 |
break; |
|
1050 |
} |
|
1051 |
default: |
|
1052 |
{ |
|
1053 |
// do nothing |
|
1054 |
break; |
|
1055 |
} |
|
1056 |
} |
|
1057 |
} |
|
1058 |
else if ( PN_MODEM_NETWORK == resource ) |
|
1059 |
{ |
|
1060 |
switch ( messageId ) |
|
1061 |
{ |
|
1062 |
case NET_CELL_INFO_IND: |
|
1063 |
{ |
|
1064 |
iNetCellInfoIndReceived = ETrue; |
|
1065 |
if ( iEventList.IsEnabled( RSat::KLocationStatus ) ) |
|
1066 |
{ |
|
1067 |
if ( !iCallsOngoing ) |
|
1068 |
{ |
|
1069 |
// Location status event sent if ME is not busy on calls |
|
1070 |
SendLocationStatusEnvelope( |
|
1071 |
iSatMessHandler->LocationInfo() ); |
|
1072 |
} |
|
1073 |
else |
|
1074 |
{ |
|
1075 |
// Let's send envelope after ongoing call(s) |
|
1076 |
iLocationStatusEnvelopePending = ETrue; |
|
1077 |
} |
|
1078 |
} |
|
1079 |
break; |
|
1080 |
} |
|
1081 |
default: |
|
1082 |
{ |
|
1083 |
// do nothing |
|
1084 |
break; |
|
1085 |
} |
|
1086 |
} |
|
1087 |
} |
|
1088 |
||
1089 |
return KErrNone; |
|
1090 |
} |
|
1091 |
||
1092 |
// ----------------------------------------------------------------------------- |
|
1093 |
// CSatEventDownload::SetSetUpCallStatus |
|
1094 |
// Set SetUpCall status |
|
1095 |
// ----------------------------------------------------------------------------- |
|
1096 |
// |
|
1097 |
void CSatEventDownload::SetSetUpCallStatus |
|
1098 |
( |
|
1099 |
const TBool aStatus // SetUpCall status |
|
1100 |
) |
|
1101 |
{ |
|
1102 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SETSETUPCALLSTATUS, "CSatEventDownload::SetSetUpCallStatus" ); |
|
1103 |
TFLOGSTRING("TSY: CSatEventDownload::SetSetUpCallStatus"); |
|
1104 |
iSetUpCallOngoing = aStatus; |
|
1105 |
} |
|
1106 |
||
1107 |
// ----------------------------------------------------------------------------- |
|
1108 |
// CSatEventDownload::SendAccessTechnologyChangeEnvelope |
|
1109 |
// Send access technology change event to USIM |
|
1110 |
// ----------------------------------------------------------------------------- |
|
1111 |
// |
|
1112 |
TInt CSatEventDownload::SendAccessTechnologyChangeEnvelope |
|
1113 |
( |
|
1114 |
TUint8 accTechChange //Acc Tech |
|
1115 |
) |
|
1116 |
{ |
|
1117 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE, "CSatEventDownload::SendAccessTechnologyChangeEnvelope" ); |
|
1118 |
TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope"); |
|
1119 |
||
1120 |
TInt ret = KErrNone; |
|
1121 |
||
1122 |
if ( iEventList.IsEnabled( RSat::KAccessTechnologyChange ) ) |
|
1123 |
{ |
|
1124 |
TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope\ |
|
1125 |
- Event enabled: sending envelope"); |
|
1126 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE, "CSatEventDownload::SendAccessTechnologyChangeEnvelope - Event enabled: sending envelope" ); |
|
1127 |
// create envelope |
|
1128 |
TTlv envelope; |
|
1129 |
envelope.Begin ( KBerTlvEventDownloadTag ); |
|
1130 |
||
1131 |
// event list |
|
1132 |
envelope.AddTag ( KTlvEventListTag ); |
|
1133 |
envelope.AddByte( KEventAccessTechnologyChange ); |
|
1134 |
||
1135 |
// device identities |
|
1136 |
envelope.AddTag ( KTlvDeviceIdentityTag ); |
|
1137 |
envelope.AddByte( KMe ); |
|
1138 |
envelope.AddByte( KSim ); |
|
1139 |
||
1140 |
// channel status |
|
1141 |
envelope.AddTag( KTlvAccessTechnologyTag ); |
|
1142 |
envelope.AddByte( accTechChange ); |
|
1143 |
||
1144 |
// send |
|
1145 |
ret = iSatMessHandler->UiccCatReqEnvelope( |
|
1146 |
GetTransactionId(), envelope.End() ); |
|
1147 |
} |
|
1148 |
||
1149 |
return ret; |
|
1150 |
} |
|
1151 |
||
1152 |
// ----------------------------------------------------------------------------- |
|
1153 |
// CSatEventDownload::ForceLocationStatusEnvelope |
|
1154 |
// Force sending of Location status envelope if ENS supported in product profile |
|
1155 |
// and SET UP EVENT LIST terminal response is sent |
|
1156 |
// ----------------------------------------------------------------------------- |
|
1157 |
// |
|
1158 |
#ifdef INFO_PP_ENHANCED_NETWORK_SELECTION |
|
1159 |
TInt CSatEventDownload::ForceLocationStatusEnvelope() |
|
1160 |
{ |
|
1161 |
TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope"); |
|
1162 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE, "CSatEventDownload::ForceLocationStatusEnvelope" ); |
|
1163 |
||
1164 |
TInt ret( KErrNone ); |
|
1165 |
if ( iEventList.IsEnabled( RSat::KLocationStatus ) |
|
1166 |
&& iSatMessHandler->EnsSupported() |
|
1167 |
&& iNetCellInfoIndReceived ) |
|
1168 |
{ |
|
1169 |
TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP"); |
|
1170 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE, "CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP" ); |
|
1171 |
ret = SendLocationStatusEnvelope( |
|
1172 |
iSatMessHandler->LocationInfo() ); |
|
1173 |
} |
|
1174 |
return ret; |
|
1175 |
} |
|
1176 |
#endif // INFO_PP_ENHANCED_NETWORK_SELECTION |
|
1177 |
// End of File |