32 #include <boost/test/included/unit_test.hpp> 36 BOOST_AUTO_TEST_SUITE( ts_emcy )
49 "-----Running EMCY test-----" <<
endl <<
50 "---------------------------" <<
endl);
79 can_device->addResponse(msg,
false);
82 boost::this_thread::sleep(boost::posix_time::milliseconds(100));
86 std::vector<uint8_t> msef_ret;
87 BOOST_REQUIRE( node->m_emcy->getErrorInformation(eec_ret, error_register_ret, msef_ret));
89 BOOST_REQUIRE( eec_ret == msg.
data[0] + (msg.
data[1] << 8) );
90 BOOST_REQUIRE( error_register_ret == msg.
data[2]);
91 BOOST_REQUIRE( msef_ret[0] == msg.
data[3]);
92 BOOST_REQUIRE( msef_ret[1] == msg.
data[4]);
93 BOOST_REQUIRE( msef_ret[2] == msg.
data[5]);
94 BOOST_REQUIRE( msef_ret[3] == msg.
data[6]);
95 BOOST_REQUIRE( msef_ret[4] == msg.
data[7]);
102 can_device->addResponse(msg,
false);
105 boost::this_thread::sleep(boost::posix_time::milliseconds(100));
108 BOOST_REQUIRE( !(node->m_emcy->getErrorInformation(eec_ret, error_register_ret, msef_ret)));
116 can_device->addResponse(msg,
false);
117 boost::this_thread::sleep(boost::posix_time::milliseconds(100));
120 can_device->addResponse(msg,
false);
121 BOOST_REQUIRE( !(node->m_emcy->getErrorInformation(eec_ret, error_register_ret, msef_ret)));
124 boost::this_thread::sleep(boost::posix_time::milliseconds(100));
128 can_device->addResponse(msg,
false);
129 BOOST_REQUIRE( !(node->m_emcy->getErrorInformation(eec_ret, error_register_ret, msef_ret)));
132 boost::this_thread::sleep(boost::posix_time::milliseconds(100));
138 BOOST_AUTO_TEST_SUITE_END()
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
BOOST_AUTO_TEST_CASE(message_parsing)
CanDevPtr getCanDevice() const
Get a handle to the current CAN device. This is basically for debugging with a Dummy Can Device...
#define LOGGING_INFO(streamname, arg)
The DS301Group class is the base Class for all canOpen device groups, providing basic interfaces to t...
The CanOpenController class is the main entry point for any calls to the canOpen System.
static const uint16_t ID_EMCY_MIN
ThreadStream & endl(ThreadStream &stream)
void setLogLevel(icl_core::logging::LogLevel log_level)
boost::shared_ptr< GroupT > getGroup(const std::string &index="default")
Returns a shared pointer to the group with a given index if possible.
void addNode(const uint8_t node_id, const std::string &group_name="default")
Adds a new node to a group. If the group is not found (e.g. it was not created before), nothing will be done.
void addGroup(const std::string &identifier)
Adds a new node group with a given identifier. The group's type is given as template parameter...
The DS301Node class Is the base class representation of canOpen devices. It is the access point to th...