22#ifndef LELY_CAN_NET_H_
23#define LELY_CAN_NET_H_
29#if !defined(__cplusplus) || LELY_NO_CXX
35#if !defined(__cplusplus) || LELY_NO_CXX
41#if !defined(__cplusplus) || LELY_NO_CXX
87void *__can_net_alloc(
void);
88void __can_net_free(
void *ptr);
90void __can_net_fini(
struct __can_net *net);
204void *__can_timer_alloc(
void);
205void __can_timer_free(
void *ptr);
281void *__can_recv_alloc(
void);
282void __can_recv_free(
void *ptr);
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.
can_timer_t * can_timer_create(void)
Creates a new CAN timer.
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.
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.
struct __can_net can_net_t
An opaque CAN network interface type.
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.
can_net_t * can_net_create(void)
Creates a new CAN 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...
struct __can_timer can_timer_t
An opaque CAN timer type.
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.
struct __can_recv can_recv_t
An opaque CAN frame receiver type.
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.
can_recv_t * can_recv_create(void)
Creates a new CAN frame 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_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.
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.
A time type with nanosecond resolution.