44#include <boost/function.hpp>
51 ifreq interface_request_{};
52 sockaddr_can address_{};
53 pthread_t receiver_thread_id_{};
76 bool open(
const std::string& interface, boost::function<
void(
const can_frame& frame)> handler,
int thread_priority);
90 void write(can_frame* frame)
const;
Definition socketcan.h:49
bool isOpen() const
Returns whether the socket is open or closed.
Definition socketcan.cpp:106
bool receiver_thread_running_
Definition socketcan.h:64
int sock_fd_
Definition socketcan.h:59
void close()
Close and unbind socket.
Definition socketcan.cpp:93
bool open(const std::string &interface, boost::function< void(const can_frame &frame)> handler, int thread_priority)
Open and bind socket.
Definition socketcan.cpp:57
boost::function< void(const can_frame &frame)> reception_handler
Definition socketcan.h:99
~SocketCAN()
Definition socketcan.cpp:51
bool terminate_receiver_thread_
Definition socketcan.h:63
void write(can_frame *frame) const
Sends the referenced frame to the bus.
Definition socketcan.cpp:111
bool startReceiverThread(int thread_priority)
Starts a new thread, that will wait for socket events.
Definition socketcan.cpp:162
Definition socketcan.h:47