os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/SDevSound/SDSCapTestServer/src/captestinfoserver.cpp
First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Example file/test code to demonstrate how to develop a TestExecute Server
15 // Developers should take this project as a template and substitute their own
16 // code at the __EDIT_ME__ tags
17 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
18 // in the process of the client. The client initialises the server by calling the
19 // one and only ordinal.
24 @file captestinfoserver.cpp
27 #include "captestinfoserver.h"
29 CCapTestInfoServer* CCapTestInfoServer::NewL()
31 * @return - Instance of the test server
32 * CServer2 derived server.
35 CCapTestInfoServer * server = new (ELeave) CCapTestInfoServer();
36 CleanupStack::PushL(server);
38 server->StartL(KInfoServerName);
39 CleanupStack::Pop(server);
43 CCapTestInfoServer::CCapTestInfoServer() :
44 CServer2(EPriorityStandard)
46 iSessionConnected = EFalse;
49 CCapTestInfoServer::~CCapTestInfoServer()
53 CSession2* CCapTestInfoServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& /*aMessage*/) const
55 CCapTestInfoServerSession* session = CCapTestInfoServerSession::NewL();
60 CCapTestInfoServerSession* CCapTestInfoServerSession::NewL()
62 CCapTestInfoServerSession* self = new (ELeave) CCapTestInfoServerSession();
66 CCapTestInfoServerSession::CCapTestInfoServerSession()
71 CCapTestInfoServerSession::~CCapTestInfoServerSession()
75 void CCapTestInfoServerSession::ServiceL(const RMessage2 &aMessage)
78 switch (aMessage.Function())
80 case ECapTestInfoThreadId:
81 DoGetThreadIdL(aMessage);
84 User::Leave(KErrNotSupported);
87 aMessage.Complete(err);
90 void CCapTestInfoServerSession::DoGetThreadIdL(const RMessage2 &aMessage)
93 TPckgBuf<TThreadId> tid(thisThread.Id());
94 aMessage.WriteL(0, tid);