dbgagents/trkagent/dbgtrccomm/server/portreader.h
changeset 0 c6b0df440bee
equal deleted inserted replaced
-1:000000000000 0:c6b0df440bee
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __PortReader_h__
       
    19 #define __PortReader_h__
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 #include <c32comm.h>
       
    24 
       
    25 #include "datalistener.h"
       
    26 
       
    27 
       
    28 class CPortReader : public CActive
       
    29 {
       
    30 
       
    31 	public:
       
    32 		static 	CPortReader*	NewL(RComm& aPort);
       
    33 				~CPortReader();
       
    34 	
       
    35 	//private construct
       
    36 	private:
       
    37 				CPortReader(RComm& aPort);
       
    38 		void	ConstructL();
       
    39 		void 	IssueReadRequest();
       
    40 
       
    41 	public:
       
    42 		void StartRead(MDataListener* aListener);
       
    43 		void RunL();
       
    44 		void DoCancel();
       
    45 
       
    46 	// data members		
       
    47 	private:
       
    48 		RComm iPort;
       
    49 				
       
    50 		TBuf8<MAX_BUF_SIZE> iReceivedChars;
       
    51 		TInt iNextReadChar;
       
    52 		
       
    53 		TBool iAlreadyReading;
       
    54 		
       
    55 		MDataListener* iListener;
       
    56 		
       
    57 
       
    58 };
       
    59 
       
    60 #endif //__PortMgr_h__