23 #ifndef LELY_CO_WTM_HPP_ 24 #define LELY_CO_WTM_HPP_ 27 #error "include <lely/co/wtm.h> for the C interface" 54 return __co_wtm_alloc();
57 free(
void* ptr) noexcept {
63 return __co_wtm_init(p);
79 getNIF()
const noexcept {
84 setNIF(uint8_t nif = 1) noexcept {
89 setDiagCAN(uint8_t nif, uint8_t st = 0xf, uint8_t err = 0xf,
90 uint8_t load = 0xff, uint16_t ec = 0xffff, uint16_t foc = 0xffff,
91 uint16_t coc = 0xffff) noexcept {
96 setDiagWTM(uint8_t quality = 0xff) noexcept {
112 setDiagCANCon(F* f) noexcept {
114 static_cast<void*>(f));
117 template <class C, typename c_mem_fn<co_wtm_diag_can_con_t*, C>::type M>
119 setDiagCANCon(C* obj) noexcept {
121 static_cast<void*>(obj));
136 setDiagWTMCon(F* f) noexcept {
138 static_cast<void*>(f));
141 template <class C, typename c_mem_fn<co_wtm_diag_wtm_con_t*, C>::type M>
143 setDiagWTMCon(C* obj) noexcept {
145 static_cast<void*>(obj));
160 setDiagCANInd(F* f) noexcept {
162 static_cast<void*>(f));
165 template <class C, typename c_mem_fn<co_wtm_diag_can_ind_t*, C>::type M>
167 setDiagCANInd(C* obj) noexcept {
169 static_cast<void*>(obj));
184 setDiagWTMInd(F* f) noexcept {
186 static_cast<void*>(f));
189 template <class C, typename c_mem_fn<co_wtm_diag_wtm_ind_t*, C>::type M>
191 setDiagWTMInd(C* obj) noexcept {
193 static_cast<void*>(obj));
208 setDiagACInd(F* f) noexcept {
210 static_cast<void*>(f));
213 template <class C, typename c_mem_fn<co_wtm_diag_ac_ind_t*, C>::type M>
215 setDiagACInd(C* obj) noexcept {
217 static_cast<void*>(obj));
221 recv(
const void* buf,
size_t nbytes) noexcept {
237 setRecvFunc(F* f) noexcept {
239 static_cast<void*>(f));
242 template <class C, typename c_mem_fn<co_wtm_recv_func_t*, C>::type M>
244 setRecvFunc(C* obj) noexcept {
246 static_cast<void*>(obj));
250 getTime(uint8_t nif, timespec* tp)
const noexcept {
255 setTime(uint8_t nif,
const timespec& tp) noexcept {
260 send(uint8_t nif,
const can_msg& msg) noexcept {
265 sendAlive() noexcept {
270 sendDiagCANReq(uint8_t nif) noexcept {
275 sendDiagWTMReq(uint8_t nif) noexcept {
280 sendDiagCANRst(uint8_t nif) noexcept {
285 sendDiagWTMRst(uint8_t nif) noexcept {
290 sendDiagAC(uint32_t ac) noexcept {
311 setSendFunc(F* f) noexcept {
313 static_cast<void*>(f));
316 template <class C, typename c_mem_fn<co_wtm_send_func_t*, C>::type M>
318 setSendFunc(C* obj) noexcept {
320 static_cast<void*>(obj));
329 #endif // !LELY_CO_WTM_HPP_ lely::COWTM co_wtm_t
An opaque CANopen Wireless Transmission Media (WTM) interface type.
A CAN or CAN FD format frame.
int co_wtm_send_diag_wtm_rst(co_wtm_t *wtm, uint8_t nif)
Sends a WTM communication quality reset message.
uint8_t co_wtm_get_nif(const co_wtm_t *wtm)
Returns the interface indicator of a CANopen WTM interface.
int co_wtm_send_diag_can_rst(co_wtm_t *wtm, uint8_t nif)
Sends a CAN communication quality reset message.
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_diag_ac(co_wtm_t *wtm, uint32_t ac)
Sends a diagnostic abort message from a CANopen WTM interface.
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_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.
This header file is part of the CANopen library; it contains the Wireless Transmission Media (WTM) de...
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 ...
The base class for a C++ interface to an incomplete C type.
int co_wtm_set_diag_wtm(co_wtm_t *wtm, uint8_t quality)
Sets the diagnostic parameters of a WTM interface.
int co_wtm_flush(co_wtm_t *wtm)
Flushes the current send buffer of a CANopen WTM interface.
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_recv(co_wtm_t *wtm, const void *buf, size_t nbytes)
Receives and processes a byte stream with a CANopen WTM interface.
int co_wtm_set_time(co_wtm_t *wtm, uint8_t nif, const struct timespec *tp)
Sets the current time of a CANopen WTM interface.
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_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...
void co_wtm_diag_ac_ind_t(co_wtm_t *wtm, uint32_t ac, void *data)
The type of a CANopen WTM diagnostic indication function, invoked when an abort code is generated or ...
int co_wtm_get_time(const co_wtm_t *wtm, uint8_t nif, struct timespec *tp)
Retrieves the current time of a CANopen WTM interface.
int co_wtm_set_nif(co_wtm_t *wtm, uint8_t nif)
Sets the interface indicator of a CANopen WTM interface.
void co_wtm_diag_can_ind_t(co_wtm_t *wtm, uint8_t nif, void *data)
The type of a CANopen WTM diagnostic indication function, invoked when a CAN communication quality re...
This header file is part of the utilities library; it contains the C to C++ interface declarations...
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_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_wtm_req(co_wtm_t *wtm, uint8_t nif)
Sends a WTM communication quality request.
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.
void co_wtm_diag_wtm_con_t(co_wtm_t *wtm, uint8_t nif, uint8_t quality, void *data)
The type of a CANopen WTM diagnostic confirmation function, invoked when a WTM communication quality ...
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...
A CANopen Wireless Transmission Media (WTM) interface.
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_alive(co_wtm_t *wtm)
Sends a keep-alive message from a CANopen WTM interface.
An opaque CANopen Wireless Transmission Media (WTM) interface type.
int co_wtm_recv_func_t(co_wtm_t *wtm, uint8_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.
Global namespace for the Lely Industries N.V. libraries.
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_can_con_t(co_wtm_t *wtm, uint8_t nif, uint8_t st, uint8_t err, uint8_t load, uint16_t ec, uint16_t foc, uint16_t coc, void *data)
The type of a CANopen WTM diagnostic confirmation function, invoked when a CAN communication quality ...
int co_wtm_set_diag_can(co_wtm_t *wtm, uint8_t nif, uint8_t st, uint8_t err, uint8_t load, uint16_t ec, uint16_t foc, uint16_t coc)
Sets the diagnostic parameters of a CAN interface.
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_send(co_wtm_t *wtm, uint8_t nif, const struct can_msg *msg)
Sends a CAN frame from a CANopen WTM interface.
int co_wtm_send_diag_can_req(co_wtm_t *wtm, uint8_t nif)
Sends a CAN communication quality request.
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...
This header file is part of the utilities library; it contains the C callback wrapper declarations...
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 ...
A class template supplying a uniform interface to certain attributes of C types.