mmlibs/mmfw/tsrc/mmfintegrationtest/SDevSound/src/captestinfosession.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32base.h>
       
    17 #include "captestinfoserver.h"
       
    18 #include "captestinfosession.h"
       
    19 
       
    20 RCapTestInfoSession::RCapTestInfoSession()
       
    21 	{
       
    22 	}
       
    23 
       
    24 // Create the server, if one with this name does not already exist.
       
    25 TInt RCapTestInfoSession::Connect()
       
    26 	{
       
    27 	TFindServer findCountServer(KInfoServerName);
       
    28 	TFullName name;
       
    29 	TInt err = KErrNone;
       
    30 	
       
    31 	 // Need to check that the server exists.
       
    32     if (findCountServer.Next(name)==KErrNone)
       
    33     	{
       
    34     	err = CreateSession(KInfoServerName, TVersion());
       
    35     	}
       
    36     else
       
    37     	{
       
    38     	err = KErrNotReady;
       
    39     	}
       
    40     
       
    41 	return err;
       
    42     }
       
    43 
       
    44 void RCapTestInfoSession::Close()
       
    45 	{
       
    46 	RSessionBase::Close();
       
    47 	}
       
    48 
       
    49 TThreadId RCapTestInfoSession::InfoServerTidL()
       
    50 	{
       
    51 	TPckgBuf<TThreadId> tid;
       
    52 	TIpcArgs args(&tid);
       
    53     User::LeaveIfError(SendReceive(ECapTestInfoThreadId, args));
       
    54     return tid();
       
    55 	}