33#define CO_WTM_MAX_LEN 261
36#define CO_WTM_AC_ERROR UINT32_C(0x01000000)
39#define CO_WTM_AC_TIMEOUT UINT32_C(0x01000001)
42#define CO_WTM_AC_NO_MEM UINT32_C(0x01000002)
45#define CO_WTM_AC_HARDWARE UINT32_C(0x01000003)
51#define CO_WTM_AC_DATA UINT32_C(0x01000004)
57#define CO_WTM_AC_DATA_CTL UINT32_C(0x01000005)
63#define CO_WTM_AC_DATA_DEV UINT32_C(0x01000006)
66#define CO_WTM_AC_NO_DATA UINT32_C(0x01000007)
69#define CO_WTM_AC_NO_IF UINT32_C(0x01000008)
72#define CO_WTM_AC_IF_DOWN UINT32_C(0x01000009)
75#define CO_WTM_AC_DIAG UINT32_C(0x0100000a)
81#define CO_WTM_AC_DIAG_CAN UINT32_C(0x0100000b)
87#define CO_WTM_AC_DIAG_WTM UINT32_C(0x0100000c)
90#define CO_WTM_AC_FRAME UINT32_C(0x02000000)
93#define CO_WTM_AC_PREAMBLE UINT32_C(0x02000001)
96#define CO_WTM_AC_SEQ UINT32_C(0x02000002)
99#define CO_WTM_AC_TYPE UINT32_C(0x02000003)
102#define CO_WTM_AC_PAYLOAD UINT32_C(0x02000004)
105#define CO_WTM_AC_CRC UINT32_C(0x02000005)
108#define CO_WTM_AC_CAN UINT32_C(0x02000006)
111#if !defined(__cplusplus) || LELY_NO_CXX
145 uint_least8_t st, uint_least8_t err, uint_least8_t load,
146 uint_least16_t ec, uint_least16_t foc, uint_least16_t coc,
160 uint_least8_t
quality,
void *data);
207 const struct timespec *tp,
const struct can_msg *msg,
223 co_wtm_t *wtm,
const void *buf,
size_t nbytes,
void *data);
228void *__co_wtm_alloc(
void);
229void __co_wtm_free(
void *ptr);
231void __co_wtm_fini(
struct __co_wtm *wtm);
296 uint_least8_t err, uint_least8_t load, uint_least16_t ec,
297 uint_least16_t foc, uint_least16_t coc);
510 const co_wtm_t *wtm, uint_least8_t
nif,
struct timespec *tp);
526 co_wtm_t *wtm, uint_least8_t
nif,
const struct timespec *tp);
This header file is part of the CAN library; it contains the CAN frame declarations.
This is the public header file of the CANopen library.
This header file is part of the C11 and POSIX compatibility library; it includes <time....
A CANopen Wireless Transmission Media (WTM) interface.
uint_least8_t quality
The link quality percentage (in the range [0..100], or 0xff if the information is not available).
uint_least8_t nif
The WTM interface indicator.
A CAN or CAN FD format frame.
void co_wtm_diag_can_con_t(co_wtm_t *wtm, uint_least8_t nif, uint_least8_t st, uint_least8_t err, uint_least8_t load, uint_least16_t ec, uint_least16_t foc, uint_least16_t coc, void *data)
The type of a CANopen WTM diagnostic confirmation function, invoked when a CAN communication quality ...
void co_wtm_get_diag_ac_ind(const co_wtm_t *wtm, co_wtm_diag_ac_ind_t **pind, void **pdata)
Retrieves the indication function invoked when an abort code is generated or received by a CANopen WT...
int co_wtm_set_diag_wtm(co_wtm_t *wtm, uint_least8_t quality)
Sets the diagnostic parameters of a WTM interface.
int co_wtm_send_diag_wtm_rst(co_wtm_t *wtm, uint_least8_t nif)
Sends a WTM communication quality reset message.
void co_wtm_get_diag_can_ind(const co_wtm_t *wtm, co_wtm_diag_can_ind_t **pcon, void **pdata)
Retrieves the indication function invoked when a CAN communication quality reset message is received ...
void co_wtm_diag_can_ind_t(co_wtm_t *wtm, uint_least8_t nif, void *data)
The type of a CANopen WTM diagnostic indication function, invoked when a CAN communication quality re...
void co_wtm_set_diag_wtm_ind(co_wtm_t *wtm, co_wtm_diag_wtm_ind_t *con, void *data)
Sets the indication function invoked when a WTM communication quality reset message is received by a ...
void co_wtm_diag_wtm_ind_t(co_wtm_t *wtm, void *data)
The type of a CANopen WTM diagnostic indication function, invoked when a WTM communication quality re...
int co_wtm_get_time(const co_wtm_t *wtm, uint_least8_t nif, struct timespec *tp)
Retrieves the current time of a CANopen WTM interface.
void co_wtm_destroy(co_wtm_t *wtm)
Destroys a CANopen Wireless Transmission Media (WTM) interface.
int co_wtm_send_alive(co_wtm_t *wtm)
Sends a keep-alive message from a CANopen WTM interface.
void co_wtm_get_diag_wtm_con(const co_wtm_t *wtm, co_wtm_diag_wtm_con_t **pcon, void **pdata)
Retrieves the confirmation function invoked when a WTM communication quality response is received by ...
int co_wtm_send_func_t(co_wtm_t *wtm, const void *buf, size_t nbytes, void *data)
The type of a CANopen WTM send callback function, invoked when a byte stream needs to be sent.
void co_wtm_get_diag_wtm_ind(const co_wtm_t *wtm, co_wtm_diag_wtm_ind_t **pcon, void **pdata)
Retrieves the indication function invoked when a WTM communication quality reset message is received ...
int co_wtm_send_diag_ac(co_wtm_t *wtm, uint_least32_t ac)
Sends a diagnostic abort message from a CANopen WTM interface.
void co_wtm_set_diag_can_ind(co_wtm_t *wtm, co_wtm_diag_can_ind_t *con, void *data)
Sets the indication function invoked when a CAN communication quality reset message is received by a ...
co_wtm_t * co_wtm_create(void)
Creates a new CANopen Wireless Transmission Media (WTM) interface.
int co_wtm_send_diag_can_req(co_wtm_t *wtm, uint_least8_t nif)
Sends a CAN communication quality request.
void co_wtm_set_diag_ac_ind(co_wtm_t *wtm, co_wtm_diag_ac_ind_t *ind, void *data)
Sets the indication function invoked when an abort code is generated or received by a CANopen WTM int...
void co_wtm_set_recv_func(co_wtm_t *wtm, co_wtm_recv_func_t *func, void *data)
Sets the callback function invoked when a CAN frame is received by a CANopen WTM interface.
void co_wtm_set_send_func(co_wtm_t *wtm, co_wtm_send_func_t *func, void *data)
Sets the callback function used to send byte streams from a CANopen WTM interface.
void co_wtm_recv(co_wtm_t *wtm, const void *buf, size_t nbytes)
Receives and processes a byte stream with a CANopen WTM interface.
void co_wtm_get_diag_can_con(const co_wtm_t *wtm, co_wtm_diag_can_con_t **pcon, void **pdata)
Retrieves the confirmation function invoked when a CAN communication quality response is received by ...
void co_wtm_get_recv_func(const co_wtm_t *wtm, co_wtm_recv_func_t **pfunc, void **pdata)
Retrieves the callback function invoked when a CAN frame is received by a CANopen WTM interface.
int co_wtm_send(co_wtm_t *wtm, uint_least8_t nif, const struct can_msg *msg)
Sends a CAN frame from a CANopen WTM interface.
int co_wtm_send_diag_wtm_req(co_wtm_t *wtm, uint_least8_t nif)
Sends a WTM communication quality request.
int co_wtm_send_diag_can_rst(co_wtm_t *wtm, uint_least8_t nif)
Sends a CAN communication quality reset message.
int co_wtm_flush(co_wtm_t *wtm)
Flushes the current send buffer of a CANopen WTM interface.
void co_wtm_diag_ac_ind_t(co_wtm_t *wtm, uint_least32_t ac, void *data)
The type of a CANopen WTM diagnostic indication function, invoked when an abort code is generated or ...
void co_wtm_set_diag_can_con(co_wtm_t *wtm, co_wtm_diag_can_con_t *con, void *data)
Sets the confirmation function invoked when a CAN communication quality response is received by a CAN...
void co_wtm_get_send_func(const co_wtm_t *wtm, co_wtm_send_func_t **pfunc, void **pdata)
Retrieves the callback function used to send byte streams from a CANopen WTM interface.
int co_wtm_recv_func_t(co_wtm_t *wtm, uint_least8_t nif, const struct timespec *tp, const struct can_msg *msg, void *data)
The type of a CANopen WTM receive callback function, invoked when a CAN frame is received.
int co_wtm_set_diag_can(co_wtm_t *wtm, uint_least8_t nif, uint_least8_t st, uint_least8_t err, uint_least8_t load, uint_least16_t ec, uint_least16_t foc, uint_least16_t coc)
Sets the diagnostic parameters of a CAN interface.
uint_least8_t co_wtm_get_nif(const co_wtm_t *wtm)
Returns the interface indicator of a CANopen WTM interface.
void co_wtm_diag_wtm_con_t(co_wtm_t *wtm, uint_least8_t nif, uint_least8_t quality, void *data)
The type of a CANopen WTM diagnostic confirmation function, invoked when a WTM communication quality ...
int co_wtm_set_nif(co_wtm_t *wtm, uint_least8_t nif)
Sets the interface indicator of a CANopen WTM interface.
int co_wtm_set_time(co_wtm_t *wtm, uint_least8_t nif, const struct timespec *tp)
Sets the current time of a CANopen WTM interface.
void co_wtm_set_diag_wtm_con(co_wtm_t *wtm, co_wtm_diag_wtm_con_t *con, void *data)
Sets the confirmation function invoked when a WTM communication quality response is received by a CAN...
const char * co_wtm_ac_str(uint_least32_t ac)
Returns a string describing a CANopen WTM abort code.