1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 //=================================================================
27 // eCosTestMonitorFilter.h
29 // Simple filter for monitoring data flowing through the client
31 //=================================================================
32 //=================================================================
33 //#####DESCRIPTIONBEGIN####
36 // Contributors: jskov
38 //####DESCRIPTIONEND####
39 #ifndef _CECOSMONITORFILTER_H
40 #define _CECOSMONITORFILTER_H
44 #include "eCosSocket.h"
45 #include "eCosSerial.h"
47 //----------------------------------------------------------------------------
49 class CeCosTestMonitorFilter;
51 class CeCosTestMonitorFilter {
53 enum data_origin_t {MF_TARGET=0, MF_HOST} ;
56 CeCosTestMonitorFilter();
57 ~CeCosTestMonitorFilter();
59 // Configuration methods
60 void SetVerbose(bool bVerbose)
61 { m_bOptVerbose = bVerbose; }
62 void SetOrigin(data_origin_t eOrigin)
63 { m_eOrigin = eOrigin; }
65 bool FilterFunctionProper(void*& pBuf, unsigned int& nRead);
70 void ConsoleWrite(const char* pszStr);
71 void Trace(const char* pszFormat, ...);
72 void PrintHex(const unsigned char* d1, int len,
73 data_origin_t origin=MF_TARGET);
76 // Options used for configuring behavior.
79 data_origin_t m_eOrigin;
83 extern bool CALLBACK SerialMonitorFunction(void*& pBuf,
89 #endif // _CECOSMONITORFILTER_H