41 can_socket_interface::native_handle handle();
43#error "Unsupported OS"
59 std::optional<can_adapter>
adapter()
const;
133 std::chrono::milliseconds timeout = std::chrono::milliseconds::zero())
const;
148 std::chrono::milliseconds timeout);
151 friend class can_socket_impl;
152 std::shared_ptr<can_socket_interface> _impl;
The CAN interface setup class.
Definition can_adapter.h:47
void set_receive_callback(const can_socket_recv_callback &cb)
Set the receive callback object. See can_socket::receive.
std::errc bind(const can_adapter &adapter)
Open the socket and bind to an adapter.
std::errc set_nonblocking()
Make the socket non-blocking.
can_socket & operator=(can_socket &&)=default
Constructors and assignment operators.
receive_result receive(can_msg_frame &frame, std::chrono::milliseconds timeout=std::chrono::milliseconds::zero()) const
Receive a CAN frame.
std::errc send(const can_msg_frame &frame) const
Send a CAN frame.
std::errc close()
Close the socket.
bool is_open()
Check if the socket is open.
can_socket()
Constructors and assignment operators.
std::errc set_blocking()
Make the socket blocking.
std::errc enable_error_frames()
Allow CAN Error Frames to pass up to the application via this socket.
static select_result_can select_receive_timeout(const std::vector< can_socket > &sockets, std::chrono::milliseconds timeout)
Listen on an array of sockets until one of them receives a CAN frame or the timeout expires.
std::errc disable_error_frames()
Filter out Error CAN frames.
std::optional< can_adapter > adapter() const
Get the adapter this socket is bound to.
can_socket & operator=(const can_socket &)=default
Constructors and assignment operators.
can_socket(const can_socket &)=default
Constructors and assignment operators.
can_socket(can_socket &&)=default
Constructors and assignment operators.
std::function< std::errc(can_msg_frame)> can_socket_recv_callback
A callback function to be called when a message is successfully ready from a socket.
Definition can_socket_interface.h:50
Any entities that belong to the comms library.
Definition can_adapter.h:11
CAN frame structure.
Definition can_common.h:32
Result to receiving a message on a socket.
Definition can_socket_interface.h:26
Result to receive a message on multiple sockets at once.
Definition can_socket_interface.h:39