Lely core libraries
2.3.4
|
Go to the documentation of this file.
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 {
117 #endif // !LELY_IO_CAN_HPP_
The type of objects thrown as exceptions to report a failure to initialize an instantiation of a C ty...
int io_can_read(io_handle_t handle, struct can_msg *msg)
Reads a single CAN or CAN FD frame.
A CAN or CAN FD format frame.
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.
The type of objects thrown as exceptions to report a system error with an associated error code.
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_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_stop(io_handle_t handle)
Stops transmission and reception on a CAN device.
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.
#define throw_or_abort(e)
If exceptions are disabled, aborts the process instead of throwing an exception.
int io_can_write(io_handle_t handle, const struct can_msg *msg)
Writes a single CAN or CAN FD frame.
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_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...
int io_can_start(io_handle_t handle)
Starts transmission and reception on a CAN device.
A Controller Area Network (CAN) device handle.
io_handle_t io_open_can(const char *path)
Opens a CAN device.