38 # include <sys/timeb.h> 42 # include <sys/time.h> 103 static const int INVALID_SOCKET = -1;
107 struct timeval timeout_timeval;
126 cTCPSerial(
char const* _tcp_adr,
int _tcp_port,
double _timeout );
149 int write(
char const *ptr,
int len=0 );
159 ssize_t
Read(
void *data, ssize_t
size,
long timeout_us,
bool return_on_less_data );
170 return WSAGetLastError();
static long const TIMEOUT_RETURN_IMMEDITELY_US
virtual bool IsOpen(void)=0
Return true if communication channel is open.
long timeout_us
cached timeout in us for read()
static double const TIMEOUT_WAIT_FOR_EVER_S
virtual void SetTimeout(double _timeout)
set the timeout for next readline() calls (negative value means: no timeout, wait for ever) ...
int tErrorCode
type of the error code, DWORD on windows and int on Linux/cygwin
Interface of the exception base class #SDH::cSDHLibraryException and #SDH::cMsg.
virtual tErrorCode GetErrorNumber()
static long const TIMEOUT_WAIT_FOR_EVER_US
Derived exception class for low-level CAN ESD related exceptions.
Low-level communication class to access a serial port.
#define NAMESPACE_SDH_START
int tcp_port
the TCP port to use
Low-level communication class to access a CAN port.
virtual int write(char const *ptr, int len=0)=0
Write data to a previously opened port.
int fd
the file descriptor of the socket
#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.
This file contains some basic definitions (defines, macros, datatypes)
Interface of class #SDH::cSerialBase, a virtal base class to access serial communication channels lik...
static double const TIMEOUT_RETURN_IMMEDITELY_S
Derived exception class for low-level serial communication 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
cTCPSerialException(cMsg const &_msg)