15 *(uint32_t*)
this = val;
20 const uint32_t
get()
const {
return *(uint32_t*)
this; }
24 uint32_t error_code:16;
25 uint32_t addition_info:16;
27 *(uint32_t*)
this = val;
34 uint8_t manufacturer_specific_error_field[5];
67 if(current_state ==
Ready){
69 status.
error(
"Node has emergency error");
78 uint8_t error_register = 0;
80 report.
error(
"Could not read error error_register");
85 if(error_register & 1){
86 report.
error(
"Node has emergency error");
87 }
else if(error_register & ~32){
88 report.
warn(
"Error register is not zero");
90 report.
add(
"error_register", (uint32_t) error_register);
93 std::stringstream buf;
94 for(
size_t i = 0; i < num; ++i) {
102 buf << std::hex << field.
error_code <<
"#" << field.addition_info;
104 catch (
const std::out_of_range & e){
105 buf <<
"NOT_IN_DICT!";
108 buf <<
"LIST_UNDERFLOW!";
113 report.
add(
"errors", buf.str());
118 uint8_t error_register = 0;
120 status.
error(
"Could not read error error_register");
122 }
else if(error_register & 1){
123 LOG(
"ER: " <<
int(error_register));
124 status.
error(
"Node has emergency error");
EMCYHandler(const can::CommInterfaceSharedPtr interface, const ObjectStorageSharedPtr storage)
std::string tostring(const Header &h, bool lc)
Frame(const can::Frame &f)
virtual void handleHalt(LayerStatus &status)
const void warn(const std::string &r)
ObjectStorage::Entry< uint8_t > num_errors_
boost::atomic< bool > has_error_
virtual void handleWrite(LayerStatus &status, const LayerState ¤t_state)
void handleEMCY(const can::Frame &msg)
boost::shared_ptr< CommInterface > CommInterfaceSharedPtr
can::FrameListenerConstSharedPtr emcy_listener_
virtual void handleRecover(LayerStatus &status)
virtual void handleInit(LayerStatus &status)
fastdelegate::FastDelegate1< const Frame & > FrameDelegate
void resetErrors(LayerStatus &status)
virtual void handleDiag(LayerReport &report)
const ObjectStorageSharedPtr storage_
ObjectStorage::Entry< uint8_t > error_register_
void add(const std::string &key, const T &value)
virtual void handleShutdown(LayerStatus &status)
const void error(const std::string &r)
ObjectStorage::ObjectStorageSharedPtr ObjectStorageSharedPtr
virtual void handleRead(LayerStatus &status, const LayerState ¤t_state)