22 #ifndef LELY_CAN_NET_H_
23 #define LELY_CAN_NET_H_
87 void *__can_net_alloc(
void);
88 void __can_net_free(
void *ptr);
90 void __can_net_fini(
struct __can_net *net);
204 void *__can_timer_alloc(
void);
205 void __can_timer_free(
void *ptr);
258 const struct timespec *
start,
const struct timespec *
interval);
281 void *__can_recv_alloc(
void);
282 void __can_recv_free(
void *ptr);
284 void __can_recv_fini(
struct __can_recv *recv);
330 uint_least8_t flags);
This header file is part of the CAN library; it contains the CAN frame declarations.
This header file is part of the C11 and POSIX compatibility library; it includes <time....
void can_timer_stop(can_timer_t *timer)
Stops a CAN timer and unregisters it with a network interface.
int can_net_send(can_net_t *net, const struct can_msg *msg)
Sends a CAN frame from a network interface.
void can_timer_start(can_timer_t *timer, can_net_t *net, const struct timespec *start, const struct timespec *interval)
Starts a CAN timer and registers it with a network interface.
void can_net_get_time(const can_net_t *net, struct timespec *tp)
Retrieves the current time of a CAN network interface.
void can_timer_set_func(can_timer_t *timer, can_timer_func_t *func, void *data)
Sets the callback function invoked when a CAN timer is triggered.
void can_timer_get_func(const can_timer_t *timer, can_timer_func_t **pfunc, void **pdata)
Retrieves the callback function invoked when a CAN timer is triggered.
void can_net_set_send_func(can_net_t *net, can_send_func_t *func, void *data)
Sets the callback function used to send CAN frames from a network interface.
can_recv_t * can_recv_create(void)
Creates a new CAN frame receiver.
can_net_t * can_net_create(void)
Creates a new CAN network interface.
void can_recv_stop(can_recv_t *recv)
Stops a CAN frame receiver from processing frames and unregisters it with the network interface.
void can_net_destroy(can_net_t *net)
Destroys a CAN network interface.
void can_net_get_send_func(const can_net_t *net, can_send_func_t **pfunc, void **pdata)
Retrieves the callback function used to send CAN frames from a network interface.
int can_send_func_t(const struct can_msg *msg, void *data)
The type of a CAN send callback function, invoked by a CAN network interface when a frame needs to be...
void can_recv_set_func(can_recv_t *recv, can_recv_func_t *func, void *data)
Sets the callback function used to process CAN frames with a receiver.
void can_recv_destroy(can_recv_t *recv)
Destroys a CAN frame receiver.
can_timer_t * can_timer_create(void)
Creates a new CAN timer.
void can_timer_timeout(can_timer_t *timer, can_net_t *net, int timeout)
Starts a CAN timer and registers it with a network interface.
void can_net_get_next_func(const can_net_t *net, can_timer_func_t **pfunc, void **pdata)
Retrieves the callback function invoked when the time at which the next CAN timer triggers is updated...
int can_recv_func_t(const struct can_msg *msg, void *data)
The type of a CAN receive callback function, invoked by a CAN frame receiver when a frame is received...
void can_net_set_next_func(can_net_t *net, can_timer_func_t *func, void *data)
Sets the callback function invoked when the time at which the next CAN timer triggers is updated.
void can_recv_start(can_recv_t *recv, can_net_t *net, uint_least32_t id, uint_least8_t flags)
Registers a CAN frame receiver with a network interface and starts processing frames.
void can_recv_get_func(const can_recv_t *recv, can_recv_func_t **pfunc, void **pdata)
Retrieves the callback function used to process CAN frames with a receiver.
int can_net_recv(can_net_t *net, const struct can_msg *msg)
Receives a CAN frame with a network interface and processes it with the corresponding receiver(s).
int can_net_set_time(can_net_t *net, const struct timespec *tp)
Sets the current time of a CAN network interface.
int can_timer_func_t(const struct timespec *tp, void *data)
The type of a CAN timer callback function, invoked by a CAN timer when the time is updated,...
void can_timer_destroy(can_timer_t *timer)
Destroys a CAN timer.
void * data
A pointer to the user-specified data for func.
can_recv_func_t * func
A pointer to the callback function invoked by can_net_recv().
can_net_t * net
A pointer to the network interface with which this receiver is registered.
can_net_t * net
A pointer to the network interface with which this timer is registered.
can_timer_func_t * func
A pointer to the callback function invoked by can_net_set_time().
struct timespec interval
The interval between successive triggers.
struct timespec start
The time at which the timer should trigger.
void * data
A pointer to the user-specified data for func.
A CAN or CAN FD format frame.