29 #ifndef LELY_IO2_CAN_RT_H_ 30 #define LELY_IO2_CAN_RT_H_ 77 #define IO_CAN_RT_READ_MSG_INIT(id, flags, func) \ 79 (id), (flags), EV_TASK_INIT(NULL, func), { NULL, 0 }, \ 111 #define IO_CAN_RT_READ_ERR_INIT(func) \ 113 EV_TASK_INIT(NULL, func), { NULL, 0 } \ 120 void *io_can_rt_alloc(
void);
121 void io_can_rt_free(
void *ptr);
282 #endif // !LELY_IO2_CAN_RT_H_ A CAN or CAN FD format frame.
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
void io_can_rt_destroy(io_can_rt_t *rt)
Destroys a CAN frame router.
size_t io_can_rt_abort_read_err(io_can_rt_t *rt, struct io_can_rt_read_err *read_err)
Aborts the specified CAN error frame read operation if it is pending.
This header file is part of the utilities library; it contains the red-black tree declarations...
io_dev_t * io_can_rt_get_dev(const io_can_rt_t *rt)
Returns a pointer to the abstract I/O device representing the CAN frame router.
io_can_rt_t * io_can_rt_create(io_can_chan_t *chan, ev_exec_t *exec)
Creates a new CAN frame router.
const struct io_can_chan_vtbl *const io_can_chan_t
An abstract CAN channel.
ev_future_t * io_can_rt_async_read_msg(io_can_rt_t *rt, uint_least32_t id, uint_least8_t flags, struct io_can_rt_read_msg **pread_msg)
Submits an asynchronous CAN frame read operation to a CAN frame router and creates a future which bec...
void io_can_rt_submit_read_err(io_can_rt_t *rt, struct io_can_rt_read_err *read_err)
Submits a CAN error frame read operation to a CAN frame router.
io_can_chan_t * io_can_rt_get_chan(const io_can_rt_t *rt)
Returns a pointer to the CAN channel used by the CAN frame router.
const struct can_err * err
A pointer to the received CAN error frame, or NULL on error (or if the operation is canceled)...
uint_least32_t id
The identifier of the CAN frame to be received.
The result of a CAN frame read operation.
struct io_can_rt_read_err * io_can_rt_read_err_from_task(struct ev_task *task)
Obtains a pointer to a CAN error frame read operation from a pointer to its completion task...
size_t io_can_rt_abort_read_msg(io_can_rt_t *rt, struct io_can_rt_read_msg *read_msg)
Aborts the specified CAN frame read operation if it is pending.
size_t io_can_rt_cancel_read_msg(io_can_rt_t *rt, struct io_can_rt_read_msg *read_msg)
Cancels the specified CAN frame read operation if it is pending.
ev_future_t * io_can_rt_async_read_err(io_can_rt_t *rt, struct io_can_rt_read_err **pread_err)
Submits an asynchronous CAN error frame read operation to a CAN frame router and creates a future whi...
size_t io_can_rt_cancel_read_err(io_can_rt_t *rt, struct io_can_rt_read_err *read_err)
Cancels the specified CAN error frame read operation if it is pending.
struct io_can_rt_read_msg * io_can_rt_read_msg_from_task(struct ev_task *task)
Obtains a pointer to a CAN frame read operation from a pointer to its completion task.
const struct can_msg * msg
A pointer to the received CAN frame, or NULL on error (or if the operation is canceled).
This header file is part of the I/O library; it contains the abstract CAN bus interface.
The result of a CAN error frame read operation.
A CAN frame read operation suitable for use with a CAN frame router.
int errc
The error number, obtained as if by get_errc(), if msg is NULL.
A CAN error frame read operation suitable for use with a CAN frame router.
int errc
The error number, obtained as if by get_errc(), if err is NULL.
struct ev_task task
The task (to be) submitted upon completion (or cancellation) of the read operation.
void io_can_rt_submit_read_msg(io_can_rt_t *rt, struct io_can_rt_read_msg *read_msg)
Submits a CAN frame read operation to a CAN frame router.
uint_least8_t flags
The flags of the CAN frame to be received (any combination of CAN_FLAG_IDE, CAN_FLAG_RTR, CAN_FLAG_FDF, CAN_FLAG_BRS and CAN_FLAG_ESI).
const struct io_dev_vtbl *const io_dev_t
An abstract I/O device.
ev_future_t * io_can_rt_async_shutdown(io_can_rt_t *rt)
Shuts down a CAN frame router, cancels all pending operations and creates a (void) future which becom...
A node in a red-black tree.