Public Member Functions | Private Types | Private Member Functions | Private Attributes
driver_svh::SVHReceiveThread Class Reference

Thread for receiving messages from the serial device. More...

#include <SVHReceiveThread.h>

Inheritance diagram for driver_svh::SVHReceiveThread:
Inheritance graph
[legend]

List of all members.

Public Member Functions

unsigned int receivedPacketCount ()
 return the count of received packets
void resetReceivedPackageCount ()
 resetReceivedPackageCount Resets the received package count to zero. This can be usefull to set all communication variables to the initial state
virtual void run ()
 run method of the thread, executes the main program
 SVHReceiveThread (const TimeSpan &period, boost::shared_ptr< Serial > device, ReceivedPacketCallback const &received_callback)
 SVHReceiveThread Constructs a new Receivethread.
virtual ~SVHReceiveThread ()
 Default DTOR.

Private Types

enum  tState {
  eRS_HEADER1, eRS_HEADER2, eRS_INDEX, eRS_ADDRESS,
  eRS_LENGTH, eRS_DATA, eRS_CHECKSUM, eRS_COMPLETE
}
 enum for receive packet state machine states More...

Private Member Functions

bool receiveData ()
 state machine processing received data

Private Attributes

icl_comm::ArrayBuilder m_ab
 pointer to array builder object for packet receive
std::vector< uint8_tm_data
 length of received serial data
uint16_t m_length
 length of received serial data
unsigned int m_packets_received
 packets counter
ReceivedPacketCallback m_received_callback
 function callback for received packages
tState m_received_state
 current state of the state machine
boost::shared_ptr< Serial > m_serial_device
 pointer to serial device object

Detailed Description

Thread for receiving messages from the serial device.

Definition at line 56 of file SVHReceiveThread.h.


Member Enumeration Documentation

enum for receive packet state machine states

Enumerator:
eRS_HEADER1 
eRS_HEADER2 
eRS_INDEX 
eRS_ADDRESS 
eRS_LENGTH 
eRS_DATA 
eRS_CHECKSUM 
eRS_COMPLETE 

Definition at line 89 of file SVHReceiveThread.h.


Constructor & Destructor Documentation

driver_svh::SVHReceiveThread::SVHReceiveThread ( const TimeSpan period,
boost::shared_ptr< Serial >  device,
ReceivedPacketCallback const &  received_callback 
)

SVHReceiveThread Constructs a new Receivethread.

Parameters:
periodThe relative period after which the thread is cyclically woken up.
devicehandle of the serial device
received_callbackfunction to call uppon finished packet

Definition at line 38 of file SVHReceiveThread.cpp.

virtual driver_svh::SVHReceiveThread::~SVHReceiveThread ( ) [inline, virtual]

Default DTOR.

Definition at line 70 of file SVHReceiveThread.h.


Member Function Documentation

state machine processing received data

Definition at line 72 of file SVHReceiveThread.cpp.

return the count of received packets

Definition at line 76 of file SVHReceiveThread.h.

resetReceivedPackageCount Resets the received package count to zero. This can be usefull to set all communication variables to the initial state

Definition at line 81 of file SVHReceiveThread.h.

run method of the thread, executes the main program

Implements icl_core::thread::Thread.

Definition at line 50 of file SVHReceiveThread.cpp.


Member Data Documentation

icl_comm::ArrayBuilder driver_svh::SVHReceiveThread::m_ab [private]

pointer to array builder object for packet receive

Definition at line 111 of file SVHReceiveThread.h.

length of received serial data

Definition at line 108 of file SVHReceiveThread.h.

length of received serial data

Definition at line 105 of file SVHReceiveThread.h.

packets counter

Definition at line 114 of file SVHReceiveThread.h.

function callback for received packages

Definition at line 120 of file SVHReceiveThread.h.

current state of the state machine

Definition at line 102 of file SVHReceiveThread.h.

boost::shared_ptr<Serial> driver_svh::SVHReceiveThread::m_serial_device [private]

pointer to serial device object

Definition at line 86 of file SVHReceiveThread.h.


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


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Fri Apr 28 2017 02:31:09