telephonyserverplugins/common_tsy/commontsy/src/mmcustomtsy/CMmWimTsy.cpp
branchRCL_3
changeset 66 07a122eea281
parent 65 630d2f34d719
equal deleted inserted replaced
65:630d2f34d719 66:07a122eea281
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-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".
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 
    17 
    18 //  INCLUDE FILES
    18 //  INCLUDE FILES
    19 
       
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "CMmWimTsyTraces.h"
       
    23 #endif
       
    24 
       
    25 #include "CMmWimTsy.h"
    19 #include "CMmWimTsy.h"
    26 #include <ctsy/rmmcustomapi.h>
    20 #include <ctsy/rmmcustomapi.h>
       
    21 #include <ctsy/tflogger.h>
    27 #include <ctsy/pluginapi/cmmdatapackage.h>
    22 #include <ctsy/pluginapi/cmmdatapackage.h>
    28 
    23 
    29 // ======== MEMBER FUNCTIONS ========
    24 // ======== MEMBER FUNCTIONS ========
    30 
    25 
    31 CMmWimTsy::CMmWimTsy()
    26 CMmWimTsy::CMmWimTsy()
   506 //
   501 //
   507 void CMmWimTsy::Complete(
   502 void CMmWimTsy::Complete(
   508     TInt aReqHandleType, 
   503     TInt aReqHandleType, 
   509     TInt aError )
   504     TInt aError )
   510     {
   505     {
   511 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETE_1,  "CustomTSY: CMmWimTsy::Complete.\n\t ReqHandleType:%d \n\t Error:%d\n", aReqHandleType, aError );
   506 TFLOGSTRING3( "CustomTSY: CMmWimTsy::Complete.\n\t ReqHandleType:%d \n\t Error:%d\n", aReqHandleType, aError );
   512     iMmCustomTsy->ReqCompleted( iTsyReqHandleStore->ResetTsyReqHandle( 
   507     iMmCustomTsy->ReqCompleted( iTsyReqHandleStore->ResetTsyReqHandle( 
   513         aReqHandleType ), aError );
   508         aReqHandleType ), aError );
   514     }
   509     }
   515 #endif // REQHANDLE_TIMER
   510 #endif // REQHANDLE_TIMER
   516 
   511 
   522 //  
   517 //  
   523 TInt CMmWimTsy::GetATRL(
   518 TInt CMmWimTsy::GetATRL(
   524     const TTsyReqHandle aTsyReqHandle, 
   519     const TTsyReqHandle aTsyReqHandle, 
   525     TDes8 *aATR )
   520     TDes8 *aATR )
   526     {
   521     {
   527 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_GETATRL_1,  "TSY: CMmWimTsy::GetATRL" );
   522 TFLOGSTRING( "TSY: CMmWimTsy::GetATRL" );
   528     
   523     
   529     TTsyReqHandle getAtrHandle = iTsyReqHandleStore->
   524     TTsyReqHandle getAtrHandle = iTsyReqHandleStore->
   530         GetTsyReqHandle( EWIMRequestTypeGetATR );
   525         GetTsyReqHandle( EWIMRequestTypeGetATR );
   531         
   526         
   532     if ( 0 < getAtrHandle )
   527     if ( 0 < getAtrHandle )
   533         {         
   528         {         
   534         // The request is already in processing because of previous request
   529         // The request is already in processing because of previous request
   535         // Complete request with status value informing the client about 
   530         // Complete request with status value informing the client about 
   536         // the situation.
   531         // the situation.
   537 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_GETATRL_2,  "TSY: CMmWimTsy::GetATRL - KErrServerBusy" );
   532 TFLOGSTRING( "TSY: CMmWimTsy::GetATRL - KErrServerBusy" );
   538         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   533         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   539         }
   534         }
   540     else
   535     else
   541         {        
   536         {        
   542         // save pointer to client for response data
   537         // save pointer to client for response data
   575 //      
   570 //      
   576 void CMmWimTsy::CompleteGetATR(
   571 void CMmWimTsy::CompleteGetATR(
   577     TPtrC8& aData, 
   572     TPtrC8& aData, 
   578     TInt aError )
   573     TInt aError )
   579     {
   574     {
   580 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETEGETATR_1,  "TSY: CMmWimTsy::CompleteGetATR ");
   575 TFLOGSTRING( "TSY: CMmWimTsy::CompleteGetATR ");
   581     // reset the reqhandle
   576     // reset the reqhandle
   582     TTsyReqHandle tsyReqHandle = 
   577     TTsyReqHandle tsyReqHandle = 
   583         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeGetATR );
   578         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeGetATR );
   584 
   579 
   585     // Check the reqHandle
   580     // Check the reqHandle
   609 // (other items were commented in a header).
   604 // (other items were commented in a header).
   610 // ---------------------------------------------------------------------------
   605 // ---------------------------------------------------------------------------
   611 //
   606 //
   612 TInt CMmWimTsy::GetATRCancel()
   607 TInt CMmWimTsy::GetATRCancel()
   613     {
   608     {
   614 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_GETATRCANCEL_1,  "CMmWimTsy::GetATRCancel" );
   609 TFLOGSTRING( "CMmWimTsy::GetATRCancel" );
   615     // reset the reqhandle
   610     // reset the reqhandle
   616     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   611     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   617         EWIMRequestTypeGetATR );
   612         EWIMRequestTypeGetATR );
   618     
   613     
   619     // reset pointer to client data
   614     // reset pointer to client data
   635 // ---------------------------------------------------------------------------
   630 // ---------------------------------------------------------------------------
   636 //   
   631 //   
   637 TInt CMmWimTsy::SimWarmResetL(
   632 TInt CMmWimTsy::SimWarmResetL(
   638     const TTsyReqHandle aTsyReqHandle )
   633     const TTsyReqHandle aTsyReqHandle )
   639     {
   634     {
   640 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_SIMWARMRESETL_1,  "CMmWimTsy::SimWarmResetL");
   635 TFLOGSTRING( "CMmWimTsy::SimWarmResetL"); 
   641     TTsyReqHandle simWarmResetHandle = 
   636     TTsyReqHandle simWarmResetHandle = 
   642         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypeSimWarmReset );
   637         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypeSimWarmReset );
   643         
   638         
   644     if ( 0 < simWarmResetHandle )
   639     if ( 0 < simWarmResetHandle )
   645         {         
   640         {         
   646         // The request is already in processing because of previous request
   641         // The request is already in processing because of previous request
   647         // Complete request with status value informing the client about 
   642         // Complete request with status value informing the client about 
   648         // the situation.
   643         // the situation.
   649 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_SIMWARMRESETL_2,  "TSY: CMmWimTsy::SimWarmResetL - KErrServerBusy" );
   644 TFLOGSTRING( "TSY: CMmWimTsy::SimWarmResetL - KErrServerBusy" );
   650         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   645         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   651         }
   646         }
   652     else
   647     else
   653         {
   648         {
   654         TInt ret = iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( 
   649         TInt ret = iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( 
   681 // ---------------------------------------------------------------------------
   676 // ---------------------------------------------------------------------------
   682 //   
   677 //   
   683 void CMmWimTsy::CompleteSimWarmReset(
   678 void CMmWimTsy::CompleteSimWarmReset(
   684     TInt aError )
   679     TInt aError )
   685     {
   680     {
   686 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETESIMWARMRESET_1,  "CMmWimTsy::CompleteSimWarmReset" );
   681 TFLOGSTRING( "CMmWimTsy::CompleteSimWarmReset" );
   687        
   682        
   688     // reset the reqhandle
   683     // reset the reqhandle
   689     TTsyReqHandle tsyReqHandle = 
   684     TTsyReqHandle tsyReqHandle = 
   690         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeSimWarmReset );
   685         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeSimWarmReset );
   691 
   686 
   702 // (other items were commented in a header).
   697 // (other items were commented in a header).
   703 // ---------------------------------------------------------------------------
   698 // ---------------------------------------------------------------------------
   704 //
   699 //
   705 TInt CMmWimTsy::SimWarmResetCancel()
   700 TInt CMmWimTsy::SimWarmResetCancel()
   706     {
   701     {
   707 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_SIMWARMRESETCANCEL_1,  "TSY: CMmWimTsy::SimWarmResetCancel" );
   702 TFLOGSTRING( "TSY: CMmWimTsy::SimWarmResetCancel" );
   708     // reset the reqhandle
   703     // reset the reqhandle
   709     TTsyReqHandle reqHandle =
   704     TTsyReqHandle reqHandle =
   710         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeSimWarmReset );
   705         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeSimWarmReset );
   711 
   706 
   712     if( EWIMTsyReqHandleUnknown != reqHandle )
   707     if( EWIMTsyReqHandleUnknown != reqHandle )
   726 //   
   721 //   
   727 TInt CMmWimTsy::GetSimCardReaderStatusL(
   722 TInt CMmWimTsy::GetSimCardReaderStatusL(
   728     const TTsyReqHandle aTsyReqHandle, 
   723     const TTsyReqHandle aTsyReqHandle, 
   729     RMmCustomAPI::TSimCardReaderStatus* aSimCardReaderStatus )
   724     RMmCustomAPI::TSimCardReaderStatus* aSimCardReaderStatus )
   730     {
   725     {
   731 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_GETSIMCARDREADERSTATUSL_1,  "TSY: CMmWimTsy::GetSimCardReaderStatusL" );
   726 TFLOGSTRING( "TSY: CMmWimTsy::GetSimCardReaderStatusL" ); 
   732     TTsyReqHandle getSimCardReaderStatusHandle = 
   727     TTsyReqHandle getSimCardReaderStatusHandle = 
   733         iTsyReqHandleStore->GetTsyReqHandle( 
   728         iTsyReqHandleStore->GetTsyReqHandle( 
   734         EWIMRequestTypeGetSimCardReaderStatus );
   729         EWIMRequestTypeGetSimCardReaderStatus );
   735         
   730         
   736     if ( 0 < getSimCardReaderStatusHandle )
   731     if ( 0 < getSimCardReaderStatusHandle )
   737         {         
   732         {         
   738         // The request is already in processing because of previous request
   733         // The request is already in processing because of previous request
   739         // Complete request with status value informing the client about 
   734         // Complete request with status value informing the client about 
   740         // the situation.
   735         // the situation.
   741 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_GETSIMCARDREADERSTATUSL_2,  "TSY: CMmWimTsy::GetSimCardReaderStatusL - KErrServerBusy" );
   736 TFLOGSTRING( "TSY: CMmWimTsy::GetSimCardReaderStatusL - KErrServerBusy" );
   742         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   737         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   743         }
   738         }
   744     else
   739     else
   745         {    
   740         {    
   746         // call DOS, packed parameter: aSimCardReaderStatus
   741         // call DOS, packed parameter: aSimCardReaderStatus
   779 //   
   774 //   
   780 void CMmWimTsy::CompleteGetSimCardReaderStatus(
   775 void CMmWimTsy::CompleteGetSimCardReaderStatus(
   781     TPtrC8& aData, 
   776     TPtrC8& aData, 
   782     TInt aError )
   777     TInt aError )
   783     {
   778     {
   784 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETEGETSIMCARDREADERSTATUS_1,  "CMmWimTsy::CompleteGetSimCardReaderStatus" );
   779 TFLOGSTRING( "CMmWimTsy::CompleteGetSimCardReaderStatus" );
   785     // reset the reqhandle
   780     // reset the reqhandle
   786     TTsyReqHandle tsyReqHandle = 
   781     TTsyReqHandle tsyReqHandle = 
   787         iTsyReqHandleStore->ResetTsyReqHandle( 
   782         iTsyReqHandleStore->ResetTsyReqHandle( 
   788         EWIMRequestTypeGetSimCardReaderStatus );
   783         EWIMRequestTypeGetSimCardReaderStatus );
   789     
   784     
   814 // (other items were commented in a header).
   809 // (other items were commented in a header).
   815 // ---------------------------------------------------------------------------
   810 // ---------------------------------------------------------------------------
   816 //
   811 //
   817 TInt CMmWimTsy::GetSimCardReaderStatusCancel()
   812 TInt CMmWimTsy::GetSimCardReaderStatusCancel()
   818     {
   813     {
   819 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_GETSIMCARDREADERSTATUSCANCEL_1,  "TSY: CMmWimTsy::GetSimCardReaderStatusCancel" );
   814 TFLOGSTRING( "TSY: CMmWimTsy::GetSimCardReaderStatusCancel" );
   820     // reset the reqhandle
   815     // reset the reqhandle
   821     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   816     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   822         EWIMRequestTypeGetSimCardReaderStatus );
   817         EWIMRequestTypeGetSimCardReaderStatus );
   823     
   818     
   824     // reset pointer to client data
   819     // reset pointer to client data
   841 // 
   836 // 
   842 TInt CMmWimTsy::NotifySimCardStatus(
   837 TInt CMmWimTsy::NotifySimCardStatus(
   843     const TTsyReqHandle aTsyReqHandle, 
   838     const TTsyReqHandle aTsyReqHandle, 
   844     RMmCustomAPI::TSIMCardStatus* aCardStatus )
   839     RMmCustomAPI::TSIMCardStatus* aCardStatus )
   845     {
   840     {
   846 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_NOTIFYSIMCARDSTATUS_1,  "TSY: CMmWimTsy::NotifySimCardStatus" );
   841 TFLOGSTRING( "TSY: CMmWimTsy::NotifySimCardStatus" );
   847     if ( NULL != aCardStatus )
   842     if ( NULL != aCardStatus )
   848         {
   843         {
   849         // save pointer to client for response data
   844         // save pointer to client for response data
   850         iNotifiedSimCardStatus = aCardStatus;
   845         iNotifiedSimCardStatus = aCardStatus;
   851         
   846         
   865 // ---------------------------------------------------------------------------
   860 // ---------------------------------------------------------------------------
   866 // 
   861 // 
   867 void CMmWimTsy::CompleteNotifySimCardStatus(
   862 void CMmWimTsy::CompleteNotifySimCardStatus(
   868     RMmCustomAPI::TSIMCardStatus aCardStatus )
   863     RMmCustomAPI::TSIMCardStatus aCardStatus )
   869     {
   864     {
   870 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETENOTIFYSIMCARDSTATUS_1,  "CMmWimTsy::CompleteNotifySimCardStatus" );
   865 TFLOGSTRING( "CMmWimTsy::CompleteNotifySimCardStatus" );
   871     // reset req handle. Returns the deleted req handle
   866     // reset req handle. Returns the deleted req handle
   872     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   867     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   873         EWIMRequestTypeNotifySimCardStatus );
   868         EWIMRequestTypeNotifySimCardStatus );
   874 
   869 
   875     // check the handle and complete
   870     // check the handle and complete
   891 // (other items were commented in a header).
   886 // (other items were commented in a header).
   892 // ---------------------------------------------------------------------------
   887 // ---------------------------------------------------------------------------
   893 //
   888 //
   894 TInt CMmWimTsy::NotifySimCardStatusCancel()
   889 TInt CMmWimTsy::NotifySimCardStatusCancel()
   895     {
   890     {
   896 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_NOTIFYSIMCARDSTATUSCANCEL_1,  "TSY: CMmWimTsy::NotifySimCardStatusCancel" );
   891 TFLOGSTRING( "TSY: CMmWimTsy::NotifySimCardStatusCancel" );
   897     // reset pointer to client data
   892     // reset pointer to client data
   898     iNotifiedSimCardStatus = NULL;
   893     iNotifiedSimCardStatus = NULL;
   899 
   894 
   900     // reset reqhandle
   895     // reset reqhandle
   901     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   896     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   918 //  
   913 //  
   919 TInt CMmWimTsy::SendAPDUReqV2L( 
   914 TInt CMmWimTsy::SendAPDUReqV2L( 
   920     const TTsyReqHandle aTsyReqHandle, 
   915     const TTsyReqHandle aTsyReqHandle, 
   921     RMmCustomAPI::TApduParameters* aApduParameters )
   916     RMmCustomAPI::TApduParameters* aApduParameters )
   922     {
   917     {
   923 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_SENDAPDUREQV2L_1,  "TSY: CMmWimTsy::SendAPDUReqV2L" );
   918 TFLOGSTRING( "TSY: CMmWimTsy::SendAPDUReqV2L" );
   924     TTsyReqHandle sendApduReqV2Handle = 
   919     TTsyReqHandle sendApduReqV2Handle = 
   925         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypeSendAPDUReqV2 );
   920         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypeSendAPDUReqV2 );
   926     TInt ret = KErrNone; 
   921     TInt ret = KErrNone; 
   927         
   922         
   928     if ( 0 < sendApduReqV2Handle )
   923     if ( 0 < sendApduReqV2Handle )
   929         {         
   924         {         
   930         // The request is already in processing because of previous request
   925         // The request is already in processing because of previous request
   931         // Complete request with status value informing the client about 
   926         // Complete request with status value informing the client about 
   932         // the situation.
   927         // the situation.
   933 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_SENDAPDUREQV2L_2,  "TSY: CMmWimTsy::SendAPDUReqV2L - KErrServerBusy" );
   928 TFLOGSTRING( "TSY: CMmWimTsy::SendAPDUReqV2L - KErrServerBusy" );
   934         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   929         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
   935         return ret; 
   930         return ret; 
   936         }
   931         }
   937     else
   932     else
   938         { 
   933         { 
   966 //      
   961 //      
   967 void CMmWimTsy::CompleteSendAPDUReqV2(
   962 void CMmWimTsy::CompleteSendAPDUReqV2(
   968     TPtrC8 &aData, 
   963     TPtrC8 &aData, 
   969     TInt aError )
   964     TInt aError )
   970     {
   965     {
   971 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETESENDAPDUREQV2_1,  "TSY: CMmWimTsy::CompleteSendAPDUReqV2" );
   966 TFLOGSTRING( "TSY: CMmWimTsy::CompleteSendAPDUReqV2" );
   972     // reset the reqhandle
   967     // reset the reqhandle
   973     TTsyReqHandle tsyReqHandle = 
   968     TTsyReqHandle tsyReqHandle = 
   974         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeSendAPDUReqV2 );
   969         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypeSendAPDUReqV2 );
   975         
   970         
   976     // check the handle and complete
   971     // check the handle and complete
  1000 // (other items were commented in a header).
   995 // (other items were commented in a header).
  1001 // ---------------------------------------------------------------------------
   996 // ---------------------------------------------------------------------------
  1002 //
   997 //
  1003 TInt CMmWimTsy::SendAPDUReqV2Cancel()
   998 TInt CMmWimTsy::SendAPDUReqV2Cancel()
  1004     {
   999     {
  1005 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_SENDAPDUREQV2CANCEL_1,  "TSY: CMmWimTsy::SendAPDUReqV2Cancel" );
  1000 TFLOGSTRING( "TSY: CMmWimTsy::SendAPDUReqV2Cancel" );
  1006     // reset the reqhandle
  1001     // reset the reqhandle
  1007     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1002     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1008         EWIMRequestTypeSendAPDUReqV2 );
  1003         EWIMRequestTypeSendAPDUReqV2 );
  1009     
  1004     
  1010     // reset return pointer
  1005     // reset return pointer
  1026 // ---------------------------------------------------------------------------
  1021 // ---------------------------------------------------------------------------
  1027 //   
  1022 //   
  1028 TInt CMmWimTsy::PowerSimOnL(
  1023 TInt CMmWimTsy::PowerSimOnL(
  1029     const TTsyReqHandle aTsyReqHandle )
  1024     const TTsyReqHandle aTsyReqHandle )
  1030     {
  1025     {
  1031 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_POWERSIMONL_1,  "TSY: CMmWimTsy::PowerSimOnL" );
  1026 TFLOGSTRING( "TSY: CMmWimTsy::PowerSimOnL" ); 
  1032     TTsyReqHandle powerSimOnHandle = 
  1027     TTsyReqHandle powerSimOnHandle = 
  1033         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypePowerSimOn );
  1028         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypePowerSimOn );
  1034         
  1029         
  1035     if ( 0 < powerSimOnHandle )
  1030     if ( 0 < powerSimOnHandle )
  1036         {         
  1031         {         
  1037         // The request is already in processing because of previous request
  1032         // The request is already in processing because of previous request
  1038         // Complete request with status value informing the client about 
  1033         // Complete request with status value informing the client about 
  1039         // the situation.
  1034         // the situation.
  1040 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_POWERSIMONL_2,  "TSY: CMmWimTsy::PowerSimOnL - KErrServerBusy" );
  1035 TFLOGSTRING( "TSY: CMmWimTsy::PowerSimOnL - KErrServerBusy" );
  1041         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1036         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1042         }
  1037         }
  1043     else
  1038     else
  1044         { 
  1039         { 
  1045         TInt ret = iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( 
  1040         TInt ret = iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( 
  1071 // ---------------------------------------------------------------------------
  1066 // ---------------------------------------------------------------------------
  1072 //   
  1067 //   
  1073 void CMmWimTsy::CompletePowerSimOn(
  1068 void CMmWimTsy::CompletePowerSimOn(
  1074     TInt aError )
  1069     TInt aError )
  1075     {
  1070     {
  1076 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETEPOWERSIMON_1,  "TSY: CMmWimTsy::CompletePowerSimOn" );
  1071 TFLOGSTRING( "TSY: CMmWimTsy::CompletePowerSimOn" );
  1077     // reset the reqhandle
  1072     // reset the reqhandle
  1078     TTsyReqHandle tsyReqHandle = 
  1073     TTsyReqHandle tsyReqHandle = 
  1079         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypePowerSimOn );
  1074         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypePowerSimOn );
  1080 
  1075 
  1081     if ( EWIMTsyReqHandleUnknown != tsyReqHandle )
  1076     if ( EWIMTsyReqHandleUnknown != tsyReqHandle )
  1091 // (other items were commented in a header).
  1086 // (other items were commented in a header).
  1092 // ---------------------------------------------------------------------------
  1087 // ---------------------------------------------------------------------------
  1093 //
  1088 //
  1094 TInt CMmWimTsy::PowerSimOnCancel()
  1089 TInt CMmWimTsy::PowerSimOnCancel()
  1095     {
  1090     {
  1096 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_POWERSIMONCANCEL_1,  "TSY: CMmWimTsy::PowerSimOnCancel" );
  1091 TFLOGSTRING( "TSY: CMmWimTsy::PowerSimOnCancel" );
  1097     // reset the reqhandle
  1092     // reset the reqhandle
  1098     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1093     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1099         EWIMRequestTypePowerSimOn );
  1094         EWIMRequestTypePowerSimOn );
  1100 
  1095 
  1101     if( EWIMTsyReqHandleUnknown != reqHandle )
  1096     if( EWIMTsyReqHandleUnknown != reqHandle )
  1114 // ---------------------------------------------------------------------------
  1109 // ---------------------------------------------------------------------------
  1115 //   
  1110 //   
  1116 TInt CMmWimTsy::PowerSimOffL(
  1111 TInt CMmWimTsy::PowerSimOffL(
  1117     const TTsyReqHandle aTsyReqHandle )
  1112     const TTsyReqHandle aTsyReqHandle )
  1118     {
  1113     {
  1119 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_POWERSIMOFFL_1,  "TSY: CMmWimTsy::PowerSimOffL" );
  1114 TFLOGSTRING( "TSY: CMmWimTsy::PowerSimOffL" ); 
  1120     TTsyReqHandle powerSimOffHandle = 
  1115     TTsyReqHandle powerSimOffHandle = 
  1121         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypePowerSimOff );
  1116         iTsyReqHandleStore->GetTsyReqHandle( EWIMRequestTypePowerSimOff );
  1122         
  1117         
  1123     if ( 0 < powerSimOffHandle )
  1118     if ( 0 < powerSimOffHandle )
  1124         {         
  1119         {         
  1125         // The request is already in processing because of previous request
  1120         // The request is already in processing because of previous request
  1126         // Complete request with status value informing the client about 
  1121         // Complete request with status value informing the client about 
  1127         // the situation.
  1122         // the situation.
  1128 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_POWERSIMOFFL_2,  "TSY: CMmWimTsy::PowerSimOffL - KErrServerBusy" );
  1123 TFLOGSTRING( "TSY: CMmWimTsy::PowerSimOffL - KErrServerBusy" );
  1129         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1124         iMmCustomTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
  1130         }
  1125         }
  1131     else
  1126     else
  1132         {
  1127         {
  1133         TInt ret = iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( 
  1128         TInt ret = iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( 
  1159 // ---------------------------------------------------------------------------
  1154 // ---------------------------------------------------------------------------
  1160 //   
  1155 //   
  1161 void CMmWimTsy::CompletePowerSimOff(
  1156 void CMmWimTsy::CompletePowerSimOff(
  1162     TInt aError )
  1157     TInt aError )
  1163     {
  1158     {
  1164 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_COMPLETEPOWERSIMOFF_1,  "TSY: CMmWimTsy::CompletePowerSimOff" );
  1159 TFLOGSTRING( "TSY: CMmWimTsy::CompletePowerSimOff" );
  1165     // reset the reqhandle
  1160     // reset the reqhandle
  1166     TTsyReqHandle tsyReqHandle = 
  1161     TTsyReqHandle tsyReqHandle = 
  1167         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypePowerSimOff );
  1162         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypePowerSimOff );
  1168 
  1163 
  1169     if ( EWIMTsyReqHandleUnknown != tsyReqHandle )
  1164     if ( EWIMTsyReqHandleUnknown != tsyReqHandle )
  1179 // (other items were commented in a header).
  1174 // (other items were commented in a header).
  1180 // ---------------------------------------------------------------------------
  1175 // ---------------------------------------------------------------------------
  1181 //
  1176 //
  1182 TInt CMmWimTsy::PowerSimOffCancel()
  1177 TInt CMmWimTsy::PowerSimOffCancel()
  1183     {
  1178     {
  1184 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMWIMTSY_POWERSIMOFFCANCEL_1,  "TSY: CMmWimTsy::PowerSimOffCancel" );
  1179 TFLOGSTRING( "TSY: CMmWimTsy::PowerSimOffCancel" );
  1185     // reset the reqhandle
  1180     // reset the reqhandle
  1186     TTsyReqHandle reqHandle =
  1181     TTsyReqHandle reqHandle =
  1187         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypePowerSimOff );
  1182         iTsyReqHandleStore->ResetTsyReqHandle( EWIMRequestTypePowerSimOff );
  1188 
  1183 
  1189     if( EWIMTsyReqHandleUnknown != reqHandle )
  1184     if( EWIMTsyReqHandleUnknown != reqHandle )