multimediacommsengine/tsrc/MMCTestDriver/MCETester/src/TCmdSendRespond.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "MCEConstants.h"
       
    21 #include "TCmdSendRespond.h"
       
    22 #include "CTcMCEContext.h"
       
    23 #include <MceInSession.h>
       
    24 
       
    25 
       
    26 void TCmdSendRespond::ExecuteL()
       
    27 	{	
       
    28 	// ---------- Setup ------------------------------------
       
    29 	
       
    30 	// Get session
       
    31 	CMceInSession* session = 
       
    32 	    reinterpret_cast<CMceInSession*>(GetObjectForIdL(KSessionId, ETrue));
       
    33 		
       
    34 	// ---------- Execution --------------------------------
       
    35 
       
    36 	// Get reasonphrase
       
    37 	TPtrC8 reason = ExtractTextL(KParamReasonPhrase, ETrue);
       
    38 		
       
    39 	// Get statuscode
       
    40 	TInt status = ExtractIntegerL(KParamStatusCode, 180, ETrue);
       
    41 
       
    42 	session->RespondL(reason, status);
       
    43 
       
    44 	CMceSession::TState state = session->State();	
       
    45 
       
    46 	// ---------- Response creation -----------------------
       
    47  
       
    48 	AddIdResponseL(KSessionId, *session);
       
    49 
       
    50 	// Add Session state	
       
    51 	AddIntegerResponseL( KResponseState, state );
       
    52 	AddTextualSessionStateL( state );
       
    53 	
       
    54 	}
       
    55 	
       
    56 TBool TCmdSendRespond::Match( const TTcIdentifier& aId )
       
    57 	{
       
    58 	return TTcMceCommandBase::Match( aId, _L8("SendRespond") );
       
    59 	}
       
    60 
       
    61 TTcCommandBase* TCmdSendRespond::CreateL( MTcTestContext& aContext )
       
    62 	{
       
    63 	return new( ELeave ) TCmdSendRespond( aContext );
       
    64 	}