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:
Charl Wentzel
2016-05-18 15:09:02 +02:00
parent f987ea2224
commit c50766021a
5 changed files with 508 additions and 48 deletions

View File

@@ -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 );
};
//---------------------------------------------------------------------------