/* * PortCore.h * * Created on: 13 May 2016 * Author: wentzelc */ #ifndef REDACORE_PORTCORE_H_ #define REDACORE_PORTCORE_H_ // redA Libraries /* none */ // Standard C/C++ Libraries #include //--------------------------------------------------------------------------- // Defines required to configure port #define NO_PARITY 0 #define ODD_PARITY 1 #define EVEN_PARITY 2 #define MARK_PARITY 3 #define SPACE_PARITY 4 #define NO_FLOWCTRL 0 #define HW_FLOWCTRL 1 #define SW_FLOWCTRL 2 //--------------------------------------------------------------------------- // Port Core Class class CPortCore { private: // Port Def int Handle; char * Name; // PortIn buffer char * InBuffer; int InBufLen; int InLen; int BytesRead; // PortIn Timer timeval InStart; long InTimeout; // millisecs public: CPortCore( const char * PortName, const int PortInBufLen ); ~CPortCore(); bool Open(); bool Close(); bool Config( int Baud, short DataBits, short StopBits, short Parity, short FlowCtrl, int Wait ); int GetHandle() { return Handle; }; bool Read(); bool Maintain( int SocketHandle ); }; //--------------------------------------------------------------------------- #endif /* REDACORE_PORTCORE_H_ */