bluetoothengine/bthid/common/src/genericserver.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 00:29:19 +0300
changeset 66 b3d605f76ff8
parent 0 f63038272f30
permissions -rw-r--r--
Revision: 201037 Kit: 201039

/*
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  This is the implementation of application class
 *
*/


#include "genericserver.h"

// ----------------------------------------------------------------------
#include "genericserversecuritypolicy.h"
CGenericServer::CGenericServer(TInt aPriority) : /*CServer2(aPriority),*/
    CPolicyServer(/*EPriorityStandard*/aPriority, KGenericServerPolicy,
            ESharableSessions)
    {
    }

TInt CGenericServer::GetStartupFromCommandLine(TStartupRequest& startup)
    {

    // Check the command line is the expected length
    if (User::CommandLineLength() == KStartupTextLength)
        {
        // Copy the data to the supplied structure
        TPtr ptr(reinterpret_cast<TText*> (&startup), KStartupTextLength);
        User::CommandLine(ptr);
        return KErrNone;
        }

    return KErrGeneral;
    }

void CGenericServer::SignalStartup(TStartupRequest* startup, TInt aReason)
    {
    RThread client;

    // Open a handle to the client's thread
    if (startup && KErrNone == client.Open(startup->iId))
        {
        // Signal the client
        client.RequestComplete(startup->iStatus, aReason);
        client.Close();
        }
    }