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
|
|
30 |
#include "osttracedefinitions.h"
|
|
31 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
32 |
#include "sateventdownloadtraces.h"
|
|
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 );
|
|
761 |
// Append BCD address. Skip call type and mode
|
|
762 |
// ( 2 first bytes, not required in envelope )
|
|
763 |
BCDAddress.Append( aIsiMessage.GetData(
|
|
764 |
sbStartOffset +
|
|
765 |
CALL_MODEM_SB_ORIGIN_CS_ADDRESS_OFFSET_ADDR + 2,
|
|
766 |
addressLength - 2 ) );
|
|
767 |
}
|
|
768 |
// Extract subaddress
|
|
769 |
retValue = aIsiMessage.FindSubBlockOffsetById(
|
|
770 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND,
|
|
771 |
CALL_MODEM_SB_ORIGIN_SUBADDRESS,
|
|
772 |
EIsiSubBlockTypeId8Len8,
|
|
773 |
sbStartOffset );
|
|
774 |
|
|
775 |
if ( KErrNone == retValue )
|
|
776 |
{
|
|
777 |
TInt subAddressLength( aIsiMessage.Get8bit(
|
|
778 |
sbStartOffset +
|
|
779 |
CALL_MODEM_SB_ORIGIN_SUBADDRESS_OFFSET_ADDRLEN ) );
|
|
780 |
|
|
781 |
subAddress.Set( aIsiMessage.GetData(
|
|
782 |
sbStartOffset + CALL_MODEM_SB_ORIGIN_SUBADDRESS_OFFSET_ADDR,
|
|
783 |
subAddressLength ) );
|
|
784 |
}
|
|
785 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived Send MT call event" );
|
|
786 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Send MT call event" );
|
|
787 |
|
|
788 |
SendMTCallEnvelope(
|
|
789 |
transactionId,
|
|
790 |
BCDAddress,
|
|
791 |
subAddress );
|
|
792 |
}
|
|
793 |
}
|
|
794 |
break;
|
|
795 |
}
|
|
796 |
case CALL_MODEM_MSG_CONNECT:
|
|
797 |
{
|
|
798 |
if ( iEventList.IsEnabled( RSat::KCallConnected ) )
|
|
799 |
{
|
|
800 |
if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection )
|
|
801 |
{
|
|
802 |
TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Creating a call");
|
|
803 |
OstTrace0( TRACE_NORMAL, DUP2_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Creating a call" );
|
|
804 |
|
|
805 |
SendCallConnectedEnvelope(
|
|
806 |
transactionId,
|
|
807 |
EFalse/*mobile originated*/ );
|
|
808 |
}
|
|
809 |
else if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection )
|
|
810 |
{
|
|
811 |
TFLOGSTRING("CSatEventDownload::CallModemMessageIndReceived Incoming call arrives");
|
|
812 |
OstTrace0( TRACE_NORMAL, DUP3_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Incoming call arrives" );
|
|
813 |
|
|
814 |
SendCallConnectedEnvelope(
|
|
815 |
transactionId,
|
|
816 |
ETrue/*mobile terminated*/);
|
|
817 |
}
|
|
818 |
}
|
|
819 |
break;
|
|
820 |
}
|
|
821 |
case CALL_MODEM_MSG_RELEASE:
|
|
822 |
{
|
|
823 |
if ( iEventList.IsEnabled( RSat::KCallDisconnected ) )
|
|
824 |
{
|
|
825 |
// extract cause
|
|
826 |
retValue = aIsiMessage.FindSubBlockOffsetById(
|
|
827 |
ISI_HEADER_SIZE + SIZE_CALL_MODEM_MESSAGE_IND,
|
|
828 |
CALL_MODEM_SB_DETAILED_CAUSE,
|
|
829 |
EIsiSubBlockTypeId8Len8,
|
|
830 |
sbStartOffset );
|
|
831 |
|
|
832 |
if ( KErrNone == retValue )
|
|
833 |
{
|
|
834 |
TInt causeLength( aIsiMessage.Get8bit(
|
|
835 |
sbStartOffset + CALL_MODEM_SB_DETAILED_CAUSE_OFFSET_CAUSELEN ) );
|
|
836 |
cause.Copy( aIsiMessage.GetData(
|
|
837 |
sbStartOffset + CALL_MODEM_SB_DETAILED_CAUSE_OFFSET_CAUSE,
|
|
838 |
causeLength ) );
|
|
839 |
causeGiven = ETrue;
|
|
840 |
}
|
|
841 |
|
|
842 |
if ( CALL_MODEM_MSG_DIRECT_SENT == messageDirection )
|
|
843 |
{
|
|
844 |
// 2.33.11 Event Indications on Mobile Originated Call
|
|
845 |
// Clearing (GSM)
|
|
846 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MO call clearing ");
|
|
847 |
OstTrace0( TRACE_NORMAL, DUP4_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived MO call clearing" );
|
|
848 |
|
|
849 |
SendCallDisconnectedEnvelope(
|
|
850 |
transactionId,
|
|
851 |
ETrue/*near end*/,
|
|
852 |
causeGiven,
|
|
853 |
cause );
|
|
854 |
}
|
|
855 |
else if ( CALL_MODEM_MSG_DIRECT_RECEIVED == messageDirection )
|
|
856 |
{
|
|
857 |
// 2.33.12 Event indications on Mobile Terminated Call
|
|
858 |
// Clearing (GSM)
|
|
859 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived MT call clearing");
|
|
860 |
OstTrace0( TRACE_NORMAL, DUP7_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived MT call clearing" );
|
|
861 |
|
|
862 |
SendCallDisconnectedEnvelope(
|
|
863 |
transactionId,
|
|
864 |
EFalse/*far end*/,
|
|
865 |
causeGiven,
|
|
866 |
cause );
|
|
867 |
}
|
|
868 |
else if ( CALL_MODEM_MSG_DIRECT_INTERNAL == messageDirection )
|
|
869 |
{
|
|
870 |
// 2.33.13 Event indications on radio link failure
|
|
871 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived radiolink failure");
|
|
872 |
OstTrace0( TRACE_NORMAL, DUP5_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived Radiolink failure" );
|
|
873 |
// In the case of a radio link timeout, the Cause data
|
|
874 |
// object shall be included, with a value part of zero
|
|
875 |
// length.
|
|
876 |
causeGiven = ETrue;
|
|
877 |
cause.Zero();
|
|
878 |
SendCallDisconnectedEnvelope(
|
|
879 |
transactionId,
|
|
880 |
ETrue/*near end*/,
|
|
881 |
causeGiven,
|
|
882 |
cause );
|
|
883 |
}
|
|
884 |
}
|
|
885 |
break;
|
|
886 |
}
|
|
887 |
default:
|
|
888 |
{
|
|
889 |
TFLOGSTRING( "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" );
|
|
890 |
OstTrace0( TRACE_NORMAL, DUP6_CSATEVENTDOWNLOAD_CALLMODEMMESSAGEINDRECEIVED, "CSatEventDownload::CallModemMessageIndReceived UNKNOWN" );
|
|
891 |
// do nothing
|
|
892 |
break;
|
|
893 |
}
|
|
894 |
}
|
|
895 |
}
|
|
896 |
}
|
|
897 |
|
|
898 |
// -----------------------------------------------------------------------------
|
|
899 |
// CSatEventDownload::SendDataAvailableEnvelope
|
|
900 |
// Send data available event to USIM
|
|
901 |
// -----------------------------------------------------------------------------
|
|
902 |
//
|
|
903 |
TInt CSatEventDownload::SendDataAvailableEnvelope
|
|
904 |
(
|
|
905 |
RSat::TChannelStatus aStatus, // Status of the channel
|
|
906 |
TInt8 aLength // Channel data length
|
|
907 |
)
|
|
908 |
{
|
|
909 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDDATAAVAILABLEENVELOPE, "CSatEventDownload::SendDataAvailableEnvelope" );
|
|
910 |
TFLOGSTRING( "TSY: CSatEventDownload::SendDataAvailableEnvelope" );
|
|
911 |
|
|
912 |
TInt ret = KErrNone;
|
|
913 |
|
|
914 |
if ( iEventList.IsEnabled( RSat::KDataAvailable ) )
|
|
915 |
{
|
|
916 |
// create envelope
|
|
917 |
TTlv envelope;
|
|
918 |
envelope.Begin ( KBerTlvEventDownloadTag );
|
|
919 |
|
|
920 |
// event list
|
|
921 |
envelope.AddTag ( KTlvEventListTag );
|
|
922 |
envelope.AddByte( KEventDataAvailable );
|
|
923 |
|
|
924 |
// device identities
|
|
925 |
envelope.AddTag ( KTlvDeviceIdentityTag );
|
|
926 |
envelope.AddByte( KMe );
|
|
927 |
envelope.AddByte( KSim );
|
|
928 |
|
|
929 |
// channel status
|
|
930 |
envelope.AddTag( KTlvChannelStatusTag );
|
|
931 |
envelope.AddData( aStatus );
|
|
932 |
|
|
933 |
// channel data length
|
|
934 |
envelope.AddTag( KTlvChannelDataLengthTag );
|
|
935 |
envelope.AddByte( aLength );
|
|
936 |
|
|
937 |
// send
|
|
938 |
ret = iSatMessHandler->UiccCatReqEnvelope(
|
|
939 |
GetTransactionId(), envelope.End() );
|
|
940 |
}
|
|
941 |
|
|
942 |
return ret;
|
|
943 |
}
|
|
944 |
|
|
945 |
// -----------------------------------------------------------------------------
|
|
946 |
// CSatEventDownload::SendChannelStatusEnvelope
|
|
947 |
// Send channel status event to USIM
|
|
948 |
// -----------------------------------------------------------------------------
|
|
949 |
//
|
|
950 |
TInt CSatEventDownload::SendChannelStatusEnvelope
|
|
951 |
(
|
|
952 |
RSat::TChannelStatus aStatus // Status of the channel
|
|
953 |
)
|
|
954 |
{
|
|
955 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDCHANNELSTATUSENVELOPE, "CSatEventDownload::SendChannelStatusEnvelope" );
|
|
956 |
TFLOGSTRING("TSY: CSatEventDownload::SendChannelStatusEnvelope");
|
|
957 |
|
|
958 |
TInt ret = KErrNone;
|
|
959 |
|
|
960 |
if ( iEventList.IsEnabled( RSat::KChannelStatus ) )
|
|
961 |
{
|
|
962 |
// create envelope
|
|
963 |
TTlv envelope;
|
|
964 |
envelope.Begin ( KBerTlvEventDownloadTag );
|
|
965 |
|
|
966 |
// event list
|
|
967 |
envelope.AddTag ( KTlvEventListTag );
|
|
968 |
envelope.AddByte( KEventChannelStatus );
|
|
969 |
|
|
970 |
// device identities
|
|
971 |
envelope.AddTag ( KTlvDeviceIdentityTag );
|
|
972 |
envelope.AddByte( KMe );
|
|
973 |
envelope.AddByte( KSim );
|
|
974 |
|
|
975 |
// channel status
|
|
976 |
envelope.AddTag( KTlvChannelStatusTag );
|
|
977 |
envelope.AddData( aStatus );
|
|
978 |
|
|
979 |
// send
|
|
980 |
ret = iSatMessHandler->UiccCatReqEnvelope(
|
|
981 |
GetTransactionId(), envelope.End() );
|
|
982 |
}
|
|
983 |
|
|
984 |
return ret;
|
|
985 |
}
|
|
986 |
|
|
987 |
// -----------------------------------------------------------------------------
|
|
988 |
// CSatEventDownload::MessageReceived
|
|
989 |
// Handle received messages related to event download.
|
|
990 |
// Called by CSatMessHandler::MessageReceivedL, when a new ISI message arrives.
|
|
991 |
// Identifies call server CALL_STATUS_IND message and passes it to
|
|
992 |
// CallStatusIndReceived.
|
|
993 |
// -----------------------------------------------------------------------------
|
|
994 |
//
|
|
995 |
TInt CSatEventDownload::MessageReceived
|
|
996 |
(
|
|
997 |
const TIsiReceiveC& aIsiMessage
|
|
998 |
)
|
|
999 |
{
|
|
1000 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_MESSAGERECEIVED, "CSatEventDownload::MessageReceived" );
|
|
1001 |
TFLOGSTRING("TSY: CSatEventDownload::MessageReceived");
|
|
1002 |
// Get resource and message id's
|
|
1003 |
TInt resource( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_RESOURCEID ) );
|
|
1004 |
TInt messageId( aIsiMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) );
|
|
1005 |
|
|
1006 |
if ( PN_MODEM_CALL == resource )
|
|
1007 |
{
|
|
1008 |
switch ( messageId )
|
|
1009 |
{
|
|
1010 |
case CALL_MODEM_MESSAGE_IND:
|
|
1011 |
{
|
|
1012 |
if ( iEventList.IsEnabled( RSat::KMTCall )
|
|
1013 |
|| iEventList.IsEnabled( RSat::KCallConnected )
|
|
1014 |
|| iEventList.IsEnabled( RSat::KCallDisconnected ) )
|
|
1015 |
{
|
|
1016 |
// for call connected and disconnected events
|
|
1017 |
CallModemMessageIndReceived( aIsiMessage );
|
|
1018 |
}
|
|
1019 |
break;
|
|
1020 |
}
|
|
1021 |
case CALL_MODEM_PRESENT_IND:
|
|
1022 |
{
|
|
1023 |
// Used only for location status event
|
|
1024 |
if ( iEventList.IsEnabled( RSat::KLocationStatus ) )
|
|
1025 |
{
|
|
1026 |
TUint8 serverStatus( aIsiMessage.Get8bit(
|
|
1027 |
ISI_HEADER_SIZE +
|
|
1028 |
CALL_MODEM_PRESENT_IND_OFFSET_CALLPRESENT ) );
|
|
1029 |
// Upper three bits (5-7) indicate the underlying
|
|
1030 |
// cellular system. We don't use them, let's AND them away
|
|
1031 |
serverStatus &= 0x0F;
|
|
1032 |
|
|
1033 |
if ( CALL_MODEM_NOT_PRESENT == serverStatus )
|
|
1034 |
{
|
|
1035 |
if ( iLocationStatusEnvelopePending )
|
|
1036 |
{
|
|
1037 |
// Location status event sent if ME is not busy
|
|
1038 |
// on calls and envelope is pending
|
|
1039 |
SendLocationStatusEnvelope(
|
|
1040 |
iSatMessHandler->LocationInfo() );
|
|
1041 |
}
|
|
1042 |
iCallsOngoing = EFalse;
|
|
1043 |
}
|
|
1044 |
else
|
|
1045 |
{
|
|
1046 |
// There's active calls
|
|
1047 |
iCallsOngoing = ETrue;
|
|
1048 |
}
|
|
1049 |
}
|
|
1050 |
break;
|
|
1051 |
}
|
|
1052 |
default:
|
|
1053 |
{
|
|
1054 |
// do nothing
|
|
1055 |
break;
|
|
1056 |
}
|
|
1057 |
}
|
|
1058 |
}
|
|
1059 |
else if ( PN_MODEM_NETWORK == resource )
|
|
1060 |
{
|
|
1061 |
switch ( messageId )
|
|
1062 |
{
|
|
1063 |
case NET_CELL_INFO_IND:
|
|
1064 |
{
|
|
1065 |
iNetCellInfoIndReceived = ETrue;
|
|
1066 |
if ( iEventList.IsEnabled( RSat::KLocationStatus ) )
|
|
1067 |
{
|
|
1068 |
if ( !iCallsOngoing )
|
|
1069 |
{
|
|
1070 |
// Location status event sent if ME is not busy on calls
|
|
1071 |
SendLocationStatusEnvelope(
|
|
1072 |
iSatMessHandler->LocationInfo() );
|
|
1073 |
}
|
|
1074 |
else
|
|
1075 |
{
|
|
1076 |
// Let's send envelope after ongoing call(s)
|
|
1077 |
iLocationStatusEnvelopePending = ETrue;
|
|
1078 |
}
|
|
1079 |
}
|
|
1080 |
break;
|
|
1081 |
}
|
|
1082 |
default:
|
|
1083 |
{
|
|
1084 |
// do nothing
|
|
1085 |
break;
|
|
1086 |
}
|
|
1087 |
}
|
|
1088 |
}
|
|
1089 |
|
|
1090 |
return KErrNone;
|
|
1091 |
}
|
|
1092 |
|
|
1093 |
// -----------------------------------------------------------------------------
|
|
1094 |
// CSatEventDownload::SetSetUpCallStatus
|
|
1095 |
// Set SetUpCall status
|
|
1096 |
// -----------------------------------------------------------------------------
|
|
1097 |
//
|
|
1098 |
void CSatEventDownload::SetSetUpCallStatus
|
|
1099 |
(
|
|
1100 |
const TBool aStatus // SetUpCall status
|
|
1101 |
)
|
|
1102 |
{
|
|
1103 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SETSETUPCALLSTATUS, "CSatEventDownload::SetSetUpCallStatus" );
|
|
1104 |
TFLOGSTRING("TSY: CSatEventDownload::SetSetUpCallStatus");
|
|
1105 |
iSetUpCallOngoing = aStatus;
|
|
1106 |
}
|
|
1107 |
|
|
1108 |
// -----------------------------------------------------------------------------
|
|
1109 |
// CSatEventDownload::SendAccessTechnologyChangeEnvelope
|
|
1110 |
// Send access technology change event to USIM
|
|
1111 |
// -----------------------------------------------------------------------------
|
|
1112 |
//
|
|
1113 |
TInt CSatEventDownload::SendAccessTechnologyChangeEnvelope
|
|
1114 |
(
|
|
1115 |
TUint8 accTechChange //Acc Tech
|
|
1116 |
)
|
|
1117 |
{
|
|
1118 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE, "CSatEventDownload::SendAccessTechnologyChangeEnvelope" );
|
|
1119 |
TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope");
|
|
1120 |
|
|
1121 |
TInt ret = KErrNone;
|
|
1122 |
|
|
1123 |
if ( iEventList.IsEnabled( RSat::KAccessTechnologyChange ) )
|
|
1124 |
{
|
|
1125 |
TFLOGSTRING("TSY: CSatEventDownload::SendAccessTechnologyChangeEnvelope\
|
|
1126 |
- Event enabled: sending envelope");
|
|
1127 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_SENDACCESSTECHNOLOGYCHANGEENVELOPE, "CSatEventDownload::SendAccessTechnologyChangeEnvelope - Event enabled: sending envelope" );
|
|
1128 |
// create envelope
|
|
1129 |
TTlv envelope;
|
|
1130 |
envelope.Begin ( KBerTlvEventDownloadTag );
|
|
1131 |
|
|
1132 |
// event list
|
|
1133 |
envelope.AddTag ( KTlvEventListTag );
|
|
1134 |
envelope.AddByte( KEventAccessTechnologyChange );
|
|
1135 |
|
|
1136 |
// device identities
|
|
1137 |
envelope.AddTag ( KTlvDeviceIdentityTag );
|
|
1138 |
envelope.AddByte( KMe );
|
|
1139 |
envelope.AddByte( KSim );
|
|
1140 |
|
|
1141 |
// channel status
|
|
1142 |
envelope.AddTag( KTlvAccessTechnologyTag );
|
|
1143 |
envelope.AddByte( accTechChange );
|
|
1144 |
|
|
1145 |
// send
|
|
1146 |
ret = iSatMessHandler->UiccCatReqEnvelope(
|
|
1147 |
GetTransactionId(), envelope.End() );
|
|
1148 |
}
|
|
1149 |
|
|
1150 |
return ret;
|
|
1151 |
}
|
|
1152 |
|
|
1153 |
// -----------------------------------------------------------------------------
|
|
1154 |
// CSatEventDownload::ForceLocationStatusEnvelope
|
|
1155 |
// Force sending of Location status envelope if ENS supported in product profile
|
|
1156 |
// and SET UP EVENT LIST terminal response is sent
|
|
1157 |
// -----------------------------------------------------------------------------
|
|
1158 |
//
|
|
1159 |
#ifdef INFO_PP_ENHANCED_NETWORK_SELECTION
|
|
1160 |
TInt CSatEventDownload::ForceLocationStatusEnvelope()
|
|
1161 |
{
|
|
1162 |
TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope");
|
|
1163 |
OstTrace0( TRACE_NORMAL, CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE, "CSatEventDownload::ForceLocationStatusEnvelope" );
|
|
1164 |
|
|
1165 |
TInt ret( KErrNone );
|
|
1166 |
if ( iEventList.IsEnabled( RSat::KLocationStatus )
|
|
1167 |
&& iSatMessHandler->EnsSupported()
|
|
1168 |
&& iNetCellInfoIndReceived )
|
|
1169 |
{
|
|
1170 |
TFLOGSTRING("TSY: CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP");
|
|
1171 |
OstTrace0( TRACE_NORMAL, DUP1_CSATEVENTDOWNLOAD_FORCELOCATIONSTATUSENVELOPE, "CSatEventDownload::ForceLocationStatusEnvelope, Event list includes Location status and ENS is supported in PP" );
|
|
1172 |
ret = SendLocationStatusEnvelope(
|
|
1173 |
iSatMessHandler->LocationInfo() );
|
|
1174 |
}
|
|
1175 |
return ret;
|
|
1176 |
}
|
|
1177 |
#endif // INFO_PP_ENHANCED_NETWORK_SELECTION
|
|
1178 |
// End of File
|