telephonyserverplugins/simatktsy/src/CSatNotifyRefresh.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-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 "CSatNotifyRefreshTraces.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 "CSatNotifyRefresh.h"  	// Class header
    31 #include "CSatNotifyRefresh.h"  	// Class header
    26 #include "CSatNotificationsTsy.h"   // Tsy class header
    32 #include "CSatNotificationsTsy.h"   // Tsy 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 //#include "CMmCustomTsy.h"           // Custom Tsy class
    39 //#include "CMmCustomTsy.h"           // Custom Tsy class
    35 #include "MSatTsy_IPCDefs.h"        // Sat Tsy internal request types
    40 #include "MSatTsy_IPCDefs.h"        // Sat Tsy internal request types
    43 CSatNotifyRefresh* CSatNotifyRefresh::NewL
    48 CSatNotifyRefresh* CSatNotifyRefresh::NewL
    44         ( 
    49         ( 
    45         CSatNotificationsTsy* aNotificationsTsy 
    50         CSatNotificationsTsy* aNotificationsTsy 
    46         )
    51         )
    47     {
    52     {
    48     TFLOGSTRING("CSAT: CSatNotifyRefresh::NewL");
    53     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_NEWL_1, "CSAT: CSatNotifyRefresh::NewL");
    49    	CSatNotifyRefresh* const satNotifyRefresh = 
    54    	CSatNotifyRefresh* const satNotifyRefresh = 
    50         new ( ELeave ) CSatNotifyRefresh( aNotificationsTsy );
    55         new ( ELeave ) CSatNotifyRefresh( aNotificationsTsy );
    51     CleanupStack::PushL( satNotifyRefresh );
    56     CleanupStack::PushL( satNotifyRefresh );
    52     satNotifyRefresh->ConstructL();
    57     satNotifyRefresh->ConstructL();
    53     CleanupStack::Pop( satNotifyRefresh );
    58     CleanupStack::Pop( satNotifyRefresh );
    54     TFLOGSTRING("CSAT: CSatNotifyRefresh::NewL, end of method");
    59     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_NEWL_2, "CSAT: CSatNotifyRefresh::NewL, end of method");
    55     return satNotifyRefresh;
    60     return satNotifyRefresh;
    56     }
    61     }
    57 
    62 
    58 // -----------------------------------------------------------------------------
    63 // -----------------------------------------------------------------------------
    59 // CSatNotifyRefresh::~CSatNotifyRefresh
    64 // CSatNotifyRefresh::~CSatNotifyRefresh
    63 CSatNotifyRefresh::~CSatNotifyRefresh
    68 CSatNotifyRefresh::~CSatNotifyRefresh
    64         ( 
    69         ( 
    65 		// None
    70 		// None
    66         )
    71         )
    67     {
    72     {
    68     TFLOGSTRING("CSAT: CSatNotifyRefresh::~CSatNotifyRefresh");
    73     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_DTOR_1, "CSAT: CSatNotifyRefresh::~CSatNotifyRefresh");
    69     }
    74     }
    70     
    75     
    71 // -----------------------------------------------------------------------------
    76 // -----------------------------------------------------------------------------
    72 // CSatNotifyRefresh::CSatNotifyRefresh
    77 // CSatNotifyRefresh::CSatNotifyRefresh
    73 // Default C++ constructor
    78 // Default C++ constructor
    89 void CSatNotifyRefresh::ConstructL
    94 void CSatNotifyRefresh::ConstructL
    90         (
    95         (
    91         // None
    96         // None
    92         )
    97         )
    93     {
    98     {
    94     TFLOGSTRING("CSAT: CSatNotifyRefresh::ConstructL");
    99     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_CONSTRUCTL_1, "CSAT: CSatNotifyRefresh::ConstructL");
    95     }
   100     }
    96 
   101 
    97 // -----------------------------------------------------------------------------
   102 // -----------------------------------------------------------------------------
    98 // CSatNotifyRefresh::Notify
   103 // CSatNotifyRefresh::Notify
    99 // This request allows a client to be notified of a REFRESH proactive command
   104 // This request allows a client to be notified of a REFRESH proactive command
   103         (
   108         (
   104         const TTsyReqHandle aTsyReqHandle,
   109         const TTsyReqHandle aTsyReqHandle,
   105         const TDataPackage& aPackage  
   110         const TDataPackage& aPackage  
   106         )
   111         )
   107     {
   112     {
   108     TFLOGSTRING("CSAT: CSatNotifyRefresh::Notify");
   113     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_NOTIFY_1, "CSAT: CSatNotifyRefresh::Notify");
   109 
   114 
   110     // Save data pointer to client side for completion
   115     // Save data pointer to client side for completion
   111     iRefreshV2Pckg = reinterpret_cast<RSat::TRefreshV2Pckg*>( 
   116     iRefreshV2Pckg = reinterpret_cast<RSat::TRefreshV2Pckg*>( 
   112         aPackage.Des1n() );
   117         aPackage.Des1n() );
   113     
   118     
   134         (
   139         (
   135         const TTsyReqHandle aTsyReqHandle,
   140         const TTsyReqHandle aTsyReqHandle,
   136         const TDataPackage& aPackage 
   141         const TDataPackage& aPackage 
   137         )
   142         )
   138     {
   143     {
   139     TFLOGSTRING("CSAT: CSatNotifyRefresh::NotifyRefreshRequired");
   144     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_NOTIFYREFRESHREQUIRED_1, "CSAT: CSatNotifyRefresh::NotifyRefreshRequired");
   140 
   145 
   141     // Save data pointer to client side for completion
   146     // Save data pointer to client side for completion
   142     iRefreshRequiredV2Pckg = reinterpret_cast<RSat::TRefreshV2Pckg*>( 
   147     iRefreshRequiredV2Pckg = reinterpret_cast<RSat::TRefreshV2Pckg*>( 
   143         aPackage.Des1n() );
   148         aPackage.Des1n() );
   144     
   149     
   164 TInt CSatNotifyRefresh::CancelNotification
   169 TInt CSatNotifyRefresh::CancelNotification
   165         (
   170         (
   166         const TTsyReqHandle aTsyReqHandle
   171         const TTsyReqHandle aTsyReqHandle
   167         )
   172         )
   168     {
   173     {
   169     TFLOGSTRING( "CSAT: CSatNotifyRefresh::CancelNotification" );
   174     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_CANCELNOTIFICATION_1,  "CSAT: CSatNotifyRefresh::CancelNotification" );
   170     
   175     
   171     // Reset the request handle
   176     // Reset the request handle
   172     iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( 
   177     iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( 
   173         CSatTsy::ESatNotifyRefreshPCmdReqType );
   178         CSatTsy::ESatNotifyRefreshPCmdReqType );
   174 
   179 
   189 TInt CSatNotifyRefresh::CancelRefreshRequiredNotification
   194 TInt CSatNotifyRefresh::CancelRefreshRequiredNotification
   190 		( 
   195 		( 
   191     	const TTsyReqHandle aTsyReqHandle
   196     	const TTsyReqHandle aTsyReqHandle
   192      	)
   197      	)
   193 	{
   198 	{
   194     TFLOGSTRING( "CSAT: CSatNotifyRefresh::CancelRefreshRequiredNotification" );
   199     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_CANCELREFRESHREQUIREDNOTIFICATION_1,  "CSAT: CSatNotifyRefresh::CancelRefreshRequiredNotification" );
   195         
   200         
   196     // Reset the request handle
   201     // Reset the request handle
   197     iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( 
   202     iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( 
   198         CSatTsy::ESatNotifyRefreshRequiredPCmdReqType );
   203         CSatTsy::ESatNotifyRefreshRequiredPCmdReqType );
   199 
   204 
   216         (
   221         (
   217         CSatDataPackage* aDataPackage,   
   222         CSatDataPackage* aDataPackage,   
   218         TInt aErrorCode                 
   223         TInt aErrorCode                 
   219         )
   224         )
   220     {
   225     {
   221     TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL");
   226     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_1, "CSAT: CSatNotifyRefresh::CompleteNotifyL");
   222 
   227 
   223     TInt ret( KErrNone );
   228     TInt ret( KErrNone );
   224 	TBuf<1> additionalInfo;	
   229 	TBuf<1> additionalInfo;	
   225     // Unpack parameters
   230     // Unpack parameters
   226     TPtrC8* data;
   231     TPtrC8* data;
   227     aDataPackage->UnPackData( &data );
   232     aDataPackage->UnPackData( &data );
   228     TFLOGSTRING2("CSAT: CSatNotifyRefresh::CompleteNotifyL, dataLength: %d", 
   233     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_2, "CSAT: CSatNotifyRefresh::CompleteNotifyL, dataLength: %d", data->Length());
   229         data->Length());
       
   230     // Reset req handle. Returns the deleted req handle
   234     // Reset req handle. Returns the deleted req handle
   231     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   235     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   232         TsyReqHandle( CSatTsy::ESatNotifyRefreshPCmdReqType );
   236         TsyReqHandle( CSatTsy::ESatNotifyRefreshPCmdReqType );
   233     TTsyReqHandle reqHandleRefreshRequired = iNotificationsTsy->
   237     TTsyReqHandle reqHandleRefreshRequired = iNotificationsTsy->
   234     	iSatReqHandleStore->ResetTsyReqHandle( 
   238     	iSatReqHandleStore->ResetTsyReqHandle( 
   321 	                }
   325 	                }
   322 	            }
   326 	            }
   323 	        else if ( KFileChangeNotification == iNotificationsTsy->
   327 	        else if ( KFileChangeNotification == iNotificationsTsy->
   324 	        	iTerminalRespData.iCommandDetails[KCommandQualifier] )
   328 	        	iTerminalRespData.iCommandDetails[KCommandQualifier] )
   325 	            {
   329 	            {
   326 	            TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL,\
   330 	            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_3, "CSAT: CSatNotifyRefresh::CompleteNotifyL, File list missing");
   327 	                File list missing");
       
   328 	            // File list object is missing, return terminal resp immediately.
   331 	            // File list object is missing, return terminal resp immediately.
   329 	            ret = KErrCorrupt;
   332 	            ret = KErrCorrupt;
   330 	            additionalInfo.Zero();
   333 	            additionalInfo.Zero();
   331 	            additionalInfo.Append( RSat::KNoSpecificMeProblem ); 
   334 	            additionalInfo.Append( RSat::KNoSpecificMeProblem ); 
   332 	            CreateTerminalRespL( pCmdNumber, 
   335 	            CreateTerminalRespL( pCmdNumber, 
   338 	            switch ( iNotificationsTsy->iTerminalRespData.
   341 	            switch ( iNotificationsTsy->iTerminalRespData.
   339 	            		iCommandDetails[KCommandQualifier] )
   342 	            		iCommandDetails[KCommandQualifier] )
   340 	                {
   343 	                {
   341 	                case KSimInitFullFileChangeNotification:
   344 	                case KSimInitFullFileChangeNotification:
   342 	                    {
   345 	                    {
   343 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::\
   346 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_4, "CSAT: CSatNotifyRefresh::CompleteNotifyL, Refresh mode: Sim init and full file change notification");
   344 	                    	CompleteNotifyL, Refresh mode: Sim init \
       
   345 	                    	and full file change notification");
       
   346 	                    refreshV2.iType = 
   347 	                    refreshV2.iType = 
   347 	                        RSat::ESimInitFullFileChangeNotification;
   348 	                        RSat::ESimInitFullFileChangeNotification;
   348 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST + 
   349 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST + 
   349 	                    	CSatNotificationsTsy::ECacheEFCBMID;
   350 	                    	CSatNotificationsTsy::ECacheEFCBMID;
   350 	                    break;
   351 	                    break;
   351 	                    }
   352 	                    }
   352 	                case KFileChangeNotification:
   353 	                case KFileChangeNotification:
   353 	                    {
   354 	                    {
   354 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL\
   355 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_5, "CSAT: CSatNotifyRefresh::CompleteNotifyL Refresh mode: File Change Notification");
   355 	                    	Refresh mode: File Change Notification");
   356 	                    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_6, "CSAT: CSatNotifyRefresh::CompleteNotifyL Number of files: %d", refreshV2.iFileList.Length() );
   356 	                    TFLOGSTRING2("CSAT: CSatNotifyRefresh::CompleteNotifyL\
       
   357 	                    	Number of files: %d", 
       
   358 	                    	refreshV2.iFileList.Length() );
       
   359 	                    refreshV2.iType = RSat::EFileChangeNotification;
   357 	                    refreshV2.iType = RSat::EFileChangeNotification;
   360 	                    
   358 	                    
   361 	                    if ( ( KErrNotFound != refreshV2.iFileList.Locate( 
   359 	                    if ( ( KErrNotFound != refreshV2.iFileList.Locate( 
   362 	                         RSat::KImsiEf ) ) && 
   360 	                         RSat::KImsiEf ) ) && 
   363 	                         ( !fileListTlv.GetComprehensionRequired() ) )
   361 	                         ( !fileListTlv.GetComprehensionRequired() ) )
   376 	                        }
   374 	                        }
   377 	                    break;
   375 	                    break;
   378 	                    }
   376 	                    }
   379 	                case KSimInitFileChangeNotification:
   377 	                case KSimInitFileChangeNotification:
   380 	                    {
   378 	                    {
   381 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL,\
   379 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_7, "CSAT: CSatNotifyRefresh::CompleteNotifyL, Refresh mode: Sim init and file change notification");
   382 	                    	Refresh mode: Sim init and file \
   380 	                    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_8, "CSAT: CSatNotifyRefresh::CompleteNotifyL Number of files: %d", refreshV2.iFileList.Length() );
   383 	                    	change notification");
       
   384 	                    TFLOGSTRING2("CSAT: CSatNotifyRefresh::CompleteNotifyL\
       
   385 	                    	Number of files: %d", 
       
   386 	                    	refreshV2.iFileList.Length() );
       
   387 	                    refreshV2.iType = RSat::ESimInitFileChangeNotification;
   381 	                    refreshV2.iType = RSat::ESimInitFileChangeNotification;
   388 	                    break;
   382 	                    break;
   389 	                    }
   383 	                    }
   390 	                case KSimInit:
   384 	                case KSimInit:
   391 	                    {
   385 	                    {
   392 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL\
   386 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_9, "CSAT: CSatNotifyRefresh::CompleteNotifyL Refresh mode: Sim init ");
   393 	                    	Refresh mode: Sim init ");
       
   394 	                    refreshV2.iType = RSat::ESimInit;
   387 	                    refreshV2.iType = RSat::ESimInit;
   395 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST 
   388 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST 
   396 	                    	+ CSatNotificationsTsy::ECacheEFCBMID;
   389 	                    	+ CSatNotificationsTsy::ECacheEFCBMID;
   397 	                    // Used in case of SimInit refresh + Imsi change
   390 	                    // Used in case of SimInit refresh + Imsi change
   398                         iImsiState = ERefreshSimInitReceived;
   391                         iImsiState = ERefreshSimInitReceived;
   399 	                    break;
   392 	                    break;
   400 	                    }
   393 	                    }
   401 	                case KSimReset:
   394 	                case KSimReset:
   402 	                    {
   395 	                    {
   403 	                    refreshV2.iType = RSat::ESimReset;
   396 	                    refreshV2.iType = RSat::ESimReset;
   404 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL\
   397 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_10, "CSAT: CSatNotifyRefresh::CompleteNotifyL Refresh mode: Reset");
   405 	                    	Refresh mode: Reset");
       
   406 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST + 
   398 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST + 
   407 	                    	CSatNotificationsTsy::ECacheEFCBMID;
   399 	                    	CSatNotificationsTsy::ECacheEFCBMID;
   408 	                    break;
   400 	                    break;
   409 	                    }
   401 	                    }
   410 	                case KUSIMApplicationReset:
   402 	                case KUSIMApplicationReset:
   411 	                    {
   403 	                    {
   412 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL\
   404 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_11, "CSAT: CSatNotifyRefresh::CompleteNotifyL Refresh mode: USIM Application Reset");
   413 	                    	Refresh mode: USIM Application Reset");
       
   414 	                    refreshV2.iType = RSat::EUsimApplicationReset;
   405 	                    refreshV2.iType = RSat::EUsimApplicationReset;
   415 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST + 
   406 	                    iInternalCache = CSatNotificationsTsy::ECacheEFSST + 
   416 	                    	CSatNotificationsTsy::ECacheEFCBMID;
   407 	                    	CSatNotificationsTsy::ECacheEFCBMID;
   417 	                    break;
   408 	                    break;
   418 	                    }
   409 	                    }
   419 	                case K3GSessionReset:
   410 	                case K3GSessionReset:
   420 	                    {
   411 	                    {
   421 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL\
   412 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_12, "CSAT: CSatNotifyRefresh::CompleteNotifyL Refresh mode: 3G Session Reset");
   422 	                    	Refresh mode: 3G Session Reset");
       
   423 	                    refreshV2.iType = RSat::E3GSessionReset;
   413 	                    refreshV2.iType = RSat::E3GSessionReset;
   424 	                    break;
   414 	                    break;
   425 	                    }
   415 	                    }
   426 	                default:
   416 	                default:
   427 	                    {
   417 	                    {
   428 	                    TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL\
   418 	                    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_13, "CSAT: CSatNotifyRefresh::CompleteNotifyL Refresh type not set!");
   429 	                    	Refresh type not set!");
       
   430 	                    // This migth be an error case
   419 	                    // This migth be an error case
   431 	                    refreshV2.iType = RSat::ERefreshTypeNotSet;
   420 	                    refreshV2.iType = RSat::ERefreshTypeNotSet;
   432 	                    break;
   421 	                    break;
   433 	                    }
   422 	                    }
   434 	                }
   423 	                }
   459 	        
   448 	        
   460         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandleRefreshRequired, ret );
   449         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandleRefreshRequired, ret );
   461         }
   450         }
   462     else
   451     else
   463     	{        
   452     	{        
   464     	TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteNotifyL,\
   453     	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETENOTIFYL_14, "CSAT: CSatNotifyRefresh::CompleteNotifyL, One or more of the requests not ongoing");
   465     	    One or more of the requests not ongoing");
       
   466         // Some of the request were not on, returning response immediately
   454         // Some of the request were not on, returning response immediately
   467         additionalInfo.Zero();
   455         additionalInfo.Zero();
   468         additionalInfo.Append( RSat::KNoSpecificMeProblem );
   456         additionalInfo.Append( RSat::KNoSpecificMeProblem );
   469         CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd,
   457         CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd,
   470             additionalInfo );
   458             additionalInfo );
   484 TInt CSatNotifyRefresh::TerminalResponseL
   472 TInt CSatNotifyRefresh::TerminalResponseL
   485         ( 
   473         ( 
   486         TDes8* aRsp
   474         TDes8* aRsp
   487         )
   475         )
   488     {
   476     {
   489     TFLOGSTRING("CSAT: CSatNotifyRefresh::TerminalResponseL");
   477     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_TERMINALRESPONSEL_1, "CSAT: CSatNotifyRefresh::TerminalResponseL");
   490 
   478 
   491     RSat::TRefreshRspV1Pckg* aRspPckg = 
   479     RSat::TRefreshRspV1Pckg* aRspPckg = 
   492             reinterpret_cast<RSat::TRefreshRspV1Pckg*>( aRsp );
   480             reinterpret_cast<RSat::TRefreshRspV1Pckg*>( aRsp );
   493     RSat::TRefreshRspV1& rspV1 = ( *aRspPckg ) ();
   481     RSat::TRefreshRspV1& rspV1 = ( *aRspPckg ) ();
   494     TBuf<1> additionalInfo;
   482     TBuf<1> additionalInfo;
   506     if ( ( ( KSimReset != iNotificationsTsy->iTerminalRespData.
   494     if ( ( ( KSimReset != iNotificationsTsy->iTerminalRespData.
   507     		iCommandDetails[KCommandQualifier] ) || 
   495     		iCommandDetails[KCommandQualifier] ) || 
   508     		( RSat::KSuccess != rspV1.iGeneralResult ) ) && 
   496     		( RSat::KSuccess != rspV1.iGeneralResult ) ) && 
   509     		( EImsiNotEqual != iImsiState ) )
   497     		( EImsiNotEqual != iImsiState ) )
   510         {
   498         {
   511         TFLOGSTRING("CSAT: CSatNotifyRefresh::TerminalResponseL, \
   499         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_TERMINALRESPONSEL_2, "CSAT: CSatNotifyRefresh::TerminalResponseL, S60 has done the Refresh" );
   512         	S60 has done the Refresh" );
       
   513         // Send terminal response
   500         // Send terminal response
   514         CreateTerminalRespL( pCmdNumber, (TUint8) rspV1.iGeneralResult, 
   501         CreateTerminalRespL( pCmdNumber, (TUint8) rspV1.iGeneralResult, 
   515         	additionalInfo );
   502         	additionalInfo );
   516         // Case was not SimInit refresh + Imsi change, set back to default 
   503         // Case was not SimInit refresh + Imsi change, set back to default 
   517         iImsiState = ENotSet;
   504         iImsiState = ENotSet;
   537 void CSatNotifyRefresh::CompleteImsiChange 
   524 void CSatNotifyRefresh::CompleteImsiChange 
   538 		(
   525 		(
   539         // None
   526         // None
   540     	)
   527     	)
   541     {
   528     {
   542     TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteImsiChange");
   529     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETEIMSICHANGE_1, "CSAT: CSatNotifyRefresh::CompleteImsiChange");
   543     if ( ERefreshSimInitReceived == iImsiState )
   530     if ( ERefreshSimInitReceived == iImsiState )
   544         {
   531         {
   545         TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteImsiChange, \
   532         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETEIMSICHANGE_2, "CSAT: CSatNotifyRefresh::CompleteImsiChange, IMSI not equal");
   546             IMSI not equal");
       
   547         iImsiState = EImsiNotEqual;
   533         iImsiState = EImsiNotEqual;
   548         }        
   534         }        
   549     }    
   535     }    
   550    
   536    
   551 // -----------------------------------------------------------------------------
   537 // -----------------------------------------------------------------------------
   559         TUint8 aPCmdNumber,         
   545         TUint8 aPCmdNumber,         
   560         TUint8 aGeneralResult,      
   546         TUint8 aGeneralResult,      
   561         TDesC16& aAdditionalInfo		   
   547         TDesC16& aAdditionalInfo		   
   562 		)
   548 		)
   563     {
   549     {
   564 	TFLOGSTRING("CSAT: CSatNotifyRefresh::CreateTerminalRespL");
   550 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_CREATETERMINALRESPL_1, "CSAT: CSatNotifyRefresh::CreateTerminalRespL");
   565     // Create and append response data
   551     // Create and append response data
   566     TTlv tlvSpecificData;
   552     TTlv tlvSpecificData;
   567     // append result tag
   553     // append result tag
   568     tlvSpecificData.AddTag( KTlvResultTag );
   554     tlvSpecificData.AddTag( KTlvResultTag );
   569 
   555 
   599 TInt CSatNotifyRefresh::RefreshAllowedL
   585 TInt CSatNotifyRefresh::RefreshAllowedL
   600 		(
   586 		(
   601 		const TDataPackage& aPackage
   587 		const TDataPackage& aPackage
   602     	)
   588     	)
   603     {
   589     {
   604     TFLOGSTRING("CSAT: CSatNotifyRefresh::RefreshAllowed ");       
   590     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_REFRESHALLOWEDL_1, "CSAT: CSatNotifyRefresh::RefreshAllowed ");
   605     RSat::TRefreshRspV1Pckg* aRspPckg = 
   591     RSat::TRefreshRspV1Pckg* aRspPckg = 
   606             reinterpret_cast<RSat::TRefreshRspV1Pckg*>( aPackage.Des1n() );
   592             reinterpret_cast<RSat::TRefreshRspV1Pckg*>( aPackage.Des1n() );
   607     RSat::TRefreshRspV1& rspV1 = ( *aRspPckg ) ();
   593     RSat::TRefreshRspV1& rspV1 = ( *aRspPckg ) ();
   608     TUint8 pCmdNumber( rspV1.PCmdNumber() );
   594     TUint8 pCmdNumber( rspV1.PCmdNumber() );
   609     CSatNotificationsTsy::TRefreshInfo refreshInfo;
   595     CSatNotificationsTsy::TRefreshInfo refreshInfo;
   623 			ESatTsyServiceRequest, &dataPackage );			                              
   609 			ESatTsyServiceRequest, &dataPackage );			                              
   624         }
   610         }
   625     else
   611     else
   626         {
   612         {
   627         // Refresh not allowed by the client
   613         // Refresh not allowed by the client
   628         TFLOGSTRING("CSAT: CSatNotifyRefresh::RefreshAllowed, refresh was not \
   614         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_REFRESHALLOWEDL_2, "CSAT: CSatNotifyRefresh::RefreshAllowed, refresh was not allowed by the client");
   629             allowed by the client");
       
   630 		TBuf<RSat::KAdditionalInfoMaxSize> additionalInfo;
   615 		TBuf<RSat::KAdditionalInfoMaxSize> additionalInfo;
   631 		additionalInfo.Append(RSat::KNoSpecificMeProblem);
   616 		additionalInfo.Append(RSat::KNoSpecificMeProblem);
   632         if ( RSat::KNoAdditionalInfo != rspV1.iInfoType )
   617         if ( RSat::KNoAdditionalInfo != rspV1.iInfoType )
   633             {
   618             {
   634             additionalInfo.Zero();
   619             additionalInfo.Zero();
   652         (
   637         (
   653         CSatDataPackage* aDataPackage,   
   638         CSatDataPackage* aDataPackage,   
   654         TInt /*aErrorCode*/              
   639         TInt /*aErrorCode*/              
   655         )
   640         )
   656     {
   641     {
   657     TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteTerminalRespDataL");
   642     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETETERMINALRESPDATAL_1, "CSAT: CSatNotifyRefresh::CompleteTerminalRespDataL");
   658     TInt ret( KErrNone );
   643     TInt ret( KErrNone );
   659     CSatNotificationsTsy::TTerminalRespData* terminalRespData;
   644     CSatNotificationsTsy::TTerminalRespData* terminalRespData;
   660     // Send terminal response
   645     // Send terminal response
   661     aDataPackage->UnPackData( &terminalRespData );
   646     aDataPackage->UnPackData( &terminalRespData );
   662     CreateTerminalRespL( iNotificationsTsy->iTerminalRespData.iPCmdNumber,
   647     CreateTerminalRespL( iNotificationsTsy->iTerminalRespData.iPCmdNumber,
   679     {
   664     {
   680     // Reset req handle. Returns the deleted req handle
   665     // Reset req handle. Returns the deleted req handle
   681     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   666     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   682         ResetTsyReqHandle( CSatTsy::ESatNotifyRefreshPCmdReqType );
   667         ResetTsyReqHandle( CSatTsy::ESatNotifyRefreshPCmdReqType );
   683 		
   668 		
   684     TFLOGSTRING3("CSAT: CSatNotifyRefresh::CompleteRequest.\
   669     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETEREQUEST_1, "CSAT: CSatNotifyRefresh::CompleteRequest.\n\t\t\t Handle:%d\n\t\t\t Error:%d", reqHandle, aErrorCode);
   685     	 \n\t\t\t Handle:%d\n\t\t\t Error:%d", reqHandle, aErrorCode);
       
   686     	 		
   670     	 		
   687     iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, aErrorCode);
   671     iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, aErrorCode);
   688 
   672 
   689     TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteRequest. Request is \
   673     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETEREQUEST_2, "CSAT: CSatNotifyRefresh::CompleteRequest. Request is now completed");
   690     	now completed");    
       
   691     }     
   674     }     
   692 #else //USING_CTSY_DISPATCHER
   675 #else //USING_CTSY_DISPATCHER
   693 void CSatNotifyRefresh::CompleteRequest
   676 void CSatNotifyRefresh::CompleteRequest
   694 		(
   677 		(
   695         CSatDataPackage* aDataPackage,  
   678         CSatDataPackage* aDataPackage,  
   700     aDataPackage->UnPackData( retValue );
   683     aDataPackage->UnPackData( retValue );
   701     // Reset req handle. Returns the deleted req handle
   684     // Reset req handle. Returns the deleted req handle
   702     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   685     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   703         ResetTsyReqHandle( CSatTsy::ESatNotifyRefreshPCmdReqType );
   686         ResetTsyReqHandle( CSatTsy::ESatNotifyRefreshPCmdReqType );
   704 
   687 
   705     TFLOGSTRING3("CSAT: CSatNotifyRefresh::CompleteRequest.\
   688     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETEREQUEST1_1, "CSAT: CSatNotifyRefresh::CompleteRequest. \n\t\t\t Handle:%d\n\t\t\t Error:%d", reqHandle, retValue);
   706     	 \n\t\t\t Handle:%d\n\t\t\t Error:%d", reqHandle, retValue);
       
   707     	 		   
   689     	 		   
   708     if(CSatTsy::ESatReqHandleUnknown != reqHandle) 
   690     if(CSatTsy::ESatReqHandleUnknown != reqHandle) 
   709     	{
   691     	{
   710         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, retValue );
   692         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, retValue );
   711 
   693 
   712         TFLOGSTRING("CSAT: CSatNotifyRefresh::CompleteRequest. Request is \
   694         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYREFRESH_COMPLETEREQUEST1_2, "CSAT: CSatNotifyRefresh::CompleteRequest. Request is now completed");
   713         	now completed");
       
   714     	} 
   695     	} 
   715     
   696     
   716     }
   697     }
   717 #endif //USING_CTSY_DISPATCHER
   698 #endif //USING_CTSY_DISPATCHER
   718 
   699