35 #ifndef SICK_TIM3XX_COMMON_TCP_H 36 #define SICK_TIM3XX_COMMON_TCP_H 41 #include <boost/asio.hpp> 59 virtual int sendSOPASCommand(
const char* request, std::vector<unsigned char> * reply);
67 virtual int get_datagram(
unsigned char* receiveBuffer,
int bufferSize,
int* actual_length);
70 int readWithTimeout(
size_t timeout_ms,
char *buffer,
int buffer_size,
int *bytes_read = 0,
bool *exception_occured = 0);
71 void handleRead(boost::system::error_code
error,
size_t bytes_transfered);
79 boost::system::error_code
ec_;
int readWithTimeout(size_t timeout_ms, char *buffer, int buffer_size, int *bytes_read=0, bool *exception_occured=0)
boost::asio::streambuf input_buffer_
boost::system::error_code ec_
boost::asio::io_service io_service_
boost::asio::ip::tcp::socket socket_
virtual ~SickTimCommonTcp()
virtual int get_datagram(unsigned char *receiveBuffer, int bufferSize, int *actual_length)
Read a datagram from the device.
virtual int close_device()
virtual int sendSOPASCommand(const char *request, std::vector< unsigned char > *reply)
Send a SOPAS command to the device and print out the response to the console.
SickTimCommonTcp(const std::string &hostname, const std::string &port, int &timelimit, AbstractParser *parser)
boost::asio::deadline_timer deadline_
void handleRead(boost::system::error_code error, size_t bytes_transfered)
virtual int init_device()