34 #ifndef LELY_IO2_LINUX_CAN_H_
35 #define LELY_IO2_LINUX_CAN_H_
44 void *io_can_ctrl_alloc(
void);
45 void io_can_ctrl_free(
void *ptr);
107 void *io_can_chan_alloc(
void);
108 void io_can_chan_free(
void *ptr);
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
This header file is part of the I/O library; it contains the abstract CAN bus interface.
const struct io_can_chan_vtbl *const io_can_chan_t
An abstract CAN channel.
const struct io_can_ctrl_vtbl *const io_can_ctrl_t
An abstract CAN controller.
void io_can_chan_destroy(io_can_chan_t *chan)
Destroys a CAN channel.
unsigned int io_can_ctrl_get_index(const io_can_ctrl_t *ctrl)
Returns the interface index of a CAN controller.
int io_can_chan_get_handle(const io_can_chan_t *chan)
Returns the SocketCAN file descriptor associated with a CAN channel, or -1 if the channel is closed.
int io_can_ctrl_get_flags(const io_can_ctrl_t *ctrl)
Returns the flags specifying which CAN bus features are enabled.
int io_can_chan_close(io_can_chan_t *chan)
Closes the SocketCAN file descriptor associated with a CAN channel.
io_can_ctrl_t * io_can_ctrl_create_from_index(unsigned int index, size_t txlen)
Creates a new CAN controller from an interface index.
int io_can_chan_open(io_can_chan_t *chan, const io_can_ctrl_t *ctrl, int flags)
Opens a CAN channel.
int io_can_chan_release(io_can_chan_t *chan)
Dissociates and returns the SocketCAN file descriptor from a CAN channel.
int io_can_chan_assign(io_can_chan_t *chan, int fd)
Assigns an existing SocketCAN file descriptor to a CAN channel.
io_can_chan_t * io_can_chan_create(io_poll_t *poll, ev_exec_t *exec, size_t rxlen)
Creates a new CAN channel.
const char * io_can_ctrl_get_name(const io_can_ctrl_t *ctrl)
Returns the interface name of a CAN controller.
int io_can_chan_is_open(const io_can_chan_t *chan)
Returns 1 if the CAN channel is open and 0 if not.
io_can_ctrl_t * io_can_ctrl_create_from_name(const char *name, size_t txlen)
Creates a new CAN controller from an interface name.
void io_can_ctrl_destroy(io_can_ctrl_t *ctrl)
Destroys a CAN controller.
This header file is part of the I/O library; it contains system-dependent I/O initialization/finaliza...
An I/O polling interface.