Lely core libraries
2.3.4
|
Go to the documentation of this file.
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_
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.
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.
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.
A CAN or CAN FD format frame.
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...
struct io_can_rt_read_msg_result r
The result of the read operation.
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_rt_t * io_can_rt_create(io_can_chan_t *chan, ev_exec_t *exec)
Creates a new 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.
const struct can_msg * msg
A pointer to the received CAN frame, or NULL on error (or if the operation is canceled).
const struct io_can_chan_vtbl *const io_can_chan_t
An abstract CAN channel.
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.
uint_least32_t id
The identifier of the CAN frame to be received.
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).
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.
A node in a red-black tree.
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.
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.
struct ev_task task
The task (to be) submitted upon completion (or cancellation) of the read operation.
The result of a CAN frame read operation.
int errc
The error number, obtained as if by get_errc(), if msg is NULL.
struct io_can_rt_read_err_result r
The result of the read operation.
int errc
The error number, obtained as if by get_errc(), if err is NULL.
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...
struct ev_task task
The task (to be) submitted upon completion (or cancellation) of the read operation.
A CAN frame read operation suitable for use with a CAN frame router.
A CAN error frame read operation suitable for use with a CAN frame router.
The result of a CAN error frame read operation.
uint_least8_t flags
The flags of the CAN frame to be received (any combination of CAN_FLAG_IDE, CAN_FLAG_RTR,...