#include <socketcan.h>
|
| | SocketCAN ()=default |
| |
| | ~SocketCAN () |
| |
| bool | open (const std::string &interface, boost::function< void(const can_frame &frame)> handler, int thread_priority) |
| | Open and bind socket.
|
| |
| void | close () |
| | Close and unbind socket.
|
| |
| bool | isOpen () const |
| | Returns whether the socket is open or closed.
|
| |
| void | write (can_frame *frame) const |
| | Sends the referenced frame to the bus.
|
| |
| bool | startReceiverThread (int thread_priority) |
| | Starts a new thread, that will wait for socket events.
|
| |
◆ SocketCAN()
| can::SocketCAN::SocketCAN |
( |
| ) |
|
|
default |
◆ ~SocketCAN()
| can::SocketCAN::~SocketCAN |
( |
| ) |
|
◆ close()
| void can::SocketCAN::close |
( |
| ) |
|
◆ isOpen()
| bool can::SocketCAN::isOpen |
( |
| ) |
const |
Returns whether the socket is open or closed.
- Returns
True if socket has opened.
◆ open()
| bool can::SocketCAN::open |
( |
const std::string & | interface, |
|
|
boost::function< void(const can_frame &frame)> | handler, |
|
|
int | thread_priority ) |
Open and bind socket.
- Parameters
-
| interface | bus's name(example: can0). |
| handler | Pointer to a function which shall be called when frames are being received from the CAN bus. |
- Returns
true if it successfully open and bind socket.
◆ startReceiverThread()
| bool can::SocketCAN::startReceiverThread |
( |
int | thread_priority | ) |
|
Starts a new thread, that will wait for socket events.
◆ write()
| void can::SocketCAN::write |
( |
can_frame * | frame | ) |
const |
Sends the referenced frame to the bus.
- Parameters
-
| frame | referenced frame which you want to send. |
◆ receiver_thread_running_
| bool can::SocketCAN::receiver_thread_running_ = false |
◆ reception_handler
| boost::function<void(const can_frame& frame)> can::SocketCAN::reception_handler |
Pointer to a function which shall be called when frames are being received from the CAN bus
◆ sock_fd_
| int can::SocketCAN::sock_fd_ = -1 |
CAN socket file descriptor
◆ terminate_receiver_thread_
| bool can::SocketCAN::terminate_receiver_thread_ = false |
Request for the child thread to terminate
The documentation for this class was generated from the following files: