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