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

#include <sick_tim_common_usb.h>

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

Public Member Functions

 SickTimCommonUsb (AbstractParser *parser, int device_number)
 
virtual ~SickTimCommonUsb ()
 
- 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

virtual int close_device ()
 
virtual int get_datagram (unsigned char *receiveBuffer, int bufferSize, int *actual_length)
 Read a datagram from the device. More...
 
virtual int init_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. 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 Member Functions

void freeSOPASDeviceList (libusb_device **list)
 
ssize_t getSOPASDeviceList (libusb_context *ctx, uint16_t vendorID, uint16_t productID, libusb_device ***list)
 
void printSOPASDeviceInformation (ssize_t numberOfDevices, libusb_device **devices)
 
void printUSBDeviceDetails (struct libusb_device_descriptor desc)
 
void printUSBInterfaceDetails (libusb_device *device)
 

Private Attributes

libusb_context * ctx_
 
libusb_device_handle * device_handle_
 
int device_number_
 
libusb_device ** devices_
 
ssize_t numberOfDevices_
 

Static Private Attributes

static const unsigned int USB_TIMEOUT = 1000
 

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 52 of file sick_tim_common_usb.h.

Constructor & Destructor Documentation

sick_tim::SickTimCommonUsb::SickTimCommonUsb ( AbstractParser parser,
int  device_number 
)

Definition at line 44 of file sick_tim_common_usb.cpp.

sick_tim::SickTimCommonUsb::~SickTimCommonUsb ( )
virtual

Definition at line 49 of file sick_tim_common_usb.cpp.

Member Function Documentation

int sick_tim::SickTimCommonUsb::close_device ( )
protectedvirtual

Implements sick_tim::SickTimCommon.

Definition at line 55 of file sick_tim_common_usb.cpp.

void sick_tim::SickTimCommonUsb::freeSOPASDeviceList ( libusb_device **  list)
private

Definition at line 152 of file sick_tim_common_usb.cpp.

int sick_tim::SickTimCommonUsb::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 411 of file sick_tim_common_usb.cpp.

ssize_t sick_tim::SickTimCommonUsb::getSOPASDeviceList ( libusb_context *  ctx,
uint16_t  vendorID,
uint16_t  productID,
libusb_device ***  list 
)
private

Returns a list of USB devices currently attached to the system and matching the given vendorID and productID.

Definition at line 90 of file sick_tim_common_usb.cpp.

int sick_tim::SickTimCommonUsb::init_device ( )
protectedvirtual

Implements sick_tim::SickTimCommon.

Definition at line 316 of file sick_tim_common_usb.cpp.

void sick_tim::SickTimCommonUsb::printSOPASDeviceInformation ( ssize_t  numberOfDevices,
libusb_device **  devices 
)
private

Print the USB device information of the connected TIM3xx devices to the console.

Definition at line 230 of file sick_tim_common_usb.cpp.

void sick_tim::SickTimCommonUsb::printUSBDeviceDetails ( struct libusb_device_descriptor  desc)
private

Definition at line 168 of file sick_tim_common_usb.cpp.

void sick_tim::SickTimCommonUsb::printUSBInterfaceDetails ( libusb_device *  device)
private

Definition at line 178 of file sick_tim_common_usb.cpp.

int sick_tim::SickTimCommonUsb::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 263 of file sick_tim_common_usb.cpp.

Member Data Documentation

libusb_context* sick_tim::SickTimCommonUsb::ctx_
private

Definition at line 84 of file sick_tim_common_usb.h.

libusb_device_handle* sick_tim::SickTimCommonUsb::device_handle_
private

Definition at line 87 of file sick_tim_common_usb.h.

int sick_tim::SickTimCommonUsb::device_number_
private

Definition at line 88 of file sick_tim_common_usb.h.

libusb_device** sick_tim::SickTimCommonUsb::devices_
private

Definition at line 86 of file sick_tim_common_usb.h.

ssize_t sick_tim::SickTimCommonUsb::numberOfDevices_
private

Definition at line 85 of file sick_tim_common_usb.h.

const unsigned int sick_tim::SickTimCommonUsb::USB_TIMEOUT = 1000
staticprivate

Definition at line 74 of file sick_tim_common_usb.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 Wed Jun 17 2020 04:05:36