Lely core libraries  2.3.4
gw.h
Go to the documentation of this file.
1 
22 #ifndef LELY_CO_GW_H_
23 #define LELY_CO_GW_H_
24 
25 #include <lely/co/dev.h>
26 #include <lely/libc/time.h>
27 
29 #define CO_GW_NUM_NET 127
30 
32 #define CO_GW_PROT_HI 2
33 
35 #define CO_GW_PROT_LO 0
36 
38 #define CO_GW_SRV_SDO_UP 0x11
39 
41 #define CO_GW_SRV_SDO_DN 0x13
42 
44 #define CO_GW_SRV_SET_SDO_TIMEOUT 0x14
45 
47 #define CO_GW_SRV_SET_RPDO 0x21
48 
50 #define CO_GW_SRV_SET_TPDO 0x22
51 
53 #define CO_GW_SRV_PDO_READ 0x23
54 
56 #define CO_GW_SRV_PDO_WRITE 0x24
57 
59 #define CO_GW_SRV_RPDO 0x25
60 
62 #define CO_GW_SRV_NMT_START 0x31
63 
65 #define CO_GW_SRV_NMT_STOP 0x32
66 
68 #define CO_GW_SRV_NMT_ENTER_PREOP 0x33
69 
71 #define CO_GW_SRV_NMT_RESET_NODE 0x34
72 
74 #define CO_GW_SRV_NMT_RESET_COMM 0x35
75 
77 #define CO_GW_SRV_NMT_NG_ENABLE 0x36
78 
80 #define CO_GW_SRV_NMT_NG_DISABLE 0x37
81 
83 #define CO_GW_SRV_NMT_HB_ENABLE 0x38
84 
86 #define CO_GW_SRV_NMT_HB_DISABLE 0x39
87 
89 #define CO_GW_SRV_EC 0x3a
90 
92 #define CO_GW_SRV_EMCY 0x42
93 
95 #define CO_GW_SRV_INIT 0x51
96 
98 #define CO_GW_SRV_SET_HB 0x54
99 
101 #define CO_GW_SRV_SET_ID 0x55
102 
104 #define CO_GW_SRV_EMCY_START 0x56
105 
107 #define CO_GW_SRV_EMCY_STOP 0x57
108 
110 #define CO_GW_SRV_SET_CMD_TIMEOUT 0x58
111 
113 #define CO_GW_SRV_SET_BOOTUP_IND 0x59
114 
116 #define CO_GW_SRV_SET_NET 0x61
117 
119 #define CO_GW_SRV_SET_NODE 0x62
120 
122 #define CO_GW_SRV_GET_VERSION 0x63
123 
125 #define CO_GW_SRV_SET_CMD_SIZE 0x64
126 
128 #define CO_GW_SRV_LSS_SWITCH 0x81
129 
131 #define CO_GW_SRV_LSS_SWITCH_SEL 0x82
132 
134 #define CO_GW_SRV_LSS_SET_ID 0x83
135 
137 #define CO_GW_SRV_LSS_SET_RATE 0x84
138 
140 #define CO_GW_SRV_LSS_SWITCH_RATE 0x85
141 
143 #define CO_GW_SRV_LSS_STORE 0x86
144 
146 #define CO_GW_SRV_LSS_GET_LSSID 0x87
147 
149 #define CO_GW_SRV_LSS_GET_ID 0x88
150 
152 #define CO_GW_SRV_LSS_ID_SLAVE 0x89
153 
155 #define CO_GW_SRV_LSS_ID_NON_CFG_SLAVE 0x8a
156 
158 #define CO_GW_SRV_SDO 0x93
159 
161 #define CO_GW_SRV__LSS_SLOWSCAN 0x101
162 
164 #define CO_GW_SRV__LSS_FASTSCAN 0x102
165 
167 #define CO_GW_SRV__SYNC 0x103
168 
170 #define CO_GW_SRV__TIME 0x104
171 
173 #define CO_GW_SRV__BOOT 0x105
174 
176 #define CO_GW_IEC_BAD_SRV 100
177 
179 #define CO_GW_IEC_SYNTAX 101
180 
182 #define CO_GW_IEC_INTERN 102
183 
185 #define CO_GW_IEC_TIMEOUT 103
186 
188 #define CO_GW_IEC_NO_DEF_NET 104
189 
191 #define CO_GW_IEC_NO_DEF_NODE 105
192 
194 #define CO_GW_IEC_BAD_NET 106
195 
197 #define CO_GW_IEC_BAD_NODE 107
198 
200 #define CO_GW_IEC_NG_OCCURRED 200
201 
203 #define CO_GW_IEC_LG_OCCURRED 201
204 
206 #define CO_GW_IEC_HB_RESOLVED 202
207 
209 #define CO_GW_IEC_HB_OCCURRED 203
210 
212 #define CO_GW_IEC_ST_OCCURRED 204
213 
215 #define CO_GW_IEC_BOOTUP 205
216 
218 #define CO_GW_IEC_CAN_PASSIVE 300
219 
221 #define CO_GW_IEC_CAN_BUSOFF 301
222 
224 #define CO_GW_IEC_CAN_OVERFLOW 303
225 
227 #define CO_GW_IEC_CAN_INIT 304
228 
230 #define CO_GW_IEC_CAN_ACTIVE 305
231 
233 #define CO_GW_IEC_PDO_INUSE 400
234 
236 #define CO_GW_IEC_PDO_LEN 401
237 
239 #define CO_GW_IEC_LSS 501
240 
242 #define CO_GW_IEC_LSS_ID 502
243 
245 #define CO_GW_IEC_LSS_RATE 503
246 
248 #define CO_GW_IEC_LSS_PARAM 504
249 
251 #define CO_GW_IEC_LSS_MEDIA 505
252 
254 #define CO_GW_IEC_NO_MEM 600
255 
256 struct __co_gw;
257 #if !defined(__cplusplus) || LELY_NO_CXX
259 typedef struct __co_gw co_gw_t;
260 #endif
261 
263 struct co_gw_srv {
265  size_t size;
267  int srv;
268 };
269 
271 struct co_gw_req {
273  size_t size;
275  int srv;
277  void *data;
278 };
279 
283  size_t size;
285  int srv;
287  void *data;
289  co_unsigned16_t net;
290 };
291 
295  size_t size;
297  int srv;
299  void *data;
301  co_unsigned16_t net;
303  co_unsigned8_t node;
304 };
305 
309  size_t size;
311  int srv;
313  void *data;
315  co_unsigned16_t net;
317  co_unsigned8_t node;
319  co_unsigned16_t idx;
321  co_unsigned8_t subidx;
323  co_unsigned16_t type;
324 };
325 
329  size_t size;
331  int srv;
333  void *data;
335  co_unsigned16_t net;
337  co_unsigned8_t node;
339  co_unsigned16_t idx;
341  co_unsigned8_t subidx;
343  co_unsigned32_t len;
345  uint_least8_t val[1];
346 };
347 
349 #define CO_GW_REQ_SDO_DN_SIZE offsetof(struct co_gw_req_sdo_dn, val)
350 
354  size_t size;
356  int srv;
358  void *data;
360  co_unsigned16_t net;
362  int timeout;
363 };
364 
368  size_t size;
370  int srv;
372  void *data;
374  co_unsigned16_t net;
376  co_unsigned16_t num;
378  co_unsigned32_t cobid;
380  co_unsigned8_t trans;
382  co_unsigned8_t n;
384  co_unsigned32_t map[0x40];
385 };
386 
388 #define CO_GW_REQ_SET_RPDO_SIZE offsetof(struct co_gw_req_set_rpdo, map)
389 
393  size_t size;
395  int srv;
397  void *data;
399  co_unsigned16_t net;
401  co_unsigned16_t num;
403  co_unsigned32_t cobid;
405  co_unsigned8_t trans;
407  co_unsigned16_t inhibit;
409  co_unsigned16_t event;
411  co_unsigned8_t sync;
413  co_unsigned8_t n;
415  co_unsigned32_t map[0x40];
416 };
417 
419 #define CO_GW_REQ_SET_TPDO_SIZE offsetof(struct co_gw_req_set_tpdo, map)
420 
424  size_t size;
426  int srv;
428  void *data;
430  co_unsigned16_t net;
432  co_unsigned16_t num;
433 };
434 
438  size_t size;
440  int srv;
442  void *data;
444  co_unsigned16_t net;
446  co_unsigned16_t num;
448  co_unsigned8_t n;
450  co_unsigned64_t val[0x40];
451 };
452 
454 #define CO_GW_REQ_PDO_WRITE_SIZE offsetof(struct co_gw_req_pdo_write, val)
455 
459  size_t size;
461  int srv;
463  void *data;
465  co_unsigned16_t net;
467  co_unsigned8_t node;
469  co_unsigned16_t gt;
471  co_unsigned8_t ltf;
472 };
473 
477  size_t size;
479  int srv;
481  void *data;
483  co_unsigned16_t net;
485  co_unsigned8_t node;
487  co_unsigned16_t ms;
488 };
489 
493  size_t size;
495  int srv;
497  void *data;
499  co_unsigned16_t net;
501  co_unsigned8_t bitidx;
502 };
503 
507  size_t size;
509  int srv;
511  void *data;
513  co_unsigned16_t net;
515  co_unsigned16_t ms;
516 };
517 
521  size_t size;
523  int srv;
525  void *data;
527  co_unsigned16_t net;
529  co_unsigned8_t node;
531  co_unsigned32_t cobid;
532 };
533 
537  size_t size;
539  int srv;
541  void *data;
543  int timeout;
544 };
545 
549  size_t size;
551  int srv;
553  void *data;
555  co_unsigned16_t net;
560  unsigned cs : 1;
561 };
562 
566  size_t size;
568  int srv;
570  void *data;
572  co_unsigned32_t n;
573 };
574 
578  size_t size;
580  int srv;
582  void *data;
584  co_unsigned16_t net;
586  co_unsigned8_t mode;
587 };
588 
592  size_t size;
594  int srv;
596  void *data;
598  co_unsigned16_t net;
600  struct co_id id;
601 };
602 
606  size_t size;
608  int srv;
610  void *data;
612  co_unsigned16_t net;
614  co_unsigned8_t bitsel;
616  co_unsigned8_t bitidx;
617 };
618 
622  size_t size;
624  int srv;
626  void *data;
628  co_unsigned16_t net;
630  co_unsigned16_t delay;
631 };
632 
636  size_t size;
638  int srv;
640  void *data;
642  co_unsigned16_t net;
644  co_unsigned8_t cs;
645 };
646 
650  size_t size;
652  int srv;
654  void *data;
656  co_unsigned16_t net;
658  struct co_id lo;
660  struct co_id hi;
661 };
662 
666  size_t size;
671  int srv;
673  void *data;
675  co_unsigned16_t net;
681  struct co_id id_1;
687  struct co_id id_2;
688 };
689 
691 struct co_gw_con {
693  size_t size;
695  int srv;
697  void *data;
699  int iec;
701  co_unsigned32_t ac;
702 };
703 
707  size_t size;
709  int srv;
711  void *data;
713  int iec;
715  co_unsigned32_t ac;
717  co_unsigned16_t type;
719  co_unsigned32_t len;
721  uint_least8_t val[1];
722 };
723 
725 #define CO_GW_CON_SDO_UP_SIZE offsetof(struct co_gw_con_sdo_up, val)
726 
730  size_t size;
732  int srv;
734  void *data;
736  int iec;
738  co_unsigned32_t ac;
740  co_unsigned16_t net;
742  co_unsigned16_t num;
744  co_unsigned8_t n;
746  co_unsigned64_t val[0x40];
747 };
748 
750 #define CO_GW_CON_PDO_READ_SIZE offsetof(struct co_gw_con_pdo_read, val)
751 
755  size_t size;
757  int srv;
759  void *data;
761  int iec;
763  co_unsigned32_t ac;
765  co_unsigned32_t vendor_id;
767  co_unsigned32_t product_code;
769  co_unsigned32_t revision;
771  co_unsigned32_t serial_nr;
773  co_unsigned8_t gw_class;
775  co_unsigned8_t prot_hi;
777  co_unsigned8_t prot_lo;
778 };
779 
783  size_t size;
785  int srv;
787  void *data;
789  int iec;
791  co_unsigned32_t ac;
793  co_unsigned32_t id;
794 };
795 
799  size_t size;
801  int srv;
803  void *data;
805  int iec;
807  co_unsigned32_t ac;
809  co_unsigned8_t id;
810 };
811 
818  size_t size;
823  int srv;
825  void *data;
827  int iec;
829  co_unsigned32_t ac;
831  struct co_id id;
832 };
833 
837  size_t size;
839  int srv;
841  co_unsigned16_t net;
843  co_unsigned16_t num;
845  co_unsigned8_t n;
847  co_unsigned64_t val[0x40];
848 };
849 
851 #define CO_GW_IND_RPDO_SIZE offsetof(struct co_gw_ind_rpdo, val)
852 
857 struct co_gw_ind_ec {
859  size_t size;
861  int srv;
863  co_unsigned16_t net;
865  co_unsigned8_t node;
867  co_unsigned8_t st;
869  int iec;
870 };
871 
875  size_t size;
877  int srv;
879  co_unsigned16_t net;
881  co_unsigned8_t node;
883  co_unsigned16_t ec;
885  co_unsigned8_t er;
887  co_unsigned8_t msef[5];
888 };
889 
896  size_t size;
898  int srv;
900  co_unsigned16_t net;
902  co_unsigned8_t node;
904  co_unsigned32_t nbyte;
906  unsigned int up : 1;
908  void *data;
910  co_unsigned32_t _size;
911 };
912 
919  size_t size;
921  int srv;
923  co_unsigned16_t net;
925  co_unsigned8_t cnt;
926 };
927 
934  size_t size;
936  int srv;
938  co_unsigned16_t net;
940  struct timespec ts;
941 };
942 
949  size_t size;
951  int srv;
953  co_unsigned16_t net;
955  co_unsigned8_t node;
957  co_unsigned8_t st;
959  char es;
960 };
961 
962 #ifdef __cplusplus
963 extern "C" {
964 #endif
965 
976 typedef int co_gw_send_func_t(const struct co_gw_srv *srv, void *data);
977 
986 typedef void co_gw_rate_func_t(
987  co_unsigned16_t net, co_unsigned16_t rate, void *data);
988 
990 const char *co_gw_iec2str(int iec);
991 
992 void *__co_gw_alloc(void);
993 void __co_gw_free(void *ptr);
994 struct __co_gw *__co_gw_init(struct __co_gw *gw);
995 void __co_gw_fini(struct __co_gw *gw);
996 
998 co_gw_t *co_gw_create(void);
999 
1001 void co_gw_destroy(co_gw_t *gw);
1002 
1016 int co_gw_init_net(co_gw_t *gw, co_unsigned16_t id, co_nmt_t *nmt);
1017 
1029 int co_gw_fini_net(co_gw_t *gw, co_unsigned16_t id);
1030 
1040 int co_gw_recv(co_gw_t *gw, const struct co_gw_req *req);
1041 
1054 void co_gw_get_send_func(
1055  const co_gw_t *gw, co_gw_send_func_t **pfunc, void **pdata);
1056 
1069 void co_gw_set_send_func(co_gw_t *gw, co_gw_send_func_t *func, void *data);
1070 
1083 void co_gw_get_rate_func(
1084  const co_gw_t *gw, co_gw_rate_func_t **pfunc, void **pdata);
1085 
1098 void co_gw_set_rate_func(co_gw_t *gw, co_gw_rate_func_t *func, void *data);
1099 
1100 #ifdef __cplusplus
1101 }
1102 #endif
1103 
1104 #endif // !LELY_CO_GW_H_
This header file is part of the CANopen library; it contains the device description declarations.
int co_gw_recv(co_gw_t *gw, const struct co_gw_req *req)
Receives and processes a request with a CANopen gateway.
Definition: gw.c:614
void co_gw_set_rate_func(co_gw_t *gw, co_gw_rate_func_t *func, void *data)
Sets the callback function invoked when a baudrate switch is needed after an 'Initialize gateway' com...
Definition: gw.c:945
int co_gw_init_net(co_gw_t *gw, co_unsigned16_t id, co_nmt_t *nmt)
Registers a CANopen network with a gateway.
Definition: gw.c:583
void co_gw_get_rate_func(const co_gw_t *gw, co_gw_rate_func_t **pfunc, void **pdata)
Retrieves the callback function invoked when a baudrate switch is needed after an 'Initialize gateway...
Definition: gw.c:934
int co_gw_send_func_t(const struct co_gw_srv *srv, void *data)
The type of a CANopen gateway send callback function, invoked by a gateway when an indication or conf...
Definition: gw.h:976
int co_gw_fini_net(co_gw_t *gw, co_unsigned16_t id)
Unregisters a CANopen network with a gateway.
Definition: gw.c:598
void co_gw_destroy(co_gw_t *gw)
Destroys a CANopen gateway.
Definition: gw.c:574
void co_gw_rate_func_t(co_unsigned16_t net, co_unsigned16_t rate, void *data)
The type of a CANopen gateway 'set bit timing' function, invoked when a baudrate switch is needed aft...
Definition: gw.h:986
co_gw_t * co_gw_create(void)
Creates a new CANopen gateway.
Definition: gw.c:549
void co_gw_get_send_func(const co_gw_t *gw, co_gw_send_func_t **pfunc, void **pdata)
Retrieves the callback function used to send indications and confirmations from a CANopen gateway.
Definition: gw.c:914
const char * co_gw_iec2str(int iec)
Returns a string describing an internal error code.
Definition: gw.c:466
void co_gw_set_send_func(co_gw_t *gw, co_gw_send_func_t *func, void *data)
Sets the callback function used to send indications and confirmations from a CANopen gateway.
Definition: gw.c:925
This header file is part of the C11 and POSIX compatibility library; it includes <time....
A CANopen gateway.
Definition: gw.c:313
A CANopen NMT master/slave service.
Definition: nmt.c:148
The parameters of a Lely-specific gateway 'LSS Slowscan/Fastscan' confirmation.
Definition: gw.h:816
int srv
The service number (CO_GW_SRV__LSS_SLOWSCAN or CO_GW_SRV__LSS_FASTSCAN).
Definition: gw.h:823
int iec
The internal error code (0 on success).
Definition: gw.h:827
void * data
A pointer to user-specified data.
Definition: gw.h:825
struct co_id id
The LSS address.
Definition: gw.h:831
co_unsigned32_t ac
The SDO abort code (0 on success).
Definition: gw.h:829
size_t size
The size of this struct (in bytes).
Definition: gw.h:818
The parameters of a CANopen gateway 'Get version' confirmation.
Definition: gw.h:753
size_t size
The size of this struct (in bytes).
Definition: gw.h:755
co_unsigned32_t ac
The SDO abort code (0 on success).
Definition: gw.h:763
co_unsigned32_t product_code
The product code.
Definition: gw.h:767
int srv
The service number (CO_GW_SRV_GET_VERSION).
Definition: gw.h:757
void * data
A pointer to user-specified data.
Definition: gw.h:759
co_unsigned8_t gw_class
The gateway class.
Definition: gw.h:773
co_unsigned8_t prot_hi
The protocol version (high number).
Definition: gw.h:775
co_unsigned32_t revision
The revision number.
Definition: gw.h:769
co_unsigned8_t prot_lo
The protocol version (low number).
Definition: gw.h:777
int iec
The internal error code (0 on success).
Definition: gw.h:761
co_unsigned32_t vendor_id
The vendor-ID.
Definition: gw.h:765
co_unsigned32_t serial_nr
The serial number.
Definition: gw.h:771
The parameters of a CANopen gateway 'LSS inquire node-ID' confirmation.
Definition: gw.h:797
co_unsigned8_t id
The node-ID.
Definition: gw.h:809
void * data
A pointer to user-specified data.
Definition: gw.h:803
co_unsigned32_t ac
The SDO abort code (0 on success).
Definition: gw.h:807
int iec
The internal error code (0 on success).
Definition: gw.h:805
size_t size
The size of this struct (in bytes).
Definition: gw.h:799
int srv
The service number (CO_GW_SRV_LSS_GET_ID).
Definition: gw.h:801
The parameters of a CANopen gateway 'Inquire LSS address' confirmation.
Definition: gw.h:781
int iec
The internal error code (0 on success).
Definition: gw.h:789
co_unsigned32_t id
The LSS number.
Definition: gw.h:793
size_t size
The size of this struct (in bytes).
Definition: gw.h:783
int srv
The service number (CO_GW_SRV_LSS_GET_LSSID).
Definition: gw.h:785
void * data
A pointer to user-specified data.
Definition: gw.h:787
co_unsigned32_t ac
The SDO abort code (0 on success).
Definition: gw.h:791
The parameters of a CANopen gateway 'Read PDO' confirmation.
Definition: gw.h:728
void * data
A pointer to user-specified data.
Definition: gw.h:734
co_unsigned8_t n
Number of mapped objects in PDO.
Definition: gw.h:744
co_unsigned16_t net
The network-ID.
Definition: gw.h:740
int srv
The service number (CO_GW_SRV_PDO_READ).
Definition: gw.h:732
co_unsigned64_t val[0x40]
An array of object values.
Definition: gw.h:746
co_unsigned16_t num
The PDO number.
Definition: gw.h:742
co_unsigned32_t ac
The SDO abort code (0 on success).
Definition: gw.h:738
int iec
The internal error code (0 on success).
Definition: gw.h:736
size_t size
The size of this struct (in bytes).
Definition: gw.h:730
The parameters of a CANopen gateway 'SDO upload' confirmation.
Definition: gw.h:705
co_unsigned32_t len
The length of the value (in bytes).
Definition: gw.h:719
co_unsigned16_t type
The data type.
Definition: gw.h:717
size_t size
The size of this struct (in bytes).
Definition: gw.h:707
int srv
The service number (CO_GW_SRV_SDO_UP).
Definition: gw.h:709
int iec
The internal error code (0 on success).
Definition: gw.h:713
void * data
A pointer to user-specified data.
Definition: gw.h:711
co_unsigned32_t ac
The SDO abort code (0 on success).
Definition: gw.h:715
uint_least8_t val[1]
The (first byte in the) value.
Definition: gw.h:721
The common parameters of a CANopen gateway confirmation.
Definition: gw.h:691
void * data
A pointer to user-specified data.
Definition: gw.h:697
int iec
The internal error code (0 on success).
Definition: gw.h:699
int srv
The service number.
Definition: gw.h:695
size_t size
The size of this struct (in bytes).
Definition: gw.h:693
co_unsigned32_t ac
The SDO abort code (0 on success).
Definition: gw.h:701
The parameters of a Lely-specific gateway 'Boot slave process completed' indication.
Definition: gw.h:947
co_unsigned16_t net
The network-ID.
Definition: gw.h:953
char es
The error status (in the range ['A'..'O'], or 0 on success).
Definition: gw.h:959
size_t size
The size of this struct (in bytes).
Definition: gw.h:949
co_unsigned8_t node
The node-ID.
Definition: gw.h:955
int srv
The service number (CO_GW_SRV__BOOT).
Definition: gw.h:951
co_unsigned8_t st
The the state of the node (including the toggle bit).
Definition: gw.h:957
The parameters of a Lely-specific gateway 'Synchronization event received' indication.
Definition: gw.h:917
size_t size
The size of this struct (in bytes).
Definition: gw.h:919
co_unsigned16_t net
The network-ID.
Definition: gw.h:923
co_unsigned8_t cnt
The SYNC counter.
Definition: gw.h:925
int srv
The service number (CO_GW_SRV__SYNC).
Definition: gw.h:921
The parameters of a Lely-specific gateway 'Time stamp event received' indication.
Definition: gw.h:932
size_t size
The size of this struct (in bytes).
Definition: gw.h:934
struct timespec ts
The absolute time.
Definition: gw.h:940
int srv
The service number (CO_GW_SRV__TIME).
Definition: gw.h:936
co_unsigned16_t net
The network-ID.
Definition: gw.h:938
The parameters of a CANopen gateway 'Error control event received' indication.
Definition: gw.h:857
co_unsigned8_t node
The node-ID.
Definition: gw.h:865
int iec
The internal error code (0 on success).
Definition: gw.h:869
int srv
The service number (CO_GW_SRV_EC).
Definition: gw.h:861
co_unsigned16_t net
The network-ID.
Definition: gw.h:863
size_t size
The size of this struct (in bytes).
Definition: gw.h:859
co_unsigned8_t st
The state of the node, or 0 in case of a boot-up event.
Definition: gw.h:867
The parameters of a CANopen gateway 'Emergency event received' indication.
Definition: gw.h:873
int srv
The service number (CO_GW_SRV_EMCY).
Definition: gw.h:877
co_unsigned16_t net
The network-ID.
Definition: gw.h:879
co_unsigned16_t ec
The emergency error code.
Definition: gw.h:883
co_unsigned8_t msef[5]
The manufacturer-specific error code.
Definition: gw.h:887
co_unsigned8_t er
The error register.
Definition: gw.h:885
size_t size
The size of this struct (in bytes).
Definition: gw.h:875
co_unsigned8_t node
The node-ID.
Definition: gw.h:881
The parameters of a CANopen gateway 'RPDO received' indication.
Definition: gw.h:835
size_t size
The size of this struct (in bytes).
Definition: gw.h:837
co_unsigned16_t net
The network-ID.
Definition: gw.h:841
co_unsigned8_t n
Number of mapped objects in PDO.
Definition: gw.h:845
co_unsigned64_t val[0x40]
An array of object values.
Definition: gw.h:847
co_unsigned16_t num
The PDO number.
Definition: gw.h:843
int srv
The service number (CO_GW_SRV_RPDO).
Definition: gw.h:839
The parameters of a CANopen gateway 'CiA 301 progress indication download' indication.
Definition: gw.h:894
void * data
A pointer to user-specified data of the SDO upload/download request.
Definition: gw.h:908
size_t size
The size of this struct (in bytes).
Definition: gw.h:896
co_unsigned32_t nbyte
The transferred bytes.
Definition: gw.h:904
co_unsigned16_t net
The network-ID.
Definition: gw.h:900
co_unsigned32_t _size
The Lely-specific total value size (in bytes).
Definition: gw.h:910
int srv
The service number (CO_GW_SRV_SDO).
Definition: gw.h:898
co_unsigned8_t node
The node-ID.
Definition: gw.h:902
unsigned int up
The transfer direction: download (0) or upload (1).
Definition: gw.h:906
The parameters of a Lely-specific gateway 'LSS Slowscan/Fastscan' request.
Definition: gw.h:664
size_t size
The size of this struct (in bytes).
Definition: gw.h:666
struct co_id id_2
In case of an LSS Slowscan request, the upper bound of the LSS address; in case of an LSS Fastscan re...
Definition: gw.h:687
struct co_id id_1
In case of an LSS Slowscan request, the lower bound of the LSS address; in case of an LSS Fastscan re...
Definition: gw.h:681
void * data
A pointer to user-specified data.
Definition: gw.h:673
int srv
The service number (CO_GW_SRV__LSS_SLOWSCAN or CO_GW_SRV__LSS_FASTSCAN).
Definition: gw.h:671
co_unsigned16_t net
The network-ID.
Definition: gw.h:675
The parameters of a CANopen gateway 'Initialize gateway' request.
Definition: gw.h:491
int srv
The service number (CO_GW_SRV_INIT).
Definition: gw.h:495
co_unsigned16_t net
The network-ID.
Definition: gw.h:499
size_t size
The size of this struct (in bytes).
Definition: gw.h:493
void * data
A pointer to user-specified data.
Definition: gw.h:497
co_unsigned8_t bitidx
The bit timing index (in the range [0..9]).
Definition: gw.h:501
The parameters of a CANopen gateway 'Inquire LSS address' request.
Definition: gw.h:634
co_unsigned8_t cs
The command specifier (one of 0x5a, 0x5b, 0x5c or 0x5d).
Definition: gw.h:644
int srv
The service number (CO_GW_SRV_LSS_GET_LSSID).
Definition: gw.h:638
size_t size
The size of this struct (in bytes).
Definition: gw.h:636
co_unsigned16_t net
The network-ID.
Definition: gw.h:642
void * data
A pointer to user-specified data.
Definition: gw.h:640
The parameters of a CANopen gateway 'LSS identify remote slave' request.
Definition: gw.h:648
void * data
A pointer to user-specified data.
Definition: gw.h:654
size_t size
The size of this struct (in bytes).
Definition: gw.h:650
int srv
The service number (CO_GW_SRV_LSS_ID_SLAVE).
Definition: gw.h:652
struct co_id lo
The lower bound of the LSS address.
Definition: gw.h:658
co_unsigned16_t net
The network-ID.
Definition: gw.h:656
struct co_id hi
The upper bound of the LSS address.
Definition: gw.h:660
The parameters of a CANopen gateway 'LSS configure bit-rate' request.
Definition: gw.h:604
co_unsigned8_t bitsel
The bit timing selector.
Definition: gw.h:614
void * data
A pointer to user-specified data.
Definition: gw.h:610
size_t size
The size of this struct (in bytes).
Definition: gw.h:606
int srv
The service number (CO_GW_SRV_LSS_SET_RATE).
Definition: gw.h:608
co_unsigned16_t net
The network-ID.
Definition: gw.h:612
co_unsigned8_t bitidx
The bit timing index.
Definition: gw.h:616
The parameters of a CANopen gateway 'LSS activate new bit-rate' request.
Definition: gw.h:620
int srv
The service number (CO_GW_SRV_LSS_SWITCH_RATE).
Definition: gw.h:624
co_unsigned16_t delay
The delay (in milliseconds).
Definition: gw.h:630
void * data
A pointer to user-specified data.
Definition: gw.h:626
size_t size
The size of this struct (in bytes).
Definition: gw.h:622
co_unsigned16_t net
The network-ID.
Definition: gw.h:628
The parameters of a CANopen gateway 'LSS switch state selective' request.
Definition: gw.h:590
struct co_id id
The LSS address of the slave to be configured.
Definition: gw.h:600
void * data
A pointer to user-specified data.
Definition: gw.h:596
size_t size
The size of this struct (in bytes).
Definition: gw.h:592
co_unsigned16_t net
The network-ID.
Definition: gw.h:598
int srv
The service number (CO_GW_SRV_LSS_SWITCH_SEL).
Definition: gw.h:594
The parameters of a CANopen gateway 'LSS switch state global' request.
Definition: gw.h:576
size_t size
The size of this struct (in bytes).
Definition: gw.h:578
int srv
The service number (CO_GW_SRV_LSS_SWITCH).
Definition: gw.h:580
co_unsigned8_t mode
0 for waiting state, 1 for configuration state.
Definition: gw.h:586
co_unsigned16_t net
The network-ID.
Definition: gw.h:584
void * data
A pointer to user-specified data.
Definition: gw.h:582
The common parameters of a CANopen gateway network-level request.
Definition: gw.h:281
int srv
The service number.
Definition: gw.h:285
size_t size
The size of this struct (in bytes).
Definition: gw.h:283
co_unsigned16_t net
The network-ID.
Definition: gw.h:289
void * data
A pointer to user-specified data.
Definition: gw.h:287
The parameters of a CANopen gateway 'Start heartbeat consumer' request.
Definition: gw.h:475
int srv
The service number (CO_GW_SRV_NMT_HB_ENABLE).
Definition: gw.h:479
co_unsigned16_t net
The network-ID.
Definition: gw.h:483
size_t size
The size of this struct (in bytes).
Definition: gw.h:477
void * data
A pointer to user-specified data.
Definition: gw.h:481
co_unsigned8_t node
The node-ID.
Definition: gw.h:485
co_unsigned16_t ms
The heartbeat time (in milliseconds).
Definition: gw.h:487
The parameters of a CANopen gateway 'Enable node guarding' request.
Definition: gw.h:457
co_unsigned8_t node
The node-ID.
Definition: gw.h:467
co_unsigned16_t net
The network-ID.
Definition: gw.h:465
co_unsigned8_t ltf
The lifetime factor.
Definition: gw.h:471
size_t size
The size of this struct (in bytes).
Definition: gw.h:459
void * data
A pointer to user-specified data.
Definition: gw.h:463
co_unsigned16_t gt
The guard time (in milliseconds).
Definition: gw.h:469
int srv
The service number (CO_GW_SRV_NMT_NG_ENABLE).
Definition: gw.h:461
The common parameters of a CANopen gateway node-level request.
Definition: gw.h:293
void * data
A pointer to user-specified data.
Definition: gw.h:299
co_unsigned16_t net
The network-ID.
Definition: gw.h:301
co_unsigned8_t node
The node-ID.
Definition: gw.h:303
size_t size
The size of this struct (in bytes).
Definition: gw.h:295
int srv
The service number.
Definition: gw.h:297
The parameters of a CANopen gateway 'Read PDO' request.
Definition: gw.h:422
co_unsigned16_t num
The PDO number.
Definition: gw.h:432
co_unsigned16_t net
The network-ID.
Definition: gw.h:430
void * data
A pointer to user-specified data.
Definition: gw.h:428
int srv
The service number (CO_GW_SRV_PDO_READ).
Definition: gw.h:426
size_t size
The size of this struct (in bytes).
Definition: gw.h:424
The parameters of a CANopen gateway 'Write PDO' request.
Definition: gw.h:436
co_unsigned8_t n
Number of mapped objects in PDO.
Definition: gw.h:448
void * data
A pointer to user-specified data.
Definition: gw.h:442
co_unsigned16_t num
The PDO number.
Definition: gw.h:446
co_unsigned16_t net
The network-ID.
Definition: gw.h:444
size_t size
The size of this struct (in bytes).
Definition: gw.h:438
int srv
The service number (CO_GW_SRV_PDO_WRITE).
Definition: gw.h:440
co_unsigned64_t val[0x40]
An array of object values.
Definition: gw.h:450
The parameters of a CANopen gateway 'SDO download' request.
Definition: gw.h:327
co_unsigned16_t net
The network-ID.
Definition: gw.h:335
co_unsigned16_t idx
The object index.
Definition: gw.h:339
void * data
A pointer to user-specified data.
Definition: gw.h:333
size_t size
The size of this struct (in bytes).
Definition: gw.h:329
co_unsigned32_t len
The length of the value (in bytes).
Definition: gw.h:343
co_unsigned8_t subidx
The object sub-index.
Definition: gw.h:341
co_unsigned8_t node
The node-ID.
Definition: gw.h:337
uint_least8_t val[1]
The (first byte in the) value.
Definition: gw.h:345
int srv
The service number (CO_GW_SRV_SDO_DN).
Definition: gw.h:331
The parameters of a CANopen gateway 'SDO upload' request.
Definition: gw.h:307
size_t size
The size of this struct (in bytes).
Definition: gw.h:309
co_unsigned8_t node
The node-ID.
Definition: gw.h:317
void * data
A pointer to user-specified data.
Definition: gw.h:313
co_unsigned8_t subidx
The object sub-index.
Definition: gw.h:321
co_unsigned16_t idx
The object index.
Definition: gw.h:319
int srv
The service number (CO_GW_SRV_SDO_UP).
Definition: gw.h:311
co_unsigned16_t type
The data type.
Definition: gw.h:323
co_unsigned16_t net
The network-ID.
Definition: gw.h:315
The parameters of a CANopen gateway 'Boot-up forwarding' request.
Definition: gw.h:547
co_unsigned16_t net
The network-ID.
Definition: gw.h:555
int srv
The service number (CO_GW_SRV_SET_BOOTUP_IND).
Definition: gw.h:551
unsigned cs
A flag indicating whether "boot-up event received" commands should be forwarded (1) or not (0).
Definition: gw.h:560
void * data
A pointer to user-specified data.
Definition: gw.h:553
size_t size
The size of this struct (in bytes).
Definition: gw.h:549
The parameters of a CANopen gateway 'Set command size' request.
Definition: gw.h:564
int srv
The service number (CO_GW_SRV_SET_CMD_TIMEOUT).
Definition: gw.h:568
co_unsigned32_t n
The command size (in bytes).
Definition: gw.h:572
size_t size
The size of this struct (in bytes).
Definition: gw.h:566
void * data
A pointer to user-specified data.
Definition: gw.h:570
The parameters of a CANopen gateway 'Set command time-out' request.
Definition: gw.h:535
int srv
The service number (CO_GW_SRV_SET_CMD_TIMEOUT).
Definition: gw.h:539
void * data
A pointer to user-specified data.
Definition: gw.h:541
int timeout
The command timeout (in milliseconds).
Definition: gw.h:543
size_t size
The size of this struct (in bytes).
Definition: gw.h:537
The parameters of a CANopen gateway 'Start/Stop emergency consumer' request.
Definition: gw.h:519
void * data
A pointer to user-specified data.
Definition: gw.h:525
size_t size
The size of this struct (in bytes).
Definition: gw.h:521
int srv
The service number (CO_GW_SRV_EMCY_START or CO_GW_SRV_EMCY_STOP).
Definition: gw.h:523
co_unsigned8_t node
The node-ID.
Definition: gw.h:529
co_unsigned32_t cobid
The COB-ID.
Definition: gw.h:531
co_unsigned16_t net
The network-ID.
Definition: gw.h:527
The parameters of a CANopen gateway 'Set heartbeat producer' request.
Definition: gw.h:505
co_unsigned16_t ms
The heartbeat time (in milliseconds).
Definition: gw.h:515
size_t size
The size of this struct (in bytes).
Definition: gw.h:507
co_unsigned16_t net
The network-ID.
Definition: gw.h:513
void * data
A pointer to user-specified data.
Definition: gw.h:511
int srv
The service number (CO_GW_SRV_SET_HB).
Definition: gw.h:509
The parameters of a CANopen gateway 'Configure RPDO' request.
Definition: gw.h:366
size_t size
The size of this struct (in bytes).
Definition: gw.h:368
co_unsigned8_t n
Number of mapped objects in PDO.
Definition: gw.h:382
int srv
The service number (CO_GW_SRV_SET_RPDO).
Definition: gw.h:370
co_unsigned32_t cobid
The COB-ID.
Definition: gw.h:378
co_unsigned32_t map[0x40]
An array of objects to be mapped.
Definition: gw.h:384
co_unsigned16_t num
The PDO number.
Definition: gw.h:376
co_unsigned16_t net
The network-ID.
Definition: gw.h:374
co_unsigned8_t trans
The transmission type.
Definition: gw.h:380
void * data
A pointer to user-specified data.
Definition: gw.h:372
The parameters of a CANopen gateway 'Configure SDO time-out' request.
Definition: gw.h:352
int timeout
The SDO timeout (in milliseconds).
Definition: gw.h:362
void * data
A pointer to user-specified data.
Definition: gw.h:358
int srv
The service number (CO_GW_SRV_SET_SDO_TIMEOUT).
Definition: gw.h:356
size_t size
The size of this struct (in bytes).
Definition: gw.h:354
co_unsigned16_t net
The network-ID.
Definition: gw.h:360
The parameters of a CANopen gateway 'Configure TPDO' request.
Definition: gw.h:391
co_unsigned8_t n
Number of mapped objects in PDO.
Definition: gw.h:413
co_unsigned8_t sync
The SYNC start value.
Definition: gw.h:411
co_unsigned32_t map[0x40]
An array of objects to be mapped.
Definition: gw.h:415
co_unsigned8_t trans
The transmission type.
Definition: gw.h:405
int srv
The service number (CO_GW_SRV_SET_TPDO).
Definition: gw.h:395
void * data
A pointer to user-specified data.
Definition: gw.h:397
co_unsigned16_t net
The network-ID.
Definition: gw.h:399
co_unsigned16_t inhibit
The inhibit time.
Definition: gw.h:407
co_unsigned32_t cobid
The COB-ID.
Definition: gw.h:403
co_unsigned16_t event
The event timer.
Definition: gw.h:409
co_unsigned16_t num
The PDO number.
Definition: gw.h:401
size_t size
The size of this struct (in bytes).
Definition: gw.h:393
The common parameters of a CANopen gateway request.
Definition: gw.h:271
void * data
A pointer to user-specified data.
Definition: gw.h:277
size_t size
The size of this struct (in bytes).
Definition: gw.h:273
int srv
The service number.
Definition: gw.h:275
The common parameters of a CANopen gateway service.
Definition: gw.h:263
size_t size
The size of this struct (in bytes).
Definition: gw.h:265
int srv
The service number.
Definition: gw.h:267
An identity record.
Definition: dev.h:33