Important Update:
- Still testing - Separate Rolling Buffer from PortCore to BufferCore - Implement BufferCore in PortCore - Add additional Rolling Buffer functions for future
This commit is contained in:
33
PortCore.h
33
PortCore.h
@@ -9,7 +9,7 @@
|
||||
#define REDACORE_PORTCORE_H_
|
||||
|
||||
// redA Libraries
|
||||
/* none */
|
||||
#include "BufferCore.h"
|
||||
|
||||
// Standard C/C++ Libraries
|
||||
#include <sys/time.h>
|
||||
@@ -36,27 +36,34 @@ private:
|
||||
int Handle;
|
||||
char * Name;
|
||||
|
||||
// PortIn buffer
|
||||
char * InBuffer;
|
||||
int InBufLen;
|
||||
int InLen;
|
||||
int BytesRead;
|
||||
// Port Buffer
|
||||
CBuffer * Buffer;
|
||||
|
||||
// PortIn Timer
|
||||
timeval InStart;
|
||||
long InTimeout; // millisecs
|
||||
// Input Timer
|
||||
timeval InStart;
|
||||
long InTimeout; // millisecs
|
||||
|
||||
// Input Markers
|
||||
char * InMarkers;
|
||||
int InMarkerLen;
|
||||
|
||||
// Output
|
||||
int OutputHandle;
|
||||
|
||||
public:
|
||||
CPortCore( const char * PortName, const int PortInBufLen );
|
||||
CPortCore( const char * PortName, const int PortInBufSize );
|
||||
~CPortCore();
|
||||
|
||||
bool Open();
|
||||
bool Close();
|
||||
bool Config( int Baud, short DataBits, short StopBits, short Parity, short FlowCtrl, int Wait );
|
||||
bool InputConfig( long InputTimeout, const char * InputMarkers, int InputMarkerLen );
|
||||
bool SerialConfig( int Baud, short DataBits, short StopBits, short Parity, short FlowCtrl, int Wait );
|
||||
bool OutputConfig( int PortOutputHandle );
|
||||
int GetHandle() { return Handle; };
|
||||
|
||||
bool Read();
|
||||
bool Maintain( int SocketHandle );
|
||||
bool Read( int MaxRead );
|
||||
bool Maintain();
|
||||
bool ProcessBuffer( bool Force );
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user