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 );
162 void SetTimeout(
double _timeout );
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
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.
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.
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.
Class for short, fixed maximum length text messages.
cTCPSerialException(cMsg const &_msg)