Lely core libraries 2.3.4
gw_txt.h
Go to the documentation of this file.
1
22#ifndef LELY_CO_GW_TXT_H_
23#define LELY_CO_GW_TXT_H_
24
25#include <lely/co/gw.h>
26
28#define CO_GW_TXT_IMPL_HI 2
29
31#define CO_GW_TXT_IMPL_LO 1
32
33struct __co_gw_txt;
34#if !defined(__cplusplus) || LELY_NO_CXX
36typedef struct __co_gw_txt co_gw_txt_t;
37#endif
38
39// The file location struct from <lely/util/diag.h>.
40struct floc;
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
58typedef int co_gw_txt_recv_func_t(const char *txt, void *data);
59
70typedef int co_gw_txt_send_func_t(const struct co_gw_req *req, void *data);
71
72void *__co_gw_txt_alloc(void);
73void __co_gw_txt_free(void *ptr);
74struct __co_gw_txt *__co_gw_txt_init(struct __co_gw_txt *gw);
75void __co_gw_txt_fini(struct __co_gw_txt *gw);
76
79
82
85
87size_t co_gw_txt_pending(const co_gw_txt_t *gw);
88
98int co_gw_txt_recv(co_gw_txt_t *gw, const struct co_gw_srv *srv);
99
113 co_gw_txt_recv_func_t **pfunc, void **pdata);
114
127 co_gw_txt_t *gw, co_gw_txt_recv_func_t *func, void *data);
128
143size_t co_gw_txt_send(co_gw_txt_t *gw, const char *begin, const char *end,
144 struct floc *at);
145
159 co_gw_txt_send_func_t **pfunc, void **pdata);
160
173 co_gw_txt_t *gw, co_gw_txt_send_func_t *func, void *data);
174
175#ifdef __cplusplus
176}
177#endif
178
179#endif // !LELY_CO_GW_TXT_H_
This header file is part of the CANopen library; it contains the gateway declarations (see CiA 309-1 ...
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.
Definition: gw_txt.c:782
void co_gw_txt_destroy(co_gw_txt_t *gw)
Destroys a CANopen ASCII gateway.
Definition: gw_txt.c:362
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...
Definition: gw_txt.h:58
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...
Definition: gw_txt.c:486
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...
Definition: gw_txt.h:70
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.
Definition: gw_txt.c:770
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.
Definition: gw_txt.c:498
co_gw_txt_t * co_gw_txt_create(void)
Creates a new CANopen ASCII gateway.
Definition: gw_txt.c:337
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...
Definition: gw_txt.c:760
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.
Definition: gw_txt.c:389
int co_gw_txt_iec(co_gw_txt_t *gw)
Returns (and clears) the last internal error code.
Definition: gw_txt.c:371
size_t co_gw_txt_pending(const co_gw_txt_t *gw)
Returns the number of pending (i.e., unconfirmed) requests.
Definition: gw_txt.c:381
A CANopen ASCII gateway.
Definition: gw_txt.c:45
The common parameters of a CANopen gateway request.
Definition: gw.h:271
The common parameters of a CANopen gateway service.
Definition: gw.h:263
A location in a text file.
Definition: diag.h:39