Lely core libraries
2.3.4
|
Go to the documentation of this file.
23 #ifndef LELY_CO_WTM_HPP_
24 #define LELY_CO_WTM_HPP_
26 #if !defined(__cplusplus) || LELY_NO_CXX
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(uint_least8_t nif = 1) noexcept {
89 setDiagCAN(uint_least8_t nif, uint_least8_t st = 0xf, uint_least8_t err = 0xf,
90 uint_least8_t load = 0xff, uint_least16_t ec = 0xffff,
91 uint_least16_t foc = 0xffff,
92 uint_least16_t coc = 0xffff) noexcept {
97 setDiagWTM(uint_least8_t quality = 0xff) noexcept {
113 setDiagCANCon(F* f) noexcept {
115 static_cast<void*
>(f));
118 template <class C, typename c_mem_fn<co_wtm_diag_can_con_t*, C>::type M>
120 setDiagCANCon(C* obj) noexcept {
122 static_cast<void*
>(obj));
137 setDiagWTMCon(F* f) noexcept {
139 static_cast<void*
>(f));
142 template <class C, typename c_mem_fn<co_wtm_diag_wtm_con_t*, C>::type M>
144 setDiagWTMCon(C* obj) noexcept {
146 static_cast<void*
>(obj));
161 setDiagCANInd(F* f) noexcept {
163 static_cast<void*
>(f));
166 template <class C, typename c_mem_fn<co_wtm_diag_can_ind_t*, C>::type M>
168 setDiagCANInd(C* obj) noexcept {
170 static_cast<void*
>(obj));
185 setDiagWTMInd(F* f) noexcept {
187 static_cast<void*
>(f));
190 template <class C, typename c_mem_fn<co_wtm_diag_wtm_ind_t*, C>::type M>
192 setDiagWTMInd(C* obj) noexcept {
194 static_cast<void*
>(obj));
209 setDiagACInd(F* f) noexcept {
211 static_cast<void*
>(f));
214 template <class C, typename c_mem_fn<co_wtm_diag_ac_ind_t*, C>::type M>
216 setDiagACInd(C* obj) noexcept {
218 static_cast<void*
>(obj));
222 recv(
const void* buf,
size_t nbytes) noexcept {
238 setRecvFunc(F* f) noexcept {
240 static_cast<void*
>(f));
243 template <class C, typename c_mem_fn<co_wtm_recv_func_t*, C>::type M>
245 setRecvFunc(C* obj) noexcept {
247 static_cast<void*
>(obj));
251 getTime(uint_least8_t nif, timespec* tp)
const noexcept {
256 setTime(uint_least8_t nif,
const timespec& tp) noexcept {
261 send(uint_least8_t nif,
const can_msg& msg) noexcept {
266 sendAlive() noexcept {
271 sendDiagCANReq(uint_least8_t nif) noexcept {
276 sendDiagWTMReq(uint_least8_t nif) noexcept {
281 sendDiagCANRst(uint_least8_t nif) noexcept {
286 sendDiagWTMRst(uint_least8_t nif) noexcept {
291 sendDiagAC(uint_least32_t ac) noexcept {
312 setSendFunc(F* f) noexcept {
314 static_cast<void*
>(f));
317 template <class C, typename c_mem_fn<co_wtm_send_func_t*, C>::type M>
319 setSendFunc(C* obj) noexcept {
321 static_cast<void*
>(obj));
330 #endif // !LELY_CO_WTM_HPP_
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.
The base class for a C++ interface to an incomplete C type.
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_set_diag_wtm(co_wtm_t *wtm, uint_least8_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.
int co_wtm_set_nif(co_wtm_t *wtm, uint_least8_t nif)
Sets the interface indicator of 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 ...
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 CAN or CAN FD format frame.
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_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_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...
A 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.
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.
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_send_alive(co_wtm_t *wtm)
Sends a keep-alive message from 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 ...
An opaque CANopen Wireless Transmission Media (WTM) interface type.
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_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_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_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_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.
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.
uint_least8_t co_wtm_get_nif(const co_wtm_t *wtm)
Returns the interface indicator of a CANopen WTM interface.
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 ...
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_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.
A class template supplying a uniform interface to certain attributes of C types.
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 ...
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_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_get_time(const co_wtm_t *wtm, uint_least8_t nif, struct timespec *tp)
Retrieves the current time of a CANopen WTM interface.
lely::COWTM co_wtm_t
An opaque CANopen Wireless Transmission Media (WTM) interface type.
int co_wtm_send_diag_ac(co_wtm_t *wtm, uint_least32_t ac)
Sends a diagnostic abort message from a CANopen WTM interface.
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.
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_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 ...
int co_wtm_send_diag_wtm_req(co_wtm_t *wtm, uint_least8_t nif)
Sends a WTM communication quality request.
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_can_rst(co_wtm_t *wtm, uint_least8_t nif)
Sends a CAN communication quality reset message.