30 #ifndef DRIVER_SVH_SVH_RECEIVE_THREAD_H_INCLUDED 31 #define DRIVER_SVH_SVH_RECEIVE_THREAD_H_INCLUDED 35 #include <icl_comm_serial/Serial.h> 36 #include <icl_comm/ByteOrderConversion.h> 41 #include <boost/function.hpp> 42 #include <boost/shared_ptr.hpp> 46 using icl_comm::serial::Serial;
67 ReceivedPacketCallback
const & received_callback);
std::vector< uint8_t > m_data
length of received serial data
tState m_received_state
current state of the state machine
boost::function< void(const SVHSerialPacket &packet, unsigned int packet_count)> ReceivedPacketCallback
definition of boost function callback for received packages
unsigned int m_skipped_bytes
counter for skipped bytes in case no packet is detected
ReceivedPacketCallback m_received_callback
function callback for received packages
bool receiveData()
state machine processing received data
void resetReceivedPackageCount()
resetReceivedPackageCount Resets the received package count to zero. This can be usefull to set all c...
tState
enum for receive packet state machine states
virtual void run()
run method of the thread, executes the main program
unsigned int receivedPacketCount()
return the count of received packets
uint16_t m_length
length of received serial data
Thread for receiving messages from the serial device.
virtual ~SVHReceiveThread()
Default DTOR.
unsigned int m_packets_received
packets counter
SVHReceiveThread(const TimeSpan &period, boost::shared_ptr< Serial > device, ReceivedPacketCallback const &received_callback)
SVHReceiveThread Constructs a new Receivethread.
boost::shared_ptr< Serial > m_serial_device
pointer to serial device object
icl_core::TimeSpan period() const
uint8_t m_checksum1
Checksum of packet.
icl_comm::ArrayBuilder m_ab
pointer to array builder object for packet receive