dbgagents/trkagent/engine/TrkDbgTrcCommPort.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 
       
    19 #ifndef __TRKDBGTRCCOMMPORT_H__
       
    20 #define __TRKDBGTRCCOMMPORT_H__
       
    21 
       
    22 #include "TrkCommPort.h"
       
    23 #include "dbgtrccomm.h"
       
    24 
       
    25 //
       
    26 // class CTrkDbgTrcCommPort
       
    27 //
       
    28 // Defines an interface to a serial type communications port
       
    29 //
       
    30 class CTrkDbgTrcCommPort : public CTrkCommPort
       
    31 {
       
    32 public:
       
    33 
       
    34 	static CTrkDbgTrcCommPort* NewL(TTrkConnData aTrkConnData, TDes& aErrorMessage);
       
    35 	~CTrkDbgTrcCommPort();
       
    36 
       
    37 	void OpenPortL();
       
    38 	void ClosePort();
       
    39 
       
    40 	void SendDataL(const TDesC8& aData);
       
    41 	void Listen(CTrkFramingLayer *aFramingLayer);
       
    42 	void StopListening();
       
    43 
       
    44 protected:
       
    45 
       
    46 	void DoCancel();
       
    47 	void RunL();
       
    48 
       
    49 private:
       
    50 
       
    51 	CTrkDbgTrcCommPort();
       
    52 	void ConstructL(TTrkConnData aTrkConnData, TDes& aErrorMessage);
       
    53 	void IssueReadRequest();
       
    54 	void ReportAndLeaveIfErrorL(TInt aError, const TDesC& aDesc);
       
    55 	
       
    56 private:
       
    57 	TUint  iUnitNumber;
       
    58 
       
    59 	TBool iConnected;
       
    60 	TBool iListening;
       
    61 
       
    62 	TBuf8<MAXMESSAGESIZE> iReceivedChars;
       
    63 	TInt iNextReadChar;
       
    64 
       
    65 	CTrkFramingLayer* iFramingLayer;
       
    66 		
       
    67 	TInt iLineNumber;
       
    68 	
       
    69 	RDbgTrcComm iDbgTrcPort;
       
    70 };
       
    71 
       
    72 #endif // __TRKDBGTRCCOMMPORT_H__