Lely core libraries  2.3.4
can.h
Go to the documentation of this file.
1 
27 #ifndef LELY_IO2_USER_CAN_H_
28 #define LELY_IO2_USER_CAN_H_
29 
30 #include <lely/io2/can.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
51  const struct can_msg *msg, int timeout, void *arg);
52 
53 void *io_user_can_chan_alloc(void);
54 void io_user_can_chan_free(void *ptr);
55 io_can_chan_t *io_user_can_chan_init(io_can_chan_t *chan, io_ctx_t *ctx,
56  ev_exec_t *exec, int flags, size_t rxlen, int txtimeo,
57  io_user_can_chan_write_t *func, void *arg);
58 void io_user_can_chan_fini(io_can_chan_t *chan);
59 
86  int flags, size_t rxlen, int txtimeo,
87  io_user_can_chan_write_t *func, void *arg);
88 
91 
106 int io_user_can_chan_on_msg(io_can_chan_t *chan, const struct can_msg *msg,
107  const struct timespec *tp, int timeout);
108 
123 int io_user_can_chan_on_err(io_can_chan_t *chan, const struct can_err *err,
124  const struct timespec *tp, int timeout);
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif // !LELY_IO2_USER_CAN_H_
ev_exec_t
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
Definition: ev.h:29
can_msg
A CAN or CAN FD format frame.
Definition: msg.h:87
can_err
A CAN error frame.
Definition: err.h:28
io_user_can_chan_on_msg
int io_user_can_chan_on_msg(io_can_chan_t *chan, const struct can_msg *msg, const struct timespec *tp, int timeout)
Processes an incoming CAN frame.
Definition: can.c:416
io_can_chan_t
const struct io_can_chan_vtbl *const io_can_chan_t
An abstract CAN channel.
Definition: can.h:59
io_can_chan_write::msg
const struct can_msg * msg
A pointer to the CAN frame to be written.
Definition: can.h:116
io_user_can_chan_create
io_can_chan_t * io_user_can_chan_create(io_ctx_t *ctx, ev_exec_t *exec, int flags, size_t rxlen, int txtimeo, io_user_can_chan_write_t *func, void *arg)
Creates a new user-defined CAN channel.
Definition: can.c:378
io_user_can_chan_destroy
void io_user_can_chan_destroy(io_can_chan_t *chan)
Destroys a user-defined CAN channel.
Definition: can.c:407
io_user_can_chan_on_err
int io_user_can_chan_on_err(io_can_chan_t *chan, const struct can_err *err, const struct timespec *tp, int timeout)
Processes an incoming CAN error frame.
Definition: can.c:441
can.h
io_user_can_chan_write_t
int io_user_can_chan_write_t(const struct can_msg *msg, int timeout, void *arg)
The type of function invoked by a user-defined CAN channel when a CAN frame needs to be written.
Definition: can.h:50
io_ctx
Definition: ctx.c:38