23#ifndef LELY_CO_GW_TXT_HPP_
24#define LELY_CO_GW_TXT_HPP_
26#if !defined(__cplusplus) || LELY_NO_CXX
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);
62 return __co_gw_txt_init(p);
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));
This header file is part of the utilities library; it contains the C to C++ interface declarations.
An opaque CANopen ASCII gateway client type.
The base class for a C++ interface to an incomplete C type.
This header file is part of the CANopen library; it contains the ASCII gateway declarations (see CiA ...
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.
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...
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...
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...
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.
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.
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...
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.
int co_gw_txt_iec(co_gw_txt_t *gw)
Returns (and clears) the last internal error code.
size_t co_gw_txt_pending(const co_gw_txt_t *gw)
Returns the number of pending (i.e., unconfirmed) requests.
lely::COGWTxt co_gw_txt_t
An opaque CANopen ASCII gateway client type.
The common parameters of a CANopen gateway service.
A location in a text file.
A class template supplying a uniform interface to certain attributes of C types.