1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2005-2009 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 "CSatNotifySimSessionEndTraces.h" |
|
27 #endif |
|
28 |
|
29 #include "CSatTsy.h" // Main tsy class header |
23 #include "CSatTsy.h" // Main tsy class header |
30 #include "CSatNotifySimSessionEnd.h" // Class header |
24 #include "CSatNotifySimSessionEnd.h" // Class header |
31 #include "CSatNotificationsTsy.h" // Tsy class header |
25 #include "CSatNotificationsTsy.h" // Tsy class header |
32 #include "CSatDataPackage.h" // Parameter packing |
26 #include "CSatDataPackage.h" // Parameter packing |
|
27 #include "TfLogger.h" // For TFLOGSTRING |
33 #include "CSatTsyReqHandleStore.h" // Request handle class |
28 #include "CSatTsyReqHandleStore.h" // Request handle class |
34 #include "CBerTlv.h" // Ber Tlv data handling |
29 #include "CBerTlv.h" // Ber Tlv data handling |
35 #include "TSatUtility.h" // (U)SIM Status constants |
30 #include "TSatUtility.h" // (U)SIM Status constants |
36 |
31 |
37 // ----------------------------------------------------------------------------- |
32 // ----------------------------------------------------------------------------- |
42 CSatNotifySimSessionEnd* CSatNotifySimSessionEnd::NewL |
37 CSatNotifySimSessionEnd* CSatNotifySimSessionEnd::NewL |
43 ( |
38 ( |
44 CSatNotificationsTsy* aNotificationsTsy |
39 CSatNotificationsTsy* aNotificationsTsy |
45 ) |
40 ) |
46 { |
41 { |
47 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_NEWL_1, "CSAT: CSatNotifySimSessionEnd::NewL"); |
42 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::NewL"); |
48 CSatNotifySimSessionEnd* const satNotifySimSessionEnd = |
43 CSatNotifySimSessionEnd* const satNotifySimSessionEnd = |
49 new ( ELeave ) CSatNotifySimSessionEnd( aNotificationsTsy ); |
44 new ( ELeave ) CSatNotifySimSessionEnd( aNotificationsTsy ); |
50 CleanupStack::PushL( satNotifySimSessionEnd ); |
45 CleanupStack::PushL( satNotifySimSessionEnd ); |
51 satNotifySimSessionEnd->ConstructL(); |
46 satNotifySimSessionEnd->ConstructL(); |
52 CleanupStack::Pop( satNotifySimSessionEnd ); |
47 CleanupStack::Pop( satNotifySimSessionEnd ); |
53 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_NEWL_2, "CSAT: CSatNotifySimSessionEnd::NewL, end of method"); |
48 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::NewL, end of method"); |
54 return satNotifySimSessionEnd; |
49 return satNotifySimSessionEnd; |
55 } |
50 } |
56 |
51 |
57 // ----------------------------------------------------------------------------- |
52 // ----------------------------------------------------------------------------- |
58 // CSatNotifySimSessionEnd::~CSatNotifySimSessionEnd |
53 // CSatNotifySimSessionEnd::~CSatNotifySimSessionEnd |
62 CSatNotifySimSessionEnd::~CSatNotifySimSessionEnd |
57 CSatNotifySimSessionEnd::~CSatNotifySimSessionEnd |
63 ( |
58 ( |
64 // None |
59 // None |
65 ) |
60 ) |
66 { |
61 { |
67 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_DTOR_1, "CSAT: CSatNotifySimSessionEnd::~CSatNotifySimSessionEnd"); |
62 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::~CSatNotifySimSessionEnd"); |
68 } |
63 } |
69 |
64 |
70 // ----------------------------------------------------------------------------- |
65 // ----------------------------------------------------------------------------- |
71 // CSatNotifySimSessionEnd::CSatNotifySimSessionEnd |
66 // CSatNotifySimSessionEnd::CSatNotifySimSessionEnd |
72 // Default C++ constructor |
67 // Default C++ constructor |
88 void CSatNotifySimSessionEnd::ConstructL |
83 void CSatNotifySimSessionEnd::ConstructL |
89 ( |
84 ( |
90 // None |
85 // None |
91 ) |
86 ) |
92 { |
87 { |
93 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_CONSTRUCTL_1, "CSAT: CSatNotifySimSessionEnd::ConstructL, does nothing"); |
88 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::ConstructL, does nothing"); |
94 } |
89 } |
95 |
90 |
96 // ----------------------------------------------------------------------------- |
91 // ----------------------------------------------------------------------------- |
97 // CSatNotifySimSessionEnd::Notify |
92 // CSatNotifySimSessionEnd::Notify |
98 // Save the request handle type for notification requested by ETel server |
93 // Save the request handle type for notification requested by ETel server |
102 ( |
97 ( |
103 const TTsyReqHandle aTsyReqHandle, |
98 const TTsyReqHandle aTsyReqHandle, |
104 const TDataPackage& /*aPackage*/ |
99 const TDataPackage& /*aPackage*/ |
105 ) |
100 ) |
106 { |
101 { |
107 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_NOTIFY_1, "CSAT: CSatNotifySimSessionEnd::Notify"); |
102 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::Notify"); |
108 // Save the request handle |
103 // Save the request handle |
109 iNotificationsTsy->iSatTsy->SaveReqHandle( aTsyReqHandle, |
104 iNotificationsTsy->iSatTsy->SaveReqHandle( aTsyReqHandle, |
110 CSatTsy::ESatNotifyProactiveSimSessionEndReqType ); |
105 CSatTsy::ESatNotifyProactiveSimSessionEndReqType ); |
111 // Check if requested notification is already pending |
106 // Check if requested notification is already pending |
112 iNotificationsTsy->NotifySatReadyForNotification( |
107 iNotificationsTsy->NotifySatReadyForNotification( |
124 TInt CSatNotifySimSessionEnd::CancelNotification |
119 TInt CSatNotifySimSessionEnd::CancelNotification |
125 ( |
120 ( |
126 const TTsyReqHandle aTsyReqHandle |
121 const TTsyReqHandle aTsyReqHandle |
127 ) |
122 ) |
128 { |
123 { |
129 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_CANCELNOTIFICATION_1, "CSAT: CSatNotifySimSessionEnd::CancelNotification"); |
124 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::CancelNotification"); |
130 |
125 |
131 // Reset the request handle |
126 // Reset the request handle |
132 TTsyReqHandle reqHandle = |
127 TTsyReqHandle reqHandle = |
133 iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( |
128 iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( |
134 CSatTsy::ESatNotifyProactiveSimSessionEndReqType ); |
129 CSatTsy::ESatNotifyProactiveSimSessionEndReqType ); |
146 ( |
141 ( |
147 CSatDataPackage* aDataPackage, |
142 CSatDataPackage* aDataPackage, |
148 TInt aErrorCode |
143 TInt aErrorCode |
149 ) |
144 ) |
150 { |
145 { |
151 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_COMPLETENOTIFYL_1, "CSAT: CSatNotifySimSessionEnd::CompleteNotifyL"); |
146 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::CompleteNotifyL"); |
152 |
147 |
153 // Unpack data |
148 // Unpack data |
154 TUint8 sw1; |
149 TUint8 sw1; |
155 TUint8 sw2; |
150 TUint8 sw2; |
156 aDataPackage->UnPackData( sw1, sw2 ); |
151 aDataPackage->UnPackData( sw1, sw2 ); |
162 CSatTsy::ESatNotifyProactiveSimSessionEndReqType ); |
157 CSatTsy::ESatNotifyProactiveSimSessionEndReqType ); |
163 |
158 |
164 // In case the request was ongoing, complete the request to the client. |
159 // In case the request was ongoing, complete the request to the client. |
165 if ( CSatTsy::ESatReqHandleUnknown != reqHandle ) |
160 if ( CSatTsy::ESatReqHandleUnknown != reqHandle ) |
166 { |
161 { |
167 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYSIMSESSIONEND_COMPLETENOTIFYL_2, "CSAT: CSatNotifySimSessionEnd::CompleteNotifyL, SIM SESSION END"); |
162 TFLOGSTRING("CSAT: CSatNotifySimSessionEnd::CompleteNotifyL, \ |
|
163 SIM SESSION END"); |
168 iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, aErrorCode ); |
164 iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, aErrorCode ); |
169 } |
165 } |
170 } |
166 } |
171 |
167 |
172 return KErrNone; |
168 return KErrNone; |