1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
18 // |
18 // |
19 |
19 |
20 |
20 |
21 |
21 |
22 //INCLUDES |
22 //INCLUDES |
|
23 |
|
24 #include "OstTraceDefinitions.h" |
|
25 #ifdef OST_TRACE_COMPILER_IN_USE |
|
26 #include "CSatNotifySetUpEventListTraces.h" |
|
27 #endif |
|
28 |
23 #include <satcs.h> // Etel SAT IPC definitions |
29 #include <satcs.h> // Etel SAT IPC definitions |
24 #include "CSatTsy.h" // Tsy class header |
30 #include "CSatTsy.h" // Tsy class header |
25 #include "CSatNotifySetUpEventList.h"// Tsy class header |
31 #include "CSatNotifySetUpEventList.h"// Tsy class header |
26 #include "CSatNotificationsTsy.h" // Class header |
32 #include "CSatNotificationsTsy.h" // Class header |
27 #include "CBerTlv.h" // Ber Tlv data handling |
33 #include "CBerTlv.h" // Ber Tlv data handling |
28 #include "TTlv.h" // TTlv class |
34 #include "TTlv.h" // TTlv class |
29 #include "CSatDataPackage.h" // Parameter packing |
35 #include "CSatDataPackage.h" // Parameter packing |
30 #include "TfLogger.h" // For TFLOGSTRING |
|
31 #include "TSatUtility.h" // Utilities |
36 #include "TSatUtility.h" // Utilities |
32 #include "CSatTsyReqHandleStore.h" // Request handle class |
37 #include "CSatTsyReqHandleStore.h" // Request handle class |
33 #include "cmmmessagemanagerbase.h" // Message manager class for forwarding req. |
38 #include "cmmmessagemanagerbase.h" // Message manager class for forwarding req. |
34 |
39 |
35 // ----------------------------------------------------------------------------- |
40 // ----------------------------------------------------------------------------- |
40 CSatNotifySetUpEventList* CSatNotifySetUpEventList::NewL |
45 CSatNotifySetUpEventList* CSatNotifySetUpEventList::NewL |
41 ( |
46 ( |
42 CSatNotificationsTsy* aNotificationsTsy |
47 CSatNotificationsTsy* aNotificationsTsy |
43 ) |
48 ) |
44 { |
49 { |
45 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::NewL"); |
50 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_NEWL_1, "CSAT: CSatNotifySetUpEventList::NewL"); |
46 CSatNotifySetUpEventList* const satNotifySetUpEventList = |
51 CSatNotifySetUpEventList* const satNotifySetUpEventList = |
47 new ( ELeave ) CSatNotifySetUpEventList( aNotificationsTsy ); |
52 new ( ELeave ) CSatNotifySetUpEventList( aNotificationsTsy ); |
48 CleanupStack::PushL( satNotifySetUpEventList ); |
53 CleanupStack::PushL( satNotifySetUpEventList ); |
49 satNotifySetUpEventList->ConstructL(); |
54 satNotifySetUpEventList->ConstructL(); |
50 CleanupStack::Pop( satNotifySetUpEventList ); |
55 CleanupStack::Pop( satNotifySetUpEventList ); |
51 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::NewL, end of method"); |
56 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_NEWL_2, "CSAT: CSatNotifySetUpEventList::NewL, end of method"); |
52 return satNotifySetUpEventList; |
57 return satNotifySetUpEventList; |
53 } |
58 } |
54 |
59 |
55 // ----------------------------------------------------------------------------- |
60 // ----------------------------------------------------------------------------- |
56 // CSatNotifySetUpEventList::~CSatNotifySetUpEventList |
61 // CSatNotifySetUpEventList::~CSatNotifySetUpEventList |
60 CSatNotifySetUpEventList::~CSatNotifySetUpEventList |
65 CSatNotifySetUpEventList::~CSatNotifySetUpEventList |
61 ( |
66 ( |
62 // None |
67 // None |
63 ) |
68 ) |
64 { |
69 { |
65 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::~CSatNotifySetUpEventList"); |
70 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_DTOR_1, "CSAT: CSatNotifySetUpEventList::~CSatNotifySetUpEventList"); |
66 } |
71 } |
67 // ----------------------------------------------------------------------------- |
72 // ----------------------------------------------------------------------------- |
68 // CSatNotifySetUpEventList::CSatNotifySetUpEventList |
73 // CSatNotifySetUpEventList::CSatNotifySetUpEventList |
69 // Default C++ constructor |
74 // Default C++ constructor |
70 // ----------------------------------------------------------------------------- |
75 // ----------------------------------------------------------------------------- |
85 void CSatNotifySetUpEventList::ConstructL |
90 void CSatNotifySetUpEventList::ConstructL |
86 ( |
91 ( |
87 // None |
92 // None |
88 ) |
93 ) |
89 { |
94 { |
90 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::ConstructL, does nothing"); |
95 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_CONSTRUCTL_1, "CSAT: CSatNotifySetUpEventList::ConstructL, does nothing"); |
91 } |
96 } |
92 |
97 |
93 // ----------------------------------------------------------------------------- |
98 // ----------------------------------------------------------------------------- |
94 // CSatNotifySetupEventList::Notify |
99 // CSatNotifySetupEventList::Notify |
95 // Save the request handle type for notification requested by ETel server |
100 // Save the request handle type for notification requested by ETel server |
99 ( |
104 ( |
100 const TTsyReqHandle aTsyReqHandle, |
105 const TTsyReqHandle aTsyReqHandle, |
101 const TDataPackage& aPackage |
106 const TDataPackage& aPackage |
102 ) |
107 ) |
103 { |
108 { |
104 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::Notify"); |
109 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_NOTIFY_1, "CSAT: CSatNotifySetUpEventList::Notify"); |
105 // Save data pointer to client side for completion |
110 // Save data pointer to client side for completion |
106 iSetUpEventListV1Pckg = reinterpret_cast<RSat::TSetUpEventListV1Pckg*>( |
111 iSetUpEventListV1Pckg = reinterpret_cast<RSat::TSetUpEventListV1Pckg*>( |
107 aPackage.Des1n() ); |
112 aPackage.Des1n() ); |
108 |
113 |
109 // Save the request handle |
114 // Save the request handle |
127 TInt CSatNotifySetUpEventList::CancelNotification |
132 TInt CSatNotifySetUpEventList::CancelNotification |
128 ( |
133 ( |
129 const TTsyReqHandle aTsyReqHandle |
134 const TTsyReqHandle aTsyReqHandle |
130 ) |
135 ) |
131 { |
136 { |
132 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::CancelNotification"); |
137 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_CANCELNOTIFICATION_1, "CSAT: CSatNotifySetUpEventList::CancelNotification"); |
133 |
138 |
134 // Reset the request handle |
139 // Reset the request handle |
135 iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( |
140 iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( |
136 CSatTsy::ESatNotifySetUpEventListPCmdReqType ); |
141 CSatTsy::ESatNotifySetUpEventListPCmdReqType ); |
137 |
142 |
153 ( |
158 ( |
154 CSatDataPackage* aDataPackage, |
159 CSatDataPackage* aDataPackage, |
155 TInt aErrorCode |
160 TInt aErrorCode |
156 ) |
161 ) |
157 { |
162 { |
158 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::CompleteNotifyL"); |
163 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_COMPLETENOTIFYL_1, "CSAT: CSatNotifySetUpEventList::CompleteNotifyL"); |
159 TInt ret( KErrNone ); |
164 TInt ret( KErrNone ); |
160 TUint8 generalResult( RSat::KSuccess ); |
165 TUint8 generalResult( RSat::KSuccess ); |
161 |
166 |
162 // Unpack parameters |
167 // Unpack parameters |
163 TPtrC8* data; |
168 TPtrC8* data; |
202 iEvents = 0; |
207 iEvents = 0; |
203 TPtrC8 setUpEventList = eventListTlv.GetData( ETLV_EventList ); |
208 TPtrC8 setUpEventList = eventListTlv.GetData( ETLV_EventList ); |
204 TUint16 eventListLength = eventListTlv.GetLength(); |
209 TUint16 eventListLength = eventListTlv.GetLength(); |
205 if ( !eventListLength ) |
210 if ( !eventListLength ) |
206 { |
211 { |
207 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::\ |
212 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_COMPLETENOTIFYL_2, "CSAT: CSatNotifySetUpEventList::CompleteNotifyL, Event list empty"); |
208 CompleteNotifyL, Event list empty"); |
|
209 setUpEventListV1.iType = RSat::ERemoveExistingEventList; |
213 setUpEventListV1.iType = RSat::ERemoveExistingEventList; |
210 // Remove events from TSY:s list, No events = 0 |
214 // Remove events from TSY:s list, No events = 0 |
211 iNotificationsTsy->iSatTsy->SetUpEventList( 0 ); |
215 iNotificationsTsy->iSatTsy->SetUpEventList( 0 ); |
212 } |
216 } |
213 else |
217 else |
327 } // for ( i = 0; i < eventListLength; i++ ) |
331 } // for ( i = 0; i < eventListLength; i++ ) |
328 } // else ( if ( !eventListLength ) ) |
332 } // else ( if ( !eventListLength ) ) |
329 }// if( KErrNone == ret ) |
333 }// if( KErrNone == ret ) |
330 else |
334 else |
331 { |
335 { |
332 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::CompleteNotifyL,\ |
336 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_COMPLETENOTIFYL_3, "CSAT: CSatNotifySetUpEventList::CompleteNotifyL, Event list missing"); |
333 Event list missing"); |
|
334 // Event list is missing |
337 // Event list is missing |
335 generalResult = RSat::KErrorRequiredValuesMissing; |
338 generalResult = RSat::KErrorRequiredValuesMissing; |
336 } |
339 } |
337 }// if ( KErrNone == aErrorCode ) |
340 }// if ( KErrNone == aErrorCode ) |
338 else |
341 else |
339 { |
342 { |
340 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::CompleteNotifyL,\ |
343 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_COMPLETENOTIFYL_4, "CSAT: CSatNotifySetUpEventList::CompleteNotifyL, Error occurred in LSAT"); |
341 Error occurred in LSAT"); |
|
342 // Error code received from LicenceeSimAtkTsy |
344 // Error code received from LicenceeSimAtkTsy |
343 return ret; |
345 return ret; |
344 } |
346 } |
345 |
347 |
346 } // if ( CSatTsy::ESatReqHandleUnknown != reqHandle ) |
348 } // if ( CSatTsy::ESatReqHandleUnknown != reqHandle ) |
347 else |
349 else |
348 { |
350 { |
349 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::CompleteNotifyL,\ |
351 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_COMPLETENOTIFYL_5, "CSAT: CSatNotifySetUpEventList::CompleteNotifyL, Request not ongoing"); |
350 Request not ongoing"); |
|
351 generalResult = RSat::KMeUnableToProcessCmd; |
352 generalResult = RSat::KMeUnableToProcessCmd; |
352 } |
353 } |
353 |
354 |
354 if ( RSat::KSuccess != generalResult ) |
355 if ( RSat::KSuccess != generalResult ) |
355 { |
356 { |
377 TInt CSatNotifySetUpEventList::TerminalResponseL |
378 TInt CSatNotifySetUpEventList::TerminalResponseL |
378 ( |
379 ( |
379 TDes8* aRsp |
380 TDes8* aRsp |
380 ) |
381 ) |
381 { |
382 { |
382 TFLOGSTRING("CSAT:CSatNotifySetUpEventList::TerminalResponseL"); |
383 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_TERMINALRESPONSEL_1, "CSAT:CSatNotifySetUpEventList::TerminalResponseL"); |
383 |
384 |
384 TInt ret( KErrNone ); |
385 TInt ret( KErrNone ); |
385 TBuf<1> additionalInfo; |
386 TBuf<1> additionalInfo; |
386 |
387 |
387 RSat::TSetUpEventListRspV1Pckg* aRspPckg = |
388 RSat::TSetUpEventListRspV1Pckg* aRspPckg = |
400 && ( RSat::KCmdTypeNotUnderstood != rspV1.iGeneralResult ) |
401 && ( RSat::KCmdTypeNotUnderstood != rspV1.iGeneralResult ) |
401 && ( RSat::KCmdDataNotUnderstood != rspV1.iGeneralResult ) |
402 && ( RSat::KCmdDataNotUnderstood != rspV1.iGeneralResult ) |
402 && ( RSat::KCmdNumberNotKnown != rspV1.iGeneralResult ) |
403 && ( RSat::KCmdNumberNotKnown != rspV1.iGeneralResult ) |
403 && ( RSat::KErrorRequiredValuesMissing != rspV1.iGeneralResult ) ) |
404 && ( RSat::KErrorRequiredValuesMissing != rspV1.iGeneralResult ) ) |
404 { |
405 { |
405 TFLOGSTRING("CSAT:CSatNotifySetUpEventList::TerminalResponseL,\ |
406 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_TERMINALRESPONSEL_2, "CSAT:CSatNotifySetUpEventList::TerminalResponseL, Invalid General Result"); |
406 Invalid General Result"); |
|
407 // Invalid general result |
407 // Invalid general result |
408 ret = KErrCorrupt; |
408 ret = KErrCorrupt; |
409 } |
409 } |
410 |
410 |
411 if ((RSat::KMeUnableToProcessCmd == rspV1.iGeneralResult) && (RSat::KMeProblem != rspV1.iInfoType)) |
411 if ((RSat::KMeUnableToProcessCmd == rspV1.iGeneralResult) && (RSat::KMeProblem != rspV1.iInfoType)) |
412 { |
412 { |
413 // it's obligatory to provide additional info and KMeProblem flag for KMeUnableToProcessCmd error code |
413 // it's obligatory to provide additional info and KMeProblem flag for KMeUnableToProcessCmd error code |
414 TFLOGSTRING("CSAT:CSatNotifySetUpEventList::TerminalResponseL,\ |
414 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_TERMINALRESPONSEL_3, "CSAT:CSatNotifySetUpEventList::TerminalResponseL, KMeProblem flag is not specified"); |
415 KMeProblem flag is not specified"); |
|
416 ret = KErrCorrupt; |
415 ret = KErrCorrupt; |
417 } |
416 } |
418 |
417 |
419 // If there is Me (Mobile Entity) error, additional info is needed |
418 // If there is Me (Mobile Entity) error, additional info is needed |
420 if ( ( RSat::KMeProblem == rspV1.iInfoType ) ) |
419 if ( ( RSat::KMeProblem == rspV1.iInfoType ) ) |
424 { |
423 { |
425 additionalInfo.Append( ( TUint8 )rspV1.iAdditionalInfo[0] ); |
424 additionalInfo.Append( ( TUint8 )rspV1.iAdditionalInfo[0] ); |
426 } |
425 } |
427 else |
426 else |
428 { |
427 { |
429 TFLOGSTRING("CSAT:CSatNotifySetUpEventList::TerminalResponseL,\ |
428 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_TERMINALRESPONSEL_4, "CSAT:CSatNotifySetUpEventList::TerminalResponseL, Invalid Additional Info"); |
430 Invalid Additional Info"); |
|
431 // Invalid additional info field |
429 // Invalid additional info field |
432 ret = KErrCorrupt; |
430 ret = KErrCorrupt; |
433 } |
431 } |
434 } |
432 } |
435 |
433 |
460 TUint8 aPCmdNumber, |
458 TUint8 aPCmdNumber, |
461 TUint8 aGeneralResult, |
459 TUint8 aGeneralResult, |
462 TDesC16& aAdditionalInfo |
460 TDesC16& aAdditionalInfo |
463 ) |
461 ) |
464 { |
462 { |
465 TFLOGSTRING("CSAT: CSatNotifySetUpEventList::CreateTerminalRespL"); |
463 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSETUPEVENTLIST_CREATETERMINALRESPL_1, "CSAT: CSatNotifySetUpEventList::CreateTerminalRespL"); |
466 // Create and append response data |
464 // Create and append response data |
467 TTlv tlvSpecificData; |
465 TTlv tlvSpecificData; |
468 // Create General Result TLV here |
466 // Create General Result TLV here |
469 tlvSpecificData.AddTag( KTlvResultTag ); |
467 tlvSpecificData.AddTag( KTlvResultTag ); |
470 // General result |
468 // General result |