cbsref/csyrefplugins/csy27010/inc/PortC32InterfaceIp.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 16:23:08 +0300
branchRCL_3
changeset 19 630d2f34d719
permissions -rw-r--r--
Revision: 201035 Kit: 201035

//
// * Copyright 2004 Neusoft America Inc.
// * All rights reserved.
// * This component and the accompanying materials are made available
// * under the terms of the Eclipse Public License v1.0
// * which accompanies this distribution, and is available
// * at the URL "http://www.eclipse.org/legal/epl-v10.html".
// *
// * Contributors:
// * Keith Collins (Neusoft America Inc.)  original software development and additional code and modifications.
// * Thomas Gahagen (Neusoft America Inc.)  additional code and modifications.
// * Zhen Yuan (Neusoft America Inc.)  additional code and modifications.
// *
// * Description:  This file defines the CPortC32InterfaceIp class.  This class
// *               is equivalent to client RComm subsessions. This is derived 
// *               from the C32 base class for ports CPort.
//

// CPortC32InterfaceIp.h

/** @file CPortC32InterfaceIp.h
*/
#ifndef _PORTC32INTERFACEIP_H__
#define _PORTC32INTERFACEIP_H__

#include <cs_port.h>
#include "PortC32InterfaceBase.h"

class CChannelMgrCmdData;
class CCsyMsgBufBpFrame;

class CPortC32InterfaceIp : public CPortC32InterfaceBase
	{
public:
	static CPortC32InterfaceIp* NewL(CPortFactory& aPortFactory, 
								   CPortFactory::TC32PortInfo& aPortInfo);
	virtual ~CPortC32InterfaceIp();

	void SendFrameToClient(CCsyMsgBufBpFrame* aFrame);

protected:
	virtual TBool ReadFromBufOrQueue();

private:
	CPortC32InterfaceIp(CPortFactory& aPortFactory,
					  CPortFactory::TC32PortInfo& aPortInfo);
	void ConstructL();

	virtual TInt QueryReceiveBuffer(TInt& aLength) const;
	virtual void ResetBuffers(TUint aFlags);
	
	void PlaceIpPacketFramesOntoFreeList();
	void PlaceIpPacketFramesOntoReadList();
	TBool CreateIpPacketFromFrames();

private:
	//TBuf8<KMaxIpPacketSize>	iPartialReadBuf;

	TUint							iNumberOfPacketsWaiting;

	TSglQue<CCsyMsgBufBpFrame>		iFramesReceivedForIpPacket;
	TSglQueIter<CCsyMsgBufBpFrame>	iFramesReceivedForIpPacketIter;
	TUint							iCurrentIpPacketLength;

	TBuf8<KMaxIpPacketSize>			iIpPacket;
	};


#endif  // _PORTC32INTERFACEIP_H__