telephonyserverplugins/simatktsy/src/CSatNotifyCallControlRequest.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".
    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 "CSatNotifyCallControlRequestTraces.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 "CSatNotifyCallControlRequest.h"   // Tsy class header
    25 #include "CSatNotifyCallControlRequest.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 "CSatDataPackage.h"				// Parameter packing 
    28 #include "CSatDataPackage.h"				// Parameter packing 
       
    29 #include "TfLogger.h"						// For TFLOGSTRING
    35 #include "TSatUtility.h"					// Utilities
    30 #include "TSatUtility.h"					// Utilities
    36 #include "CSatTsyReqHandleStore.h"			// Request handle class
    31 #include "CSatTsyReqHandleStore.h"			// Request handle class
    37 #include "cmmmessagemanagerbase.h"			// Message manager class for forwarding req.
    32 #include "cmmmessagemanagerbase.h"			// Message manager class for forwarding req.
    38 
    33 
    39 // -----------------------------------------------------------------------------
    34 // -----------------------------------------------------------------------------
    44 CSatNotifyCallControlRequest* CSatNotifyCallControlRequest::NewL
    39 CSatNotifyCallControlRequest* CSatNotifyCallControlRequest::NewL
    45         ( 
    40         ( 
    46         CSatNotificationsTsy* aNotificationsTsy 
    41         CSatNotificationsTsy* aNotificationsTsy 
    47         )
    42         )
    48     {
    43     {
    49     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_NEWL_1, "CSAT: CSatNotifyCallControlRequest::NewL");
    44     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::NewL");
    50    	CSatNotifyCallControlRequest* const satNotifyCallControlRequest = 
    45    	CSatNotifyCallControlRequest* const satNotifyCallControlRequest = 
    51         new ( ELeave ) CSatNotifyCallControlRequest( aNotificationsTsy );
    46         new ( ELeave ) CSatNotifyCallControlRequest( aNotificationsTsy );
    52     CleanupStack::PushL( satNotifyCallControlRequest );
    47     CleanupStack::PushL( satNotifyCallControlRequest );
    53     satNotifyCallControlRequest->ConstructL();
    48     satNotifyCallControlRequest->ConstructL();
    54     CleanupStack::Pop( satNotifyCallControlRequest );
    49     CleanupStack::Pop( satNotifyCallControlRequest );
    55     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_NEWL_2, "CSAT: CSatNotifyCallControlRequest::NewL, end of method");
    50     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::NewL, end of method");
    56     return satNotifyCallControlRequest;
    51     return satNotifyCallControlRequest;
    57     }
    52     }
    58 
    53 
    59 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    60 // CSatNotifyCallControlRequest::~CSatNotifyCallControlRequest
    55 // CSatNotifyCallControlRequest::~CSatNotifyCallControlRequest
    64 CSatNotifyCallControlRequest::~CSatNotifyCallControlRequest
    59 CSatNotifyCallControlRequest::~CSatNotifyCallControlRequest
    65         ( 
    60         ( 
    66 		// None
    61 		// None
    67         )
    62         )
    68     {
    63     {
    69     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_DTOR_1, "CSAT: CSatNotifyCallControlRequest::~CSatNotifyCallControlRequest");
    64     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::\
       
    65         ~CSatNotifyCallControlRequest");
    70     }
    66     }
    71     
    67     
    72 // -----------------------------------------------------------------------------
    68 // -----------------------------------------------------------------------------
    73 // CSatNotifyCallControlRequest::CSatNotifyCallControlRequest
    69 // CSatNotifyCallControlRequest::CSatNotifyCallControlRequest
    74 // Default C++ constructor
    70 // Default C++ constructor
    90 void CSatNotifyCallControlRequest::ConstructL
    86 void CSatNotifyCallControlRequest::ConstructL
    91         (
    87         (
    92         // None
    88         // None
    93         )
    89         )
    94     {
    90     {
    95     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_CONSTRUCTL_1, "CSAT: CSatNotifyCallControlRequest::ConstructL");
    91     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::ConstructL");
    96     }
    92     }
    97 
    93 
    98 // -----------------------------------------------------------------------------
    94 // -----------------------------------------------------------------------------
    99 // CSatNotifyCallControlRequest::Notify
    95 // CSatNotifyCallControlRequest::Notify
   100 // This request allows a client to be notified of a Call Control Request proactive 
    96 // This request allows a client to be notified of a Call Control Request proactive 
   105         (
   101         (
   106         const TTsyReqHandle aTsyReqHandle,
   102         const TTsyReqHandle aTsyReqHandle,
   107         const TDataPackage& aPackage 
   103         const TDataPackage& aPackage 
   108         )
   104         )
   109     {
   105     {
   110     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_NOTIFY_1, "CSAT: CSatNotifyCallControlRequest::Notify");
   106     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::Notify");
   111 
   107 
   112     // Save data pointer to client side for completion
   108     // Save data pointer to client side for completion
   113     iCallControlV2Pckg = reinterpret_cast<RSat::TCallControlV2Pckg*>( 
   109     iCallControlV2Pckg = reinterpret_cast<RSat::TCallControlV2Pckg*>( 
   114         aPackage.Des1n() ); 
   110         aPackage.Des1n() ); 
   115     // Save the request handle
   111     // Save the request handle
   128 TInt CSatNotifyCallControlRequest::CancelNotification
   124 TInt CSatNotifyCallControlRequest::CancelNotification
   129         (
   125         (
   130         const TTsyReqHandle aTsyReqHandle // Tsy request handle
   126         const TTsyReqHandle aTsyReqHandle // Tsy request handle
   131         )
   127         )
   132     {
   128     {
   133     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_CANCELNOTIFICATION_1, "CSAT: CSatNotifyCallControlRequest::CancelNotification");
   129     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::CancelNotification");   
   134     // Reset the request handle
   130     // Reset the request handle
   135     iNotificationsTsy->iSatReqHandleStore->
   131     iNotificationsTsy->iSatReqHandleStore->
   136         ResetTsyReqHandle( CSatTsy::ESatNotifyCallControlRequestPCmdReqType );
   132         ResetTsyReqHandle( CSatTsy::ESatNotifyCallControlRequestPCmdReqType );
   137     iCallControlV2Pckg = NULL;
   133     iCallControlV2Pckg = NULL;
   138     // Complete the request with KErrCancel
   134     // Complete the request with KErrCancel
   149         (
   145         (
   150         CSatDataPackage* aDataPackage,   
   146         CSatDataPackage* aDataPackage,   
   151         TInt aErrorCode 
   147         TInt aErrorCode 
   152         )
   148         )
   153     {
   149     {
   154     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_COMPLETENOTIFYL_1, "CSAT: CSatNotifyCallControlRequest::CompleteNotifyL");
   150     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::CompleteNotifyL");   
   155     RSat::TAlphaIdBuf alphaId;
   151     RSat::TAlphaIdBuf alphaId;
   156     RSat::TControlResult result;
   152     RSat::TControlResult result;
   157 	// Unpack data
   153 	// Unpack data
   158 	aDataPackage->UnPackData( alphaId, result ); 
   154 	aDataPackage->UnPackData( alphaId, result ); 
   159 	CompleteAlphaId( alphaId, result, aErrorCode );
   155 	CompleteAlphaId( alphaId, result, aErrorCode );
   171         RSat::TAlphaIdBuf& aAlphaId, 
   167         RSat::TAlphaIdBuf& aAlphaId, 
   172         RSat::TControlResult aResult,
   168         RSat::TControlResult aResult,
   173         TInt aErrorCode                
   169         TInt aErrorCode                
   174         )
   170         )
   175     {
   171     {
   176     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_COMPLETEALPHAID_1, "CSAT: CSatNotifyCallControlRequest::CompleteAlphaId");
   172     TFLOGSTRING("CSAT: CSatNotifyCallControlRequest::CompleteAlphaId");	
   177 
   173 
   178 	// Reset req handle. Returns the deleted req handle
   174 	// Reset req handle. Returns the deleted req handle
   179     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   175     TTsyReqHandle reqHandle = iNotificationsTsy->iSatReqHandleStore->
   180 		ResetTsyReqHandle( CSatTsy::ESatNotifyCallControlRequestPCmdReqType );
   176 		ResetTsyReqHandle( CSatTsy::ESatNotifyCallControlRequestPCmdReqType );
   181 		
   177 		
   194             RSat::TCallControlV2& callControlV2 = ( *iCallControlV2Pckg )();
   190             RSat::TCallControlV2& callControlV2 = ( *iCallControlV2Pckg )();
   195             // Set default control result
   191             // Set default control result
   196             callControlV2.SetCcGeneralResult( aResult );          
   192             callControlV2.SetCcGeneralResult( aResult );          
   197             callControlV2.SetAlphaId( validity, alphaIdTemp );  
   193             callControlV2.SetAlphaId( validity, alphaIdTemp );  
   198             }
   194             }
   199         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_COMPLETEALPHAID_2,  "CSAT: CSatNotifyCallControlRequest::CompleteAlphaId completing" );
   195         TFLOGSTRING( "CSAT: CSatNotifyCallControlRequest::CompleteAlphaId\
       
   196             completing" );
   200         // Complete notification
   197         // Complete notification
   201         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, aErrorCode );
   198         iNotificationsTsy->iSatTsy->ReqCompleted( reqHandle, aErrorCode );
   202         }
   199         }
   203     else
   200     else
   204         {
   201         {
   205         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSATNOTIFYCALLCONTROLREQUEST_COMPLETEALPHAID_3,  "CSAT: CSatNotifyCallControlRequest::CompleteAlphaId Request not ongoing" );
   202         TFLOGSTRING( "CSAT: CSatNotifyCallControlRequest::CompleteAlphaId\
       
   203             Request not ongoing" );
   206         }
   204         }
   207     }
   205     }
   208 
   206 
   209 // End of file
   207 // End of file