25 #ifndef ICL_HARDWARE_CAN_SOURCE_HARDWARE_CAN_SOURCE_TEST_H_INCLUDED 26 #define ICL_HARDWARE_CAN_SOURCE_HARDWARE_CAN_SOURCE_TEST_H_INCLUDED 30 #include <boost/date_time/posix_time/posix_time.hpp> 31 #include <boost/random.hpp> 48 typedef boost::shared_ptr<HardwareCanSourceTest>
Ptr;
50 typedef boost::shared_ptr<const HardwareCanSourceTest>
ConstPtr;
64 P_CHANGING_WITH_REPEAT
76 using namespace icl_sourcesink;
82 "Test source for CAN message data.",
83 "can+test:[?rate=<rate>][&pattern=<pattern>][&id_value=<id_value>]",
84 "<rate> Data generation rate in Hz.\n" 85 "<pattern> One of 'Linear' (default), 'Fixed', 'ChangingRandom', 'ChangingWithRepeat'.\n" 86 "<id_value> In Fixed mode, the ID to generate (default: 1).\n")));
105 const std::string& name =
"HardwareCanSourceTest");
108 friend class icl_sourcesink::SourceSinkManager;
119 unsigned int createCanMessageId();
Pattern m_pattern
The message generation pattern.
boost::random::uniform_int_distribution< unsigned int > m_can_id_distribution
Uniform distribution over possible CAN IDs.
icl_sourcesink::DataSource< tCanMessage > HardwareCanSource
Base type for all sources providing tCanMessage data.
virtual bool isSeekable() const
This is a non-seekable source.
#define ICL_HARDWARE_CAN_SOURCE_IMPORT_EXPORT
uint16_t m_next_id
The next CAN message ID to be used.
float m_rate
Data generation rate in Hz.
boost::shared_ptr< Stamped< DataType > > Ptr
Contains CAN driver interface functions.
static icl_sourcesink::URISchemeMap supportedURISchemes()
URI schemes supported by this source.
CanMessageStamped::Ptr m_buffer
Buffers the latest generated message.
boost::random::uniform_int_distribution< uint8_t > m_data_distribution
Uniform distribution over possible payload bytes.
boost::shared_ptr< const HardwareCanSourceTest > ConstPtr
Const shared pointer shorthand.
boost::shared_ptr< HardwareCanSourceTest > Ptr
Shared pointer shorthand.
virtual bool good() const
Always returns true for the test source.
The IDs will be created randomly (seed is fixed).
boost::random::mt19937 m_rng
Random number generator.
A fixed ID is sent at all times.
Pattern
Different test patterns.