#include <sick_tim3xx_common_tcp.h>
Public Member Functions | |
SickTim3xxCommonTcp (const std::string &hostname, AbstractParser *parser) | |
virtual | ~SickTim3xxCommonTcp () |
Protected Member Functions | |
void | checkDeadline () |
virtual int | close_device () |
virtual int | get_datagram (unsigned char *receiveBuffer, int bufferSize, int *actual_length) |
Read a datagram from the device. | |
void | handleRead (boost::system::error_code error, size_t bytes_transfered) |
virtual int | init_device () |
int | readWithTimeout (size_t timeout_ms, char *buffer, int buffer_size, int *bytes_read=0, bool *exception_occured=0) |
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. | |
Private Attributes | |
size_t | bytes_transfered_ |
boost::asio::deadline_timer | deadline_ |
boost::system::error_code | ec_ |
std::string | hostname_ |
boost::asio::streambuf | input_buffer_ |
boost::asio::io_service | io_service_ |
boost::asio::ip::tcp::socket | socket_ |
Definition at line 48 of file sick_tim3xx_common_tcp.h.
sick_tim3xx::SickTim3xxCommonTcp::SickTim3xxCommonTcp | ( | const std::string & | hostname, |
AbstractParser * | parser | ||
) |
Definition at line 45 of file sick_tim3xx_common_tcp.cpp.
sick_tim3xx::SickTim3xxCommonTcp::~SickTim3xxCommonTcp | ( | ) | [virtual] |
Definition at line 59 of file sick_tim3xx_common_tcp.cpp.
void sick_tim3xx::SickTim3xxCommonTcp::checkDeadline | ( | ) | [protected] |
Definition at line 142 of file sick_tim3xx_common_tcp.cpp.
int sick_tim3xx::SickTim3xxCommonTcp::close_device | ( | ) | [protected, virtual] |
Implements sick_tim3xx::SickTim3xxCommon.
Definition at line 126 of file sick_tim3xx_common_tcp.cpp.
int sick_tim3xx::SickTim3xxCommonTcp::get_datagram | ( | unsigned char * | receiveBuffer, |
int | bufferSize, | ||
int * | actual_length | ||
) | [protected, virtual] |
Read a datagram from the device.
[in] | receiveBuffer | data buffer to fill |
[in] | bufferSize | max data size to write to buffer (result should be 0 terminated) |
[out] | actual_length | the actual amount of data written |
Implements sick_tim3xx::SickTim3xxCommon.
Definition at line 266 of file sick_tim3xx_common_tcp.cpp.
void sick_tim3xx::SickTim3xxCommonTcp::handleRead | ( | boost::system::error_code | error, |
size_t | bytes_transfered | ||
) | [inline, protected] |
Definition at line 85 of file sick_tim3xx_common_tcp.h.
int sick_tim3xx::SickTim3xxCommonTcp::init_device | ( | ) | [protected, virtual] |
Implements sick_tim3xx::SickTim3xxCommon.
Definition at line 69 of file sick_tim3xx_common_tcp.cpp.
int sick_tim3xx::SickTim3xxCommonTcp::readWithTimeout | ( | size_t | timeout_ms, |
char * | buffer, | ||
int | buffer_size, | ||
int * | bytes_read = 0 , |
||
bool * | exception_occured = 0 |
||
) | [protected] |
Definition at line 156 of file sick_tim3xx_common_tcp.cpp.
int sick_tim3xx::SickTim3xxCommonTcp::sendSOPASCommand | ( | const char * | request, |
std::vector< unsigned char > * | reply | ||
) | [protected, virtual] |
Send a SOPAS command to the device and print out the response to the console.
Implements sick_tim3xx::SickTim3xxCommon.
Definition at line 224 of file sick_tim3xx_common_tcp.cpp.
size_t sick_tim3xx::SickTim3xxCommonTcp::bytes_transfered_ [private] |
Definition at line 80 of file sick_tim3xx_common_tcp.h.
boost::asio::deadline_timer sick_tim3xx::SickTim3xxCommonTcp::deadline_ [private] |
Definition at line 77 of file sick_tim3xx_common_tcp.h.
boost::system::error_code sick_tim3xx::SickTim3xxCommonTcp::ec_ [private] |
Definition at line 79 of file sick_tim3xx_common_tcp.h.
std::string sick_tim3xx::SickTim3xxCommonTcp::hostname_ [private] |
Definition at line 82 of file sick_tim3xx_common_tcp.h.
boost::asio::streambuf sick_tim3xx::SickTim3xxCommonTcp::input_buffer_ [private] |
Definition at line 78 of file sick_tim3xx_common_tcp.h.
boost::asio::io_service sick_tim3xx::SickTim3xxCommonTcp::io_service_ [private] |
Definition at line 75 of file sick_tim3xx_common_tcp.h.
boost::asio::ip::tcp::socket sick_tim3xx::SickTim3xxCommonTcp::socket_ [private] |
Definition at line 76 of file sick_tim3xx_common_tcp.h.