multimediacommsengine/tsrc/MMCTestDriver/MCETester/src/TCmdSendRegister.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 "TCmdSendRegister.h"
       
    22 #include "CTcMCEContext.h"
       
    23 #include "CTcMCEProfileContainer.h"
       
    24 #include <sipprofile.h>
       
    25 
       
    26 void TCmdSendRegister::ExecuteL()
       
    27 	{	
       
    28 	// ---------- Setup ------------------------------------
       
    29 	
       
    30 	CTcMCEProfileContainer& profileContainer = SelectProfileL();	
       
    31 	
       
    32 	// ---------- Execution --------------------------------
       
    33 	
       
    34 	TInt profileId = ExtractProfileIdL();
       
    35 	
       
    36 	CSIPProfile* profile = NULL;
       
    37 	if (profileId == 0) 
       
    38 		{
       
    39 		profile = &(profileContainer.GetDefaultProfileL());
       
    40 		}
       
    41 	else
       
    42 		{
       
    43 		profile = &(profileContainer.GetProfileByIdL(profileId)); 
       
    44 		}
       
    45 	    
       
    46 	// Fetch real profileId	
       
    47 	TUint32 longProfileId = 0;
       
    48 	profile->GetParameter( KSIPProfileId, longProfileId );
       
    49 	
       
    50 	// SendRegister, wait until succeeds
       
    51 	profileId = longProfileId;
       
    52 	profile = &(profileContainer.RegisterProfileL(profileId));
       
    53 
       
    54 	// ---------- Response creation -----------------------
       
    55  
       
    56 	AddIdResponseL(KProfileObj, *profile);
       
    57 	AddIntegerResponseL(KResponseProfileId, profileId);	
       
    58 
       
    59 	}
       
    60 	
       
    61 TBool TCmdSendRegister::Match( const TTcIdentifier& aId )
       
    62 	{
       
    63 	return TTcMceCommandBase::Match( aId, _L8("SendRegister") );
       
    64 	}
       
    65 
       
    66 TTcCommandBase* TCmdSendRegister::CreateL( MTcTestContext& aContext )
       
    67 	{
       
    68 	return new( ELeave ) TCmdSendRegister( aContext );
       
    69 	}