Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to disable specific error types in SocketCANInterface #302

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions socketcan_interface/include/socketcan_interface/socketcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,9 @@ class SocketCANInterface : public AsioDriver<boost::asio::posix::stream_descript
if(frame_.can_id & CAN_ERR_FLAG){ // error message
input_.id = frame_.can_id & CAN_EFF_MASK;
input_.is_error = 1;

LOG("error: " << input_.id);
setInternalError(input_.id);
setNotReady();

handleErrorFrame();
}else{
input_.is_extended = (frame_.can_id & CAN_EFF_FLAG) ? 1 :0;
input_.id = frame_.can_id & (input_.is_extended ? CAN_EFF_MASK : CAN_SFF_MASK);
Expand All @@ -214,6 +212,11 @@ class SocketCANInterface : public AsioDriver<boost::asio::posix::stream_descript
}
frameReceived(error);
}

virtual void handleErrorFrame(){
setInternalError(input_.id);
setNotReady();
}
private:
boost::mutex send_mutex_;
};
Expand Down