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