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
33extern "C" {
34#endif
35
51 const struct can_msg *msg, int timeout, void *arg);
52
53void *io_user_can_chan_alloc(void);
54void io_user_can_chan_free(void *ptr);
55io_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);
58void 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
106int io_user_can_chan_on_msg(io_can_chan_t *chan, const struct can_msg *msg,
107 const struct timespec *tp, int timeout);
108
123int 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_
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
Definition ev.h:29
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.
Definition can.h:59
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
void io_user_can_chan_destroy(io_can_chan_t *chan)
Destroys a user-defined CAN channel.
Definition can.c:407
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
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
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
A CAN error frame.
Definition err.h:28
A CAN or CAN FD format frame.
Definition msg.h:87
Definition ctx.c:38
A time type with nanosecond resolution.
Definition time.h:88