Important Update:

- JSONparseCore:
  - Bug fix: Incorrectly terminated PrintString on null
- SelectableCore:
  - Add BaudRate, DataBits, Parity, StopBits, FlowCtrl, DataWait to THandle
  - Include Serial Port setup in SetPortHandle()
  - Read Serial Port config in LoadConfigData()
  - Rename SetSerialConfig() -> ConfigureSerialPort()
  - Configure Serial Port immediately after opening port
This commit is contained in:
Charl Wentzel
2017-11-29 11:30:05 +02:00
parent 89123fa4af
commit 92ce01a3b7
3 changed files with 64 additions and 43 deletions

View File

@@ -94,6 +94,13 @@ struct SHandle {
bool AddressFailed; // Indicate failure to connect to address
bool KeepAlive; // Socket keep alive
int Baudrate;
short DataBits;
short Parity;
short StopBits;
short FlowCtrl;
int DataWait;
// Buffers
CRollingBuffer * InBuffer;
CRollingBuffer * OutBuffer;
@@ -242,15 +249,16 @@ public:
return Handle;
}
// General port parameters
THandle * CreateHandle( const char * HandleName, bool CreateChannel );
bool SetCallback( THandle * Handle, EConnectState pState, FHandleCallback pCallback );
bool SetAutoManage( THandle * Handle, bool AutoManage, bool Persistent, int ReopenTime = 0 );
bool SetInBuffer( THandle * Handle, int InBufSize, int InTimeout, const char * InMarker, int InMarkerLen );
bool SetOutBuffer( THandle * Handle, int OutBufSize );
bool SetSerialConfig( THandle * Handle, int Baud, short DataBits, short StopBits, short Parity, short FlowCtrl, int Wait );
// File Interface
bool SetPortHandle( THandle * Handle, const char * FileName );
// Specific port parameters
bool SetPortHandle( THandle * Handle, const char * FileName,
int Baudrate, short DataBits, short Parity, short StopBits, short FlowCtrl, int DataWait );
bool SetForkPipeHandle( THandle * Handle, const char * ExecPath );
bool SetSocketHandle( THandle * Handle, EConnectType Type, const char * HostName, const char * PortName, bool KeepAlive );
bool ClearHandle( THandle * Handle );
@@ -273,6 +281,8 @@ public:
inline virtual bool Write( const char * HandleName ) { return (Write( GetHandle( HandleName ))); };
inline virtual bool Write( int FD ) { return (Write( GetHandle( FD ))); };
bool ConfigureSerialPort( THandle * Handle );
// Info
inline EConnectType GetType( const char * HandleName ) {
THandle * Handle = GetHandle( HandleName );