Public Member Functions | Private Attributes
icl_hardware::can::HardwareCanSourcePeak::WorkerThread Class Reference
Inheritance diagram for icl_hardware::can::HardwareCanSourcePeak::WorkerThread:
Inheritance graph
[legend]

List of all members.

Public Member Functions

boost::scoped_ptr< tCanDevice > & canDevice ()
 Access the CAN device.
CanMessageStamped::Ptr get ()
bool hasData () const
 Returns true if the buffer is nonempty.
virtual void run ()
 Worker thread main method which receives the CAN messages.
void setCanMask (const CanMatrix &can_mask)
 Sets the CAN mask used to filter out relevant CAN messages.
void setSingleCanID (uint16_t can_id)
 Sets a single CAN ID used to filter out relevant CAN messages.
 WorkerThread (tCanDevice *can_device, std::size_t max_buffer_size=256)

Private Attributes

icl_core::thread::Mutex m_buffer_mutex
 Synchronizes receive buffer access.
icl_core::thread::Semaphore m_buffer_semaphore
 Handles producer/consumer notification.
boost::scoped_ptr< tCanDevicem_can_device
 The CAN device.
CanMatrix m_can_mask
std::size_t m_dsin
std::size_t m_max_buffer_size
 Buffer size limit.
std::deque
< CanMessageStamped::Ptr
m_recv_buffer
std::size_t m_sequence_number
uint16_t m_single_can_id
bool m_use_can_mask
 If true, m_can_mask is used to filter the CAN stream.

Detailed Description

Internal worker thread which listens to a given CAN device and buffers the received messages.

Definition at line 54 of file HardwareCanSourcePeak.cpp.


Constructor & Destructor Documentation

icl_hardware::can::HardwareCanSourcePeak::WorkerThread::WorkerThread ( tCanDevice can_device,
std::size_t  max_buffer_size = 256 
) [inline]

Definition at line 57 of file HardwareCanSourcePeak.cpp.


Member Function Documentation

Access the CAN device.

Definition at line 83 of file HardwareCanSourcePeak.cpp.

Gets the next CAN message, blocking in case no data is in the buffer.

Definition at line 178 of file HardwareCanSourcePeak.cpp.

Returns true if the buffer is nonempty.

Definition at line 187 of file HardwareCanSourcePeak.cpp.

Worker thread main method which receives the CAN messages.

Implements icl_core::thread::Thread.

Definition at line 133 of file HardwareCanSourcePeak.cpp.

Sets the CAN mask used to filter out relevant CAN messages.

Definition at line 86 of file HardwareCanSourcePeak.cpp.

Sets a single CAN ID used to filter out relevant CAN messages.

Definition at line 93 of file HardwareCanSourcePeak.cpp.


Member Data Documentation

Synchronizes receive buffer access.

Definition at line 108 of file HardwareCanSourcePeak.cpp.

Handles producer/consumer notification.

Definition at line 110 of file HardwareCanSourcePeak.cpp.

The CAN device.

Definition at line 100 of file HardwareCanSourcePeak.cpp.

Only CAN message IDs contained here are passed on to the user.

Note:
If m_single_can_id is non-zero, it has priority over this.

Definition at line 117 of file HardwareCanSourcePeak.cpp.

Current item number. This increments for every CAN message received, even messages that are filtered out.

Definition at line 125 of file HardwareCanSourcePeak.cpp.

Buffer size limit.

Definition at line 106 of file HardwareCanSourcePeak.cpp.

Buffers CAN messages in case they are not consumed quickly enough.

Definition at line 104 of file HardwareCanSourcePeak.cpp.

Current sequence number. This increments for every CAN message that is received and passed on to the user, i.e. not filtered out.

Definition at line 130 of file HardwareCanSourcePeak.cpp.

If non-zero, only this message ID is passed on to the user. This has priority over m_can_mask.

Definition at line 121 of file HardwareCanSourcePeak.cpp.

If true, m_can_mask is used to filter the CAN stream.

Definition at line 112 of file HardwareCanSourcePeak.cpp.


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


fzi_icl_can
Author(s):
autogenerated on Thu Jun 6 2019 20:26:01