multimediacommsengine/tsrc/MMCTestDriver/MCETester/src/TCmdGetControlPathSecurityLevel.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 "TCmdGetControlPathSecurityLevel.h"
       
    22 #include "CTcMCEContext.h"
       
    23 #include <MCESession.h>
       
    24 
       
    25 
       
    26 void TCmdGetControlPathSecurityLevel::ExecuteL()
       
    27 	{	
       
    28 	// ---------- Setup --------------------------------------------------------
       
    29 	
       
    30 	
       
    31 	// Get session
       
    32 	CMceSession* session = 
       
    33 		reinterpret_cast<CMceSession*>(GetObjectForIdL(KSessionId, ETrue));	
       
    34 	
       
    35 	// ---------- Execution ----------------------------------------------------
       
    36 	CMceSession::TControlPathSecurityLevel secLevel;
       
    37 	//TInt secLevel;
       
    38 	secLevel = session->ControlPathSecurityLevel();
       
    39 	
       
    40 	// ---------- Response creation --------------------------------------------
       
    41 	CMceSession::TState state = session->State();	
       
    42 	AddIdResponseL(KSessionId, *session);
       
    43 	// Add Session state	
       
    44 	AddIntegerResponseL( KResponseState, state );
       
    45 	AddTextualSessionStateL( state );
       
    46 	// Add path security
       
    47 	switch (secLevel) 
       
    48 		{
       
    49 		case CMceSession::EControlPathSecurityUnknown: AddTextResponseL(KResponseControlPathSecurity, KValueControlPathSecurityUnknown); break;
       
    50 		case CMceSession::EControlPathSecure: AddTextResponseL(KResponseControlPathSecurity, KValueControlPathSecure); break;
       
    51 		case CMceSession::EControlPathUnsecure: AddTextResponseL(KResponseControlPathSecurity, KValueControlPathUnsecure); break;
       
    52 		default: AddTextResponseL(KResponseControlPathSecurity, KValueControlPathSecurityUnknown); break;
       
    53 		}
       
    54 	}
       
    55 	
       
    56 TBool TCmdGetControlPathSecurityLevel::Match( const TTcIdentifier& aId )
       
    57 	{
       
    58 	return TTcMceCommandBase::Match( aId, _L8("GetControlPathSecurityLevel") );
       
    59 	}
       
    60 
       
    61 TTcCommandBase* TCmdGetControlPathSecurityLevel::CreateL( MTcTestContext& aContext )
       
    62 	{
       
    63 	return new( ELeave ) TCmdGetControlPathSecurityLevel( aContext );
       
    64 	}