telephonyserverplugins/simatktsy/src/CSatNotifyLanguageNotification.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     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 "CSatNotifyLanguageNotificationTraces.h"
       
    27 #endif
       
    28 
       
    29 #include <satcs.h>                  		// Etel SAT IPC definitions
    23 #include <satcs.h>                  		// Etel SAT IPC definitions
    30 #include "CSatTsy.h"                		// Tsy class header
    24 #include "CSatTsy.h"                		// Tsy class header
    31 #include "CSatNotifyLanguageNotification.h" // Tsy class header
    25 #include "CSatNotifyLanguageNotification.h" // Tsy class header
    32 #include "CSatNotificationsTsy.h"   	    // Class header
    26 #include "CSatNotificationsTsy.h"   	    // Class header
    33 #include "CBerTlv.h"                		// Ber Tlv data handling
    27 #include "CBerTlv.h"                		// Ber Tlv data handling
    34 #include "TTlv.h"							// TTlv class
    28 #include "TTlv.h"							// TTlv class
    35 #include "CSatDataPackage.h"         		// Parameter packing 
    29 #include "CSatDataPackage.h"         		// Parameter packing 
       
    30 #include "TfLogger.h"               		// For TFLOGSTRING
    36 #include "TSatUtility.h"            		// Utilities
    31 #include "TSatUtility.h"            		// Utilities
    37 #include "CSatTsyReqHandleStore.h"  		// Request handle class
    32 #include "CSatTsyReqHandleStore.h"  		// Request handle class
    38 #include "cmmmessagemanagerbase.h" 			// Message manager class for 
    33 #include "cmmmessagemanagerbase.h" 			// Message manager class for 
    39 											// forwarding req.
    34 											// forwarding req.
    40 
    35 
    46 CSatNotifyLanguageNotification* CSatNotifyLanguageNotification::NewL
    41 CSatNotifyLanguageNotification* CSatNotifyLanguageNotification::NewL
    47         ( 
    42         ( 
    48         CSatNotificationsTsy* aNotificationsTsy 
    43         CSatNotificationsTsy* aNotificationsTsy 
    49         )
    44         )
    50     {
    45     {
    51     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_NEWL_1, "CSAT: CSatNotifyLanguageNotification::NewL");
    46     TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::NewL");
    52    	CSatNotifyLanguageNotification* const satNotifyLanguageNotification = 
    47    	CSatNotifyLanguageNotification* const satNotifyLanguageNotification = 
    53         new ( ELeave ) CSatNotifyLanguageNotification( aNotificationsTsy );
    48         new ( ELeave ) CSatNotifyLanguageNotification( aNotificationsTsy );
    54     CleanupStack::PushL( satNotifyLanguageNotification );
    49     CleanupStack::PushL( satNotifyLanguageNotification );
    55     satNotifyLanguageNotification->ConstructL();
    50     satNotifyLanguageNotification->ConstructL();
    56     CleanupStack::Pop( satNotifyLanguageNotification );
    51     CleanupStack::Pop( satNotifyLanguageNotification );
    57     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_NEWL_2, "CSAT: CSatNotifyLanguageNotification::NewL, end of method");
    52     TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::NewL, end of method");
    58     return satNotifyLanguageNotification;
    53     return satNotifyLanguageNotification;
    59     }
    54     }
    60 
    55 
    61 // -----------------------------------------------------------------------------
    56 // -----------------------------------------------------------------------------
    62 // CSatNotifyLanguageNotification::CSatNotifyLanguageNotification
    57 // CSatNotifyLanguageNotification::CSatNotifyLanguageNotification
    66 CSatNotifyLanguageNotification::~CSatNotifyLanguageNotification
    61 CSatNotifyLanguageNotification::~CSatNotifyLanguageNotification
    67         ( 
    62         ( 
    68 		// None
    63 		// None
    69         )
    64         )
    70     {
    65     {
    71     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_DTOR_1, "CSAT: CSatNotifyLanguageNotification::~CSatNotifyLanguageNotification");
    66     TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::\
       
    67         ~CSatNotifyLanguageNotification");
    72     }
    68     }
    73     
    69     
    74 // -----------------------------------------------------------------------------
    70 // -----------------------------------------------------------------------------
    75 // CSatNotifyLanguageNotification::CSatNotifyLanguageNotification
    71 // CSatNotifyLanguageNotification::CSatNotifyLanguageNotification
    76 // Default C++ constructor
    72 // Default C++ constructor
    92 void CSatNotifyLanguageNotification::ConstructL
    88 void CSatNotifyLanguageNotification::ConstructL
    93         (
    89         (
    94         // None
    90         // None
    95         )
    91         )
    96     {
    92     {
    97     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_CONSTRUCTL_1, "CSAT: CSatNotifyLanguageNotification::ConstructL");
    93     TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::ConstructL");
    98     }
    94     }
    99 
    95 
   100 // -----------------------------------------------------------------------------
    96 // -----------------------------------------------------------------------------
   101 // CSatNotifyLanguageNotification::Notify
    97 // CSatNotifyLanguageNotification::Notify
   102 // Save the request handle type for notification requested by ETel server
    98 // Save the request handle type for notification requested by ETel server
   106         ( 
   102         ( 
   107         const TTsyReqHandle aTsyReqHandle,
   103         const TTsyReqHandle aTsyReqHandle,
   108         const TDataPackage& aPackage   
   104         const TDataPackage& aPackage   
   109         )
   105         )
   110     {
   106     {
   111     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_NOTIFY_1, "CSAT: CSatNotifyLanguageNotification::Notify");
   107     TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::Notify");
   112     // Save data pointer to client side for completion
   108     // Save data pointer to client side for completion
   113     iLanguageNotificationV2Pckg = reinterpret_cast<RSat::
   109     iLanguageNotificationV2Pckg = reinterpret_cast<RSat::
   114     	TLanguageNotificationV2Pckg*>( aPackage.Des1n() );
   110     	TLanguageNotificationV2Pckg*>( aPackage.Des1n() );
   115     // Save the request handle
   111     // Save the request handle
   116     iNotificationsTsy->iSatTsy->SaveReqHandle( aTsyReqHandle, 
   112     iNotificationsTsy->iSatTsy->SaveReqHandle( aTsyReqHandle, 
   132 TInt CSatNotifyLanguageNotification::CancelNotification
   128 TInt CSatNotifyLanguageNotification::CancelNotification
   133         (
   129         (
   134         const TTsyReqHandle aTsyReqHandle 
   130         const TTsyReqHandle aTsyReqHandle 
   135         )
   131         )
   136     {
   132     {
   137     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_CANCELNOTIFICATION_1, "CSAT: CSatNotifyLanguageNotification::CancelNotification");
   133     TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::CancelNotification"); 
   138     // Reset the request handle
   134     // Reset the request handle
   139     iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( 
   135     iNotificationsTsy->iSatReqHandleStore->ResetTsyReqHandle( 
   140         CSatTsy::ESatNotifyLanguageNotificationPCmdReqType );
   136         CSatTsy::ESatNotifyLanguageNotificationPCmdReqType );
   141     // Reset the data pointer
   137     // Reset the data pointer
   142     iLanguageNotificationV2Pckg = NULL;
   138     iLanguageNotificationV2Pckg = NULL;
   156         ( 
   152         ( 
   157         CSatDataPackage* aDataPackage,
   153         CSatDataPackage* aDataPackage,
   158         TInt aErrorCode  
   154         TInt aErrorCode  
   159         ) 
   155         ) 
   160     {
   156     {
   161     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_COMPLETENOTIFYL_1, "CSAT: CSatNotifyLanguageNotification::CompleteNotifyL");
   157     TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::CompleteNotifyL");
   162 
   158 
   163     TInt returnValue( KErrNone );
   159     TInt returnValue( KErrNone );
   164     TInt ret( KErrNone );
   160     TInt ret( KErrNone );
   165 	TBuf<1> additionalInfo;
   161 	TBuf<1> additionalInfo;
   166 	
   162 	
   203             TUint8 cmdQualifier(commandDetails.GetShortInfo( 
   199             TUint8 cmdQualifier(commandDetails.GetShortInfo( 
   204                 ETLV_CommandQualifier ) );
   200                 ETLV_CommandQualifier ) );
   205 
   201 
   206             if ( !cmdQualifier )
   202             if ( !cmdQualifier )
   207                 {
   203                 {
   208                 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_COMPLETENOTIFYL_2, "CSAT: CSatNotifyLanguageNotification::CompleteNotifyL, No specific language used");
   204                 TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::\
       
   205                     CompleteNotifyL, No specific language used");
   209                 // No specific language used
   206                 // No specific language used
   210                 languageNotificationV2.iNotificationType = 
   207                 languageNotificationV2.iNotificationType = 
   211                     RSat::ENonSpecificLangNotification;
   208                     RSat::ENonSpecificLangNotification;
   212                 }
   209                 }
   213             else if ( KSpecificLanguage == cmdQualifier )
   210             else if ( KSpecificLanguage == cmdQualifier )
   238             
   235             
   239         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, ret );
   236         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, ret );
   240         }// End of if( CSatTsy::ESatReqHandleUnknown != reqHandle )
   237         }// End of if( CSatTsy::ESatReqHandleUnknown != reqHandle )
   241     else
   238     else
   242         {
   239         {
   243         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_COMPLETENOTIFYL_3, "CSAT: CSatNotifyLanguageNotification::CompleteNotifyL, Request not ongoing");
   240         TFLOGSTRING("CSAT: CSatNotifyLanguageNotification::CompleteNotifyL,\
       
   241             Request not ongoing");
   244         additionalInfo.Zero();
   242         additionalInfo.Zero();
   245         additionalInfo.Append( KNoCause );
   243         additionalInfo.Append( KNoCause );
   246         CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd,
   244         CreateTerminalRespL( pCmdNumber, RSat::KMeUnableToProcessCmd,
   247             additionalInfo );       
   245             additionalInfo );       
   248         }
   246         }
   257 TInt CSatNotifyLanguageNotification::TerminalResponseL
   255 TInt CSatNotifyLanguageNotification::TerminalResponseL
   258         ( 
   256         ( 
   259         TDes8* aRsp
   257         TDes8* aRsp
   260         )
   258         )
   261     {
   259     {
   262     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_TERMINALRESPONSEL_1, "CSAT:CSatNotifyLanguageNotification::TerminalResponseL");
   260     TFLOGSTRING("CSAT:CSatNotifyLanguageNotification::TerminalResponseL");
   263     TInt ret( KErrNone );
   261     TInt ret( KErrNone );
   264     TBuf<1> additionalInfo;
   262     TBuf<1> additionalInfo;
   265     additionalInfo.FillZ(1);
   263     additionalInfo.FillZ(1);
   266 
   264 
   267     RSat::TLanguageNotificationRspV2Pckg* aRspPckg = 
   265     RSat::TLanguageNotificationRspV2Pckg* aRspPckg = 
   286         TUint8  aPCmdNumber,         
   284         TUint8  aPCmdNumber,         
   287         TUint8  aGeneralResult,     
   285         TUint8  aGeneralResult,     
   288         TDesC16& aAdditionalInfo    
   286         TDesC16& aAdditionalInfo    
   289 		)
   287 		)
   290     {
   288     {
   291     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYLANGUAGENOTIFICATION_CREATETERMINALRESPL_1, "CSAT:CSatNotifyLanguageNotification::CreateTerminalRespL");
   289     TFLOGSTRING("CSAT:CSatNotifyLanguageNotification::CreateTerminalRespL");	    
   292     TTlv tlvSpecificData;
   290     TTlv tlvSpecificData;
   293     // Create General Result TLV here
   291     // Create General Result TLV here
   294     tlvSpecificData.AddTag( KTlvResultTag );
   292     tlvSpecificData.AddTag( KTlvResultTag );
   295     // General result
   293     // General result
   296     tlvSpecificData.AddByte( aGeneralResult );
   294     tlvSpecificData.AddByte( aGeneralResult );