Public Member Functions | Private Member Functions | Private Attributes
driver_svh::SVHSerialInterface Class Reference

Basic communication handler for the SCHUNK five finger hand. More...

#include <SVHSerialInterface.h>

List of all members.

Public Member Functions

void close ()
 canceling receive thread and closing connection to serial port
bool connect (const std::string &dev_name)
 connecting to serial device and starting receive thread
bool isConnected ()
 returns connected state of serial device
void printPacketOnConsole (SVHSerialPacket &packet)
 printPacketOnConsole is a pure helper function to show what raw data is actually sent. This is not meant for any productive use other than understand whats going on.
void resetTransmitPackageCount ()
 resetTransmitPackageCount Resets the transmitpackage count to zero
bool sendPacket (SVHSerialPacket &packet)
 function for sending packets via serial device to the SVH
 SVHSerialInterface (const ReceivedPacketCallback &received_packet_callback)
 Constructs a serial interface class for basic communication with the SCHUNK five finger hand.
unsigned int transmittedPacketCount ()
 get number of transmitted packets
 ~SVHSerialInterface ()
 Default DTOR.

Private Member Functions

void calcCheckSum (uint8_t &check_sum1, uint8_t &check_sum2, const SVHSerialPacket &packet)
 cecksum calculation

Private Attributes

bool m_connected
 serial device connected state
unsigned int m_dummy_packets_printed
 packet counter simulation for pure showing purposes
unsigned int m_packets_transmitted
 packet counters
boost::shared_ptr
< SVHReceiveThread
m_receive_thread
 thread for receiving serial packets
ReceivedPacketCallback m_received_packet_callback
 Callback function for received packets.
boost::shared_ptr< Serialm_serial_device
 pointer to serial interface object

Detailed Description

Basic communication handler for the SCHUNK five finger hand.

Definition at line 48 of file SVHSerialInterface.h.


Constructor & Destructor Documentation

Constructs a serial interface class for basic communication with the SCHUNK five finger hand.

Parameters:
received_packet_callbackfunction to call whenever a packet was received

Definition at line 40 of file SVHSerialInterface.cpp.

Default DTOR.

Definition at line 47 of file SVHSerialInterface.cpp.


Member Function Documentation

void driver_svh::SVHSerialInterface::calcCheckSum ( uint8_t check_sum1,
uint8_t check_sum2,
const SVHSerialPacket packet 
) [private]

cecksum calculation

canceling receive thread and closing connection to serial port

Definition at line 99 of file SVHSerialInterface.cpp.

bool driver_svh::SVHSerialInterface::connect ( const std::string &  dev_name)

connecting to serial device and starting receive thread

Parameters:
dev_nameFilehandle of the device i.e. dev/ttyUSB0
Returns:
bool true if connection was succesfull

Definition at line 52 of file SVHSerialInterface.cpp.

returns connected state of serial device

Returns:
bool true if the device is connected

Definition at line 76 of file SVHSerialInterface.h.

printPacketOnConsole is a pure helper function to show what raw data is actually sent. This is not meant for any productive use other than understand whats going on.

Parameters:
packetthe prepared Serial Packet(without header information and such)

Definition at line 181 of file SVHSerialInterface.cpp.

resetTransmitPackageCount Resets the transmitpackage count to zero

Definition at line 174 of file SVHSerialInterface.cpp.

function for sending packets via serial device to the SVH

Parameters:
packetthe prepared Serial Packet
Returns:
true if successful

Definition at line 125 of file SVHSerialInterface.cpp.

get number of transmitted packets

Returns:
number of successfully sent packets

Definition at line 89 of file SVHSerialInterface.h.


Member Data Documentation

serial device connected state

Definition at line 105 of file SVHSerialInterface.h.

packet counter simulation for pure showing purposes

Definition at line 123 of file SVHSerialInterface.h.

packet counters

Definition at line 120 of file SVHSerialInterface.h.

thread for receiving serial packets

Definition at line 114 of file SVHSerialInterface.h.

Callback function for received packets.

Definition at line 117 of file SVHSerialInterface.h.

pointer to serial interface object

Definition at line 108 of file SVHSerialInterface.h.


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


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Fri Aug 28 2015 12:59:20