cbsref/csyrefplugins/csy27010/inc/CommReadWriteBaseAo.h
changeset 49 f50f4094acd7
equal deleted inserted replaced
48:14460bf2a402 49:f50f4094acd7
       
     1 //
       
     2 // * Copyright 2004 Neusoft America Inc.
       
     3 // * All rights reserved.
       
     4 // * This component and the accompanying materials are made available
       
     5 // * under the terms of the Eclipse Public License v1.0
       
     6 // * which accompanies this distribution, and is available
       
     7 // * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // *
       
     9 // * Contributors:
       
    10 // * Keith Collins (Neusoft America Inc.)  original software development and additional code and modifications.
       
    11 // * Thomas Gahagen (Neusoft America Inc.)  additional code and modifications.
       
    12 // * Zhen Yuan (Neusoft America Inc.)  additional code and modifications.
       
    13 // *
       
    14 // * Description: This file declares the base class CCommReadWriteBaseAo. 
       
    15 //                Class CCommReadWriteBaseAo contains the common elements for derived 
       
    16 //                Frame Reader and Frame Writer classes using a serial comm port.
       
    17 //
       
    18 
       
    19 // CommReadWriteBaseAo.h
       
    20 
       
    21 /** @file CommReadWriteBaseAo.h
       
    22  *
       
    23  * The file declares the base class CCommReadWriteBaseAo. This class
       
    24  * holds the common elements for derived Frame Reader and Frame Writer
       
    25  * classes using a serial comm port.
       
    26  */
       
    27 
       
    28 #ifndef _CCOMMREADWRITEBASEAO_H_
       
    29 #define _CCOMMREADWRITEBASEAO_H_
       
    30 
       
    31 #include "cs_port.h"
       
    32 #include <d32comm.h>
       
    33 #include <c32comm.h>
       
    34 #include <e32hal.h>
       
    35 
       
    36 
       
    37 class CPortFactory;
       
    38 class CMux0710Protocol;
       
    39 
       
    40 class CCommReadWriteBaseAo : public CActive
       
    41     {
       
    42 public:
       
    43     CCommReadWriteBaseAo(CPortFactory* aParent, CMux0710Protocol* aMux0710Protocol,
       
    44 		TInt aPriority = EPriorityStandard);
       
    45     ~CCommReadWriteBaseAo();
       
    46 
       
    47     TInt SetServerConfig(TCommServerConfig& aConfig);
       
    48     void GetServerConfig(TCommServerConfig& aConfig) const;
       
    49     void FreeMemory();
       
    50 
       
    51     inline void SetRole(TCommRole aRole){iRole=aRole;};
       
    52 
       
    53 protected:
       
    54     void SetBuffersL();
       
    55 
       
    56 	// attributes
       
    57     HBufC8*				iBuffer;	// pointer to the Tx/Rx buffer
       
    58     TPtr8*				iBuf;		// pointer to a TPtr8 that points to the current buffer
       
    59 
       
    60     TUint				iBufFlags;	// contains buffer flags e.g for partial read/write
       
    61     TInt				iBufSize;	// size of the Tx/Rx buffer
       
    62 
       
    63     TCommRole			iRole;		// DTE or DCE role for this port unit
       
    64 
       
    65     CPortFactory*		iParent;	// pointer to the CPortC32Interface object
       
    66 	CMux0710Protocol*	iMux0710Protocol;
       
    67 	RBusDevComm*		iCommPort;  // pointer to LDD comm port
       
    68 
       
    69     };
       
    70 
       
    71 #endif  // _CCOMMREADWRITEBASEAO_H_