Lely core libraries
2.2.5
|
Go to the documentation of this file.
22 #ifndef LELY_CAN_NET_HPP_
23 #define LELY_CAN_NET_HPP_
26 #error "include <lely/can/net.h> for the C interface"
65 return __can_net_alloc();
69 free(
void* ptr) noexcept {
75 return __can_net_init(p);
92 getTime(timespec* tp)
const noexcept {
97 setTime(
const timespec& tp) noexcept {
113 setNextFunc(F* f) noexcept {
115 static_cast<void*
>(f));
118 template <class C, typename c_mem_fn<can_timer_func_t*, C>::type M>
120 setNextFunc(C* obj) noexcept {
122 static_cast<void*
>(obj));
126 recv(
const can_msg& msg) noexcept {
131 send(
const can_msg& msg) noexcept {
147 setSendFunc(F* f) noexcept {
149 static_cast<void*
>(f));
152 template <class C, typename c_mem_fn<can_send_func_t*, C>::type M>
154 setSendFunc(C* obj) noexcept {
156 static_cast<void*
>(obj));
174 return __can_timer_alloc();
177 free(
void* ptr) noexcept {
178 __can_timer_free(ptr);
183 return __can_timer_init(p);
210 setFunc(F* f) noexcept {
214 template <class C, typename c_mem_fn<can_timer_func_t*, C>::type M>
216 setFunc(C* obj) noexcept {
218 static_cast<void*
>(obj));
222 start(
CANNet& net,
const timespec* start = 0,
223 const timespec* interval = 0) noexcept {
233 timeout(
CANNet& net,
int timeout) noexcept {
252 return __can_recv_alloc();
255 free(
void* ptr) noexcept {
256 __can_recv_free(ptr);
261 return __can_recv_init(p);
288 setFunc(F* f) noexcept {
292 template <class C, typename c_mem_fn<can_recv_func_t*, C>::type M>
294 setFunc(C* obj) noexcept {
296 static_cast<void*
>(obj));
300 start(
CANNet& net, uint_least32_t
id, uint_least8_t flags = 0) noexcept {
315 #endif // !LELY_CAN_NET_HPP_
The base class for a C++ interface to an incomplete C type.
void can_net_get_time(const can_net_t *net, struct timespec *tp)
Retrieves the current time of a CAN network interface.
int can_net_set_time(can_net_t *net, const struct timespec *tp)
Sets the current time of a 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...
A CAN or CAN FD format frame.
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).
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_stop(can_timer_t *timer)
Stops a CAN timer and unregisters it with a network interface.
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_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.
lely::CANRecv can_recv_t
An opaque CAN frame receiver type.
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...
An opaque CAN network interface type.
A class template supplying a uniform interface to certain attributes of C types.
An opaque CAN timer type.
An opaque CAN frame receiver type.
lely::CANNet can_net_t
An opaque CAN network interface type.
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_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_send(can_net_t *net, const struct can_msg *msg)
Sends a CAN frame from a network interface.
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_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.
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_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.
void can_recv_stop(can_recv_t *recv)
Stops a CAN frame receiver from processing frames and unregisters it with the 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,...
lely::CANTimer can_timer_t
An opaque CAN timer 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.