23 #ifndef LELY_CO_GW_TXT_HPP_ 24 #define LELY_CO_GW_TXT_HPP_ 27 #error "include <lely/co/gw_txt.h> for the C interface" 53 return __co_gw_txt_alloc();
56 free(
void* ptr) noexcept {
57 __co_gw_txt_free(ptr);
61 init(pointer p) noexcept {
62 return __co_gw_txt_init(p);
65 fini(pointer p) noexcept {
83 pending()
const noexcept {
104 setRecvFunc(F* f) noexcept {
106 static_cast<void*>(f));
109 template <class C, typename c_mem_fn<co_gw_txt_recv_func_t*, C>::type M>
111 setRecvFunc(C* obj) noexcept {
113 static_cast<void*>(obj));
117 send(
const char* begin,
const char* end = 0,
floc* at = 0) noexcept {
133 setSendFunc(F* f) noexcept {
135 static_cast<void*>(f));
138 template <class C, typename c_mem_fn<co_gw_txt_send_func_t*, C>::type M>
140 setSendFunc(C* obj) noexcept {
142 static_cast<void*>(obj));
151 #endif // !LELY_CO_GW_TXT_HPP_ int co_gw_txt_iec(co_gw_txt_t *gw)
Returns (and clears) the last internal error code.
int co_gw_txt_send_func_t(const struct co_gw_req *req, void *data)
The type of a CANopen ASCII gateway send callback function, invoked when a request has been issued by...
A location in a text file.
The base class for a C++ interface to an incomplete C type.
void co_gw_txt_get_send_func(const co_gw_txt_t *gw, co_gw_txt_send_func_t **pfunc, void **pdata)
Retrieves the callback function used to send requests from the user to a CANopen gateway.
int co_gw_txt_recv_func_t(const char *txt, void *data)
The type of a CANopen ASCII gateway receive callback function, invoked when when an indication of con...
This header file is part of the utilities library; it contains the C to C++ interface declarations...
void co_gw_txt_get_recv_func(const co_gw_txt_t *gw, co_gw_txt_recv_func_t **pfunc, void **pdata)
Retrieves the callback function used to forward indications and confirmations received by a CANopen g...
An opaque CANopen ASCII gateway client type.
lely::COGWTxt co_gw_txt_t
An opaque CANopen ASCII gateway client type.
int co_gw_txt_recv(co_gw_txt_t *gw, const struct co_gw_srv *srv)
Receives and forwards an indication or confirmation from a CANopen gateway.
This header file is part of the CANopen library; it contains the ASCII gateway declarations (see CiA ...
size_t co_gw_txt_send(co_gw_txt_t *gw, const char *begin, const char *end, struct floc *at)
Sends a user request to a CANopen gateway.
size_t co_gw_txt_pending(const co_gw_txt_t *gw)
Returns the number of pending (i.e., unconfirmed) requests.
void co_gw_txt_set_recv_func(co_gw_txt_t *gw, co_gw_txt_recv_func_t *func, void *data)
Sets the callback function used to forward indications and confirmations received by a CANopen gatewa...
The common parameters of a CANopen gateway service.
void co_gw_txt_set_send_func(co_gw_txt_t *gw, co_gw_txt_send_func_t *func, void *data)
Sets the callback function used to send requests from the user to a CANopen gateway.
A class template supplying a uniform interface to certain attributes of C types.