cbsref/csyrefplugins/csy27010/inc/CommReadWriteBaseAo.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 16:23:08 +0300
branchRCL_3
changeset 65 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 declares the base class CCommReadWriteBaseAo. 
//                Class CCommReadWriteBaseAo contains the common elements for derived 
//                Frame Reader and Frame Writer classes using a serial comm port.
//

// CommReadWriteBaseAo.h

/** @file CommReadWriteBaseAo.h
 *
 * The file declares the base class CCommReadWriteBaseAo. This class
 * holds the common elements for derived Frame Reader and Frame Writer
 * classes using a serial comm port.
 */

#ifndef _CCOMMREADWRITEBASEAO_H_
#define _CCOMMREADWRITEBASEAO_H_

#include "cs_port.h"
#include <d32comm.h>
#include <c32comm.h>
#include <e32hal.h>


class CPortFactory;
class CMux0710Protocol;

class CCommReadWriteBaseAo : public CActive
    {
public:
    CCommReadWriteBaseAo(CPortFactory* aParent, CMux0710Protocol* aMux0710Protocol,
		TInt aPriority = EPriorityStandard);
    ~CCommReadWriteBaseAo();

    TInt SetServerConfig(TCommServerConfig& aConfig);
    void GetServerConfig(TCommServerConfig& aConfig) const;
    void FreeMemory();

    inline void SetRole(TCommRole aRole){iRole=aRole;};

protected:
    void SetBuffersL();

	// attributes
    HBufC8*				iBuffer;	// pointer to the Tx/Rx buffer
    TPtr8*				iBuf;		// pointer to a TPtr8 that points to the current buffer

    TUint				iBufFlags;	// contains buffer flags e.g for partial read/write
    TInt				iBufSize;	// size of the Tx/Rx buffer

    TCommRole			iRole;		// DTE or DCE role for this port unit

    CPortFactory*		iParent;	// pointer to the CPortC32Interface object
	CMux0710Protocol*	iMux0710Protocol;
	RBusDevComm*		iCommPort;  // pointer to LDD comm port

    };

#endif  // _CCOMMREADWRITEBASEAO_H_