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_LENGTH1, eRS_LENGTH2, eRS_DATA, eRS_CHECKSUM1,
  eRS_CHECKSUM2
}
 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
uint8_t m_checksum1
 Checksum of packet.
uint8_t m_checksum2
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< Serialm_serial_device
 pointer to serial device object
unsigned int m_skipped_bytes
 counter for skipped bytes in case no packet is detected

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_LENGTH1 
eRS_LENGTH2 
eRS_DATA 
eRS_CHECKSUM1 
eRS_CHECKSUM2 

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 80 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 51 of file SVHReceiveThread.cpp.


Member Data Documentation

pointer to array builder object for packet receive

Definition at line 115 of file SVHReceiveThread.h.

Checksum of packet.

Definition at line 108 of file SVHReceiveThread.h.

Definition at line 109 of file SVHReceiveThread.h.

length of received serial data

Definition at line 112 of file SVHReceiveThread.h.

length of received serial data

Definition at line 106 of file SVHReceiveThread.h.

packets counter

Definition at line 118 of file SVHReceiveThread.h.

function callback for received packages

Definition at line 126 of file SVHReceiveThread.h.

current state of the state machine

Definition at line 103 of file SVHReceiveThread.h.

pointer to serial device object

Definition at line 86 of file SVHReceiveThread.h.

counter for skipped bytes in case no packet is detected

Definition at line 120 of file SVHReceiveThread.h.


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


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Thu Jun 6 2019 18:29:08