#include <sick_tim_common_tcp.h>
Public Member Functions | |
SickTimCommonTcp (const std::string &hostname, const std::string &port, int &timelimit, AbstractParser *parser) | |
virtual | ~SickTimCommonTcp () |
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_ |
std::string | port_ |
boost::asio::ip::tcp::socket | socket_ |
int | timelimit_ |
Definition at line 48 of file sick_tim_common_tcp.h.
sick_tim::SickTimCommonTcp::SickTimCommonTcp | ( | const std::string & | hostname, |
const std::string & | port, | ||
int & | timelimit, | ||
AbstractParser * | parser | ||
) |
Definition at line 45 of file sick_tim_common_tcp.cpp.
sick_tim::SickTimCommonTcp::~SickTimCommonTcp | ( | ) | [virtual] |
Definition at line 61 of file sick_tim_common_tcp.cpp.
void sick_tim::SickTimCommonTcp::checkDeadline | ( | ) | [protected] |
Definition at line 145 of file sick_tim_common_tcp.cpp.
int sick_tim::SickTimCommonTcp::close_device | ( | ) | [protected, virtual] |
Implements sick_tim::SickTimCommon.
Definition at line 129 of file sick_tim_common_tcp.cpp.
int sick_tim::SickTimCommonTcp::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_tim::SickTimCommon.
Definition at line 269 of file sick_tim_common_tcp.cpp.
void sick_tim::SickTimCommonTcp::handleRead | ( | boost::system::error_code | error, |
size_t | bytes_transfered | ||
) | [inline, protected] |
Definition at line 87 of file sick_tim_common_tcp.h.
int sick_tim::SickTimCommonTcp::init_device | ( | ) | [protected, virtual] |
Implements sick_tim::SickTimCommon.
Definition at line 71 of file sick_tim_common_tcp.cpp.
int sick_tim::SickTimCommonTcp::readWithTimeout | ( | size_t | timeout_ms, |
char * | buffer, | ||
int | buffer_size, | ||
int * | bytes_read = 0 , |
||
bool * | exception_occured = 0 |
||
) | [protected] |
Definition at line 159 of file sick_tim_common_tcp.cpp.
int sick_tim::SickTimCommonTcp::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_tim::SickTimCommon.
Definition at line 227 of file sick_tim_common_tcp.cpp.
size_t sick_tim::SickTimCommonTcp::bytes_transfered_ [private] |
Definition at line 80 of file sick_tim_common_tcp.h.
boost::asio::deadline_timer sick_tim::SickTimCommonTcp::deadline_ [private] |
Definition at line 77 of file sick_tim_common_tcp.h.
boost::system::error_code sick_tim::SickTimCommonTcp::ec_ [private] |
Definition at line 79 of file sick_tim_common_tcp.h.
std::string sick_tim::SickTimCommonTcp::hostname_ [private] |
Definition at line 82 of file sick_tim_common_tcp.h.
boost::asio::streambuf sick_tim::SickTimCommonTcp::input_buffer_ [private] |
Definition at line 78 of file sick_tim_common_tcp.h.
boost::asio::io_service sick_tim::SickTimCommonTcp::io_service_ [private] |
Definition at line 75 of file sick_tim_common_tcp.h.
std::string sick_tim::SickTimCommonTcp::port_ [private] |
Definition at line 83 of file sick_tim_common_tcp.h.
boost::asio::ip::tcp::socket sick_tim::SickTimCommonTcp::socket_ [private] |
Definition at line 76 of file sick_tim_common_tcp.h.
int sick_tim::SickTimCommonTcp::timelimit_ [private] |
Definition at line 84 of file sick_tim_common_tcp.h.