Lely core libraries 1.9.2
csdo.h
Go to the documentation of this file.
1
22#ifndef LELY_CO_CSDO_H_
23#define LELY_CO_CSDO_H_
24
25#include <lely/can/net.h>
26#include <lely/co/sdo.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
43typedef void co_csdo_dn_con_t(co_csdo_t *sdo, co_unsigned16_t idx,
44 co_unsigned8_t subidx, co_unsigned32_t ac, void *data);
45
59typedef void co_csdo_up_con_t(co_csdo_t *sdo, co_unsigned16_t idx,
60 co_unsigned8_t subidx, co_unsigned32_t ac, const void *ptr,
61 size_t n, void *data);
62
79typedef void co_csdo_ind_t(const co_csdo_t *sdo, co_unsigned16_t idx,
80 co_unsigned8_t subidx, size_t size, size_t nbyte, void *data);
81
98int co_dev_dn_req(co_dev_t *dev, co_unsigned16_t idx, co_unsigned8_t subidx,
99 const void *ptr, size_t n, co_csdo_dn_con_t *con, void *data);
100
119int co_dev_dn_val_req(co_dev_t *dev, co_unsigned16_t idx, co_unsigned8_t subidx,
120 co_unsigned16_t type, const void *val, co_csdo_dn_con_t *con,
121 void *data);
122
137int co_dev_up_req(const co_dev_t *dev, co_unsigned16_t idx,
138 co_unsigned8_t subidx, co_csdo_up_con_t *con, void *data);
139
140void *__co_csdo_alloc(void);
141void __co_csdo_free(void *ptr);
142struct __co_csdo *__co_csdo_init(struct __co_csdo *sdo, can_net_t *net,
143 co_dev_t *dev, co_unsigned8_t num);
144void __co_csdo_fini(struct __co_csdo *sdo);
145
162
164void co_csdo_destroy(co_csdo_t *sdo);
165
168
171
173co_unsigned8_t co_csdo_get_num(const co_csdo_t *sdo);
174
176const struct co_sdo_par *co_csdo_get_par(const co_csdo_t *sdo);
177
184int co_csdo_get_timeout(const co_csdo_t *sdo);
185
196void co_csdo_set_timeout(co_csdo_t *sdo, int timeout);
197
211 const co_csdo_t *sdo, co_csdo_ind_t **pind, void **pdata);
212
224void co_csdo_set_dn_ind(co_csdo_t *sdo, co_csdo_ind_t *ind, void *data);
225
239 const co_csdo_t *sdo, co_csdo_ind_t **pind, void **pdata);
240
252void co_csdo_set_up_ind(co_csdo_t *sdo, co_csdo_ind_t *ind, void *data);
253
258int co_csdo_is_idle(const co_csdo_t *sdo);
259
267void co_csdo_abort_req(co_csdo_t *sdo, co_unsigned32_t ac);
268
287int co_csdo_dn_req(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx,
288 const void *ptr, size_t n, co_csdo_dn_con_t *con, void *data);
289
310int co_csdo_dn_val_req(co_csdo_t *sdo, co_unsigned16_t idx,
311 co_unsigned8_t subidx, co_unsigned16_t type, const void *val,
312 co_csdo_dn_con_t *con, void *data);
313
330int co_csdo_up_req(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx,
331 co_csdo_up_con_t *con, void *data);
332
351int co_csdo_blk_dn_req(co_csdo_t *sdo, co_unsigned16_t idx,
352 co_unsigned8_t subidx, const void *ptr, size_t n,
353 co_csdo_dn_con_t *con, void *data);
354
374int co_csdo_blk_up_req(co_csdo_t *sdo, co_unsigned16_t idx,
375 co_unsigned8_t subidx, uint8_t pst, co_csdo_up_con_t *con,
376 void *data);
377
378#ifdef __cplusplus
379}
380#endif
381
382#endif // !LELY_CO_CSDO_H_
int co_csdo_up_req(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, co_csdo_up_con_t *con, void *data)
Submits an upload request to a remote Server-SDO.
Definition: csdo.c:1080
void co_csdo_up_con_t(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, co_unsigned32_t ac, const void *ptr, size_t n, void *data)
The type of a CANopen Client-SDO upload confirmation callback function, invoked when an upload reques...
Definition: csdo.h:59
int co_dev_up_req(const co_dev_t *dev, co_unsigned16_t idx, co_unsigned8_t subidx, co_csdo_up_con_t *con, void *data)
Submits an upload request to a local device.
Definition: csdo.c:675
int co_csdo_is_idle(const co_csdo_t *sdo)
Returns 1 if the specified Client-SDO service is idle, and 0 if a transfer is ongoing.
Definition: csdo.c:995
int co_csdo_blk_up_req(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, uint8_t pst, co_csdo_up_con_t *con, void *data)
Submits a block upload request to a remote Server-SDO.
Definition: csdo.c:1121
int co_csdo_dn_req(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, const void *ptr, size_t n, co_csdo_dn_con_t *con, void *data)
Submits a download request to a remote Server-SDO.
Definition: csdo.c:1011
int co_dev_dn_val_req(co_dev_t *dev, co_unsigned16_t idx, co_unsigned8_t subidx, co_unsigned16_t type, const void *val, co_csdo_dn_con_t *con, void *data)
Submits a download request to a local device.
Definition: csdo.c:637
void co_csdo_dn_con_t(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, co_unsigned32_t ac, void *data)
The type of a CANopen Client-SDO download confirmation callback function, invoked when a download req...
Definition: csdo.h:43
int co_dev_dn_req(co_dev_t *dev, co_unsigned16_t idx, co_unsigned8_t subidx, const void *ptr, size_t n, co_csdo_dn_con_t *con, void *data)
Submits a download request to a local device.
Definition: csdo.c:600
can_net_t * co_csdo_get_net(const co_csdo_t *sdo)
Returns a pointer to the CAN network of a Client-SDO.
Definition: csdo.c:904
co_dev_t * co_csdo_get_dev(const co_csdo_t *sdo)
Returns a pointer to the CANopen device of a Client-SDO.
Definition: csdo.c:912
void co_csdo_set_timeout(co_csdo_t *sdo, int timeout)
Sets the timeout of a Client-SDO.
Definition: csdo.c:944
int co_csdo_get_timeout(const co_csdo_t *sdo)
Returns the timeout (in milliseconds) of a Client-SDO.
Definition: csdo.c:936
int co_csdo_blk_dn_req(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, const void *ptr, size_t n, co_csdo_dn_con_t *con, void *data)
Submits a block download request to a remote Server-SDO.
Definition: csdo.c:1099
void co_csdo_set_up_ind(co_csdo_t *sdo, co_csdo_ind_t *ind, void *data)
Sets the indication function used to notify the user of the progress of the current SDO upload reques...
Definition: csdo.c:986
void co_csdo_abort_req(co_csdo_t *sdo, co_unsigned32_t ac)
Submits an abort transfer request to a remote Server-SDO.
Definition: csdo.c:1003
void co_csdo_ind_t(const co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, size_t size, size_t nbyte, void *data)
The type of a CANopen Client-SDO request progress indication function, used to notify the user of the...
Definition: csdo.h:79
void co_csdo_get_up_ind(const co_csdo_t *sdo, co_csdo_ind_t **pind, void **pdata)
Retrieves the indication function used to notify the user of the progress of the current SDO upload r...
Definition: csdo.c:975
const struct co_sdo_par * co_csdo_get_par(const co_csdo_t *sdo)
Returns a pointer to the SDO parameter record of a Client-SDO.
Definition: csdo.c:928
void co_csdo_set_dn_ind(co_csdo_t *sdo, co_csdo_ind_t *ind, void *data)
Sets the indication function used to notify the user of the progress of the current SDO download requ...
Definition: csdo.c:966
co_csdo_t * co_csdo_create(can_net_t *net, co_dev_t *dev, co_unsigned8_t num)
Creates a new CANopen Client-SDO service.
Definition: csdo.c:867
co_unsigned8_t co_csdo_get_num(const co_csdo_t *sdo)
Returns the SDO number of a Client-SDO.
Definition: csdo.c:920
void co_csdo_get_dn_ind(const co_csdo_t *sdo, co_csdo_ind_t **pind, void **pdata)
Retrieves the indication function used to notify the user of the progress of the current SDO download...
Definition: csdo.c:955
int co_csdo_dn_val_req(co_csdo_t *sdo, co_unsigned16_t idx, co_unsigned8_t subidx, co_unsigned16_t type, const void *val, co_csdo_dn_con_t *con, void *data)
Submits a download request to a remote Server-SDO.
Definition: csdo.c:1036
void co_csdo_destroy(co_csdo_t *sdo)
Destroys a CANopen Client-SDO service.
Definition: csdo.c:894
This header file is part of the CANopen library; it contains the Service Data Object (SDO) declaratio...
This header file is part of the CAN library; it contains the CAN network interface declarations.
A CAN network interface.
Definition: net.c:37
A CANopen Client-SDO.
Definition: csdo.c:45
co_unsigned8_t num
The SDO number.
Definition: csdo.c:51
can_net_t * net
A pointer to a CAN network interface.
Definition: csdo.c:47
co_dev_t * dev
A pointer to a CANopen device.
Definition: csdo.c:49
A CANopen device.
Definition: dev.c:38
An SDO parameter record.
Definition: sdo.h:45
co_unsigned8_t n
Highest sub-index supported.
Definition: sdo.h:47