Public Member Functions | Protected Member Functions | Private Attributes | List of all members
sick_tim::SickTimCommonTcp Class Reference

#include <sick_tim_common_tcp.h>

Inheritance diagram for sick_tim::SickTimCommonTcp:
Inheritance graph
[legend]

Public Member Functions

 SickTimCommonTcp (const std::string &hostname, const std::string &port, int &timelimit, AbstractParser *parser)
 
virtual ~SickTimCommonTcp ()
 
- Public Member Functions inherited from sick_tim::SickTimCommon
void check_angle_range (SickTimConfig &conf)
 
double get_expected_frequency () const
 
virtual int init ()
 
virtual int loopOnce ()
 
virtual bool rebootScanner ()
 Send a SOPAS command to the scanner that should cause a soft reset. More...
 
 SickTimCommon (AbstractParser *parser)
 
void update_config (sick_tim::SickTimConfig &new_config, uint32_t level=0)
 
virtual ~SickTimCommon ()
 

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. More...
 
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. More...
 
- Protected Member Functions inherited from sick_tim::SickTimCommon
virtual int init_scanner ()
 
bool isCompatibleDevice (const std::string identStr) const
 
virtual int stop_scanner ()
 

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_
 

Additional Inherited Members

- Static Protected Member Functions inherited from sick_tim::SickTimCommon
static std::string replyToString (const std::vector< unsigned char > &reply)
 Converts reply from sendSOPASCommand to string. More...
 
- Protected Attributes inherited from sick_tim::SickTimCommon
SickTimConfig config_
 
ros::Publisher datagram_pub_
 
diagnostic_updater::DiagnosedPublisher< sensor_msgs::LaserScan > * diagnosticPub_
 
diagnostic_updater::Updater diagnostics_
 
double expectedFrequency_
 
bool publish_datagram_
 

Detailed Description

Definition at line 48 of file sick_tim_common_tcp.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

void sick_tim::SickTimCommonTcp::checkDeadline ( )
protected

Definition at line 145 of file sick_tim_common_tcp.cpp.

int sick_tim::SickTimCommonTcp::close_device ( )
protectedvirtual

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 
)
protectedvirtual

Read a datagram from the device.

Parameters
[in]receiveBufferdata buffer to fill
[in]bufferSizemax data size to write to buffer (result should be 0 terminated)
[out]actual_lengththe 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 
)
inlineprotected

Definition at line 87 of file sick_tim_common_tcp.h.

int sick_tim::SickTimCommonTcp::init_device ( )
protectedvirtual

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 
)
protectedvirtual

Send a SOPAS command to the device and print out the response to the console.

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.

Member Data Documentation

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.


The documentation for this class was generated from the following files:


sick_tim
Author(s): Jochen Sprickerhof , Martin Günther , Sebastian Pütz
autogenerated on Tue May 7 2019 03:13:47