35 # pragma warning(disable : 4996) 36 # pragma warning(disable : 4290) 56 #define SDH_RS232_VCC_ASYNC 0 77 #if SDH_RS232_VCC_ASYNC 88 unsigned long baudrate;
100 cRS232(
int _port,
unsigned long _baudrate,
double _timeout,
char const* _device_format_string =
"" );
111 {
return _hCOM !=
NULL; }
113 bool IsOpen() {
return true; }
115 int write(
char const *ptr,
int len=0 );
125 ssize_t
Read(
void *data, ssize_t
size,
long timeout_us,
bool return_on_less_data );
127 char*
readline(
char* line,
int size,
char* eol,
bool return_on_less_data);
virtual bool UseCRC16()
overloaded from cSerialBase::UseCRC16 since we want to use a CRC16 to protect binary RS232 communicat...
virtual bool IsOpen(void)=0
Return true if communication channel is open.
bool IsOpen()
Return true if communication channel is open.
virtual void SetTimeout(double _timeout)
set the timeout for next readline() calls (negative value means: no timeout, wait for ever) ...
Interface of the exception base class #SDH::cSDHLibraryException and #SDH::cMsg.
Low-level communication class to access a serial port.
#define NAMESPACE_SDH_START
cRS232Exception(cMsg const &_msg)
COMMTIMEOUTS comm_timeouts
virtual int write(char const *ptr, int len=0)=0
Write data to a previously opened port.
#define NAMESPACE_SDH_END
This file contains settings to make the SDHLibrary compile on differen systems:
virtual void Open(void)=0
Open rs232 port port.
Interface of class #SDH::cSerialBase, a virtal base class to access serial communication channels lik...
Derived exception class for low-level serial communication related exceptions.
Derived exception class for low-level RS232 related exceptions.
virtual void Close(void)=0
Close the previously opened communication channel.
Class for short, fixed maximum length text messages.
virtual ssize_t Read(void *data, ssize_t size, long timeout_us, bool return_on_less_data)=0
virtual char * readline(char *line, int size, char const *eol="\, bool return_on_less_data=false)
Read a line from the device.