23 #ifndef LELY_IO_CAN_HPP_
24 #define LELY_IO_CAN_HPP_
27 #error "include <lely/io/can.h> for the C interface"
49 operator=(
const IOCAN&
can) noexcept {
50 IOHandle::operator=(
can);
56 IOHandle::operator=(::std::forward<IOCAN>(
can));
66 write(
const can_msg& msg) noexcept {
85 getError(
int&
error) noexcept {
90 getEC(uint16_t& txec, uint16_t& rxec) noexcept {
95 getBitrate(uint32_t& bitrate) noexcept {
100 setBitrate(uint32_t bitrate) noexcept {
105 getTXQLen(
size_t& txqlen) noexcept {
110 setTXQLen(
size_t txqlen) noexcept {
A Controller Area Network (CAN) device handle.
The type of objects thrown as exceptions to report a failure to initialize an instantiation of a C ty...
The type of objects thrown as exceptions to report a system error with an associated error code.
#define throw_or_abort(e)
If exceptions are disabled, aborts the process instead of throwing an exception.
This header file is part of the I/O library; it contains the Controller Area Network (CAN) declaratio...
int io_can_get_error(io_handle_t handle, int *perror)
Obtains and clears the current error number of a CAN device, and stores the value (any combination of...
int io_can_set_txqlen(io_handle_t handle, size_t txqlen)
Sets the length of the transmission queue (in number of CAN frames) of a CAN device.
int io_can_stop(io_handle_t handle)
Stops transmission and reception on a CAN device.
int io_can_write(io_handle_t handle, const struct can_msg *msg)
Writes a single CAN or CAN FD frame.
int io_can_get_txqlen(io_handle_t handle, size_t *ptxqlen)
Obtains the length of the transmission queue (in number of CAN frames) of a CAN device and stores the...
io_handle_t io_open_can(const char *path)
Opens a CAN device.
int io_can_read(io_handle_t handle, struct can_msg *msg)
Reads a single CAN or CAN FD frame.
int io_can_get_ec(io_handle_t handle, uint16_t *ptxec, uint16_t *prxec)
Obtains the transmit and/or receive error count of a CAN device and stores the value in *ptxec and/or...
int io_can_start(io_handle_t handle)
Starts transmission and reception on a CAN device.
int io_can_set_bitrate(io_handle_t handle, uint32_t bitrate)
Sets the bitrate (in bit/s) of a CAN device.
int io_can_get_state(io_handle_t handle)
Obtains the state of a CAN device.
int io_can_get_bitrate(io_handle_t handle, uint32_t *pbitrate)
Obtains the bitrate (in bit/s) of a CAN device and stores the value in *pbitrate.
This header file is part of the I/O library; it contains the C++ interface of the I/O device handle.
A CAN or CAN FD format frame.