connectivitylayer/isce/isaaccessextension_dll/inc/pipehandler.h
author mikaruus
Tue, 19 Oct 2010 13:16:20 +0300
changeset 9 8486d82aef45
parent 0 63b37f68c1ce
permissions -rw-r--r--
modemadaptation release 2010wk40

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "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: 
*
*/



#include <klib.h>       // For DBase


class DPep;
class MIAD2ChannelApi;
class DRouter;

NONSHARABLE_CLASS(DPipeHandler) : public DBase
{
    public:

        DPipeHandler(DRouter& aRouter);
        ~DPipeHandler();

        void ReceivePipeMessage( const TDesC8& aMsg, MIAD2ChannelApi* aToCb );
        TInt SendPipeMessage( TDes8& aMsg, TUint16 aFromChannel );
        void RemovePep(DPep* aPep);
#if (NCP_COMMON_SOS_VERSION_SUPPORT >= SOS_VERSION_95)
        void PipeLoaned( const TUint16 aLoanerChannel, MIAD2ChannelApi* aCh );
        void PipeLoanReturned( const TUint16 aLoanerChannel, MIAD2ChannelApi* aOldCh );
#endif

    private:

        void HandlePepConnectReq( const TDesC8& aMsg, MIAD2ChannelApi* aReceiverCb);
        TInt HandlePipeCreateReq( TDes8& aMessage, TUint16 aFromChannel );
        TInt CreatePep( TUint16 aPepChannel, TBool aIsController );
        DPep* FindPep( const TUint16 aChannelId );//const TDesC8& aMsg );

    private:

        RPointerArray<DPep>     iPepContainer;
        MIAD2ChannelApi*        iChannelApi;
        DRouter&                iRouter;
};