Lely core libraries  2.2.5
nmt.hpp
Go to the documentation of this file.
1 
23 #ifndef LELY_CO_NMT_HPP_
24 #define LELY_CO_NMT_HPP_
25 
26 #ifndef __cplusplus
27 #error "include <lely/co/nmt.h> for the C interface"
28 #endif
29 
30 #include <lely/can/net.hpp>
31 #include <lely/co/nmt.h>
32 
33 namespace lely {
34 
35 inline co_unsigned32_t
36 cfgHb(CODev& dev, co_unsigned8_t id, co_unsigned16_t ms) noexcept {
37  return co_dev_cfg_hb(&dev, id, ms);
38 }
39 
41 template <>
43  typedef __co_nmt value_type;
44  typedef value_type& reference;
45  typedef const value_type& const_reference;
46  typedef value_type* pointer;
47  typedef const value_type* const_pointer;
48 
49  static void*
50  alloc() noexcept {
51  return __co_nmt_alloc();
52  }
53 
54  static void
55  free(void* ptr) noexcept {
56  __co_nmt_free(ptr);
57  }
58 
59  static pointer
60  init(pointer p, CANNet* net, CODev* dev) noexcept {
61  return __co_nmt_init(p, net, dev);
62  }
63 
64  static void
65  fini(pointer p) noexcept {
66  __co_nmt_fini(p);
67  }
68 };
69 
71 class CONMT : public incomplete_c_type<__co_nmt> {
73 
74  public:
75  CONMT(CANNet* net, CODev* dev) : c_base(net, dev) {}
76 
77  CANNet*
78  getNet() const noexcept {
79  return co_nmt_get_net(this);
80  }
81 
82  CODev*
83  getDev() const noexcept {
84  return co_nmt_get_dev(this);
85  }
86 
87  void
88  getCsInd(co_nmt_cs_ind_t** pind, void** pdata) const noexcept {
89  co_nmt_get_cs_ind(this, pind, pdata);
90  }
91 
92  void
93  setCsInd(co_nmt_cs_ind_t* ind, void* data) noexcept {
94  co_nmt_set_cs_ind(this, ind, data);
95  }
96 
97  template <class F>
98  void
99  setCsInd(F* f) noexcept {
100  setCsInd(&c_obj_call<co_nmt_cs_ind_t*, F>::function, static_cast<void*>(f));
101  }
102 
103  template <class C, typename c_mem_fn<co_nmt_cs_ind_t*, C>::type M>
104  void
105  setCsInd(C* obj) noexcept {
107  static_cast<void*>(obj));
108  }
109 
110  void
111  getNgInd(co_nmt_ng_ind_t** pind, void** pdata) const noexcept {
112  co_nmt_get_ng_ind(this, pind, pdata);
113  }
114 
115  void
116  setNgInd(co_nmt_ng_ind_t* ind, void* data) noexcept {
117  co_nmt_set_ng_ind(this, ind, data);
118  }
119 
120  template <class F>
121  void
122  setNgInd(F* f) noexcept {
123  setNgInd(&c_obj_call<co_nmt_ng_ind_t*, F>::function, static_cast<void*>(f));
124  }
125 
126  template <class C, typename c_mem_fn<co_nmt_ng_ind_t*, C>::type M>
127  void
128  setNgInd(C* obj) noexcept {
130  static_cast<void*>(obj));
131  }
132 
133  void
134  onNg(co_unsigned8_t id, int state, int reason) noexcept {
135  co_nmt_on_ng(this, id, state, reason);
136  }
137 
138  void
139  getLgInd(co_nmt_lg_ind_t** pind, void** pdata) const noexcept {
140  co_nmt_get_lg_ind(this, pind, pdata);
141  }
142 
143  void
144  setLgInd(co_nmt_lg_ind_t* ind, void* data) noexcept {
145  co_nmt_set_lg_ind(this, ind, data);
146  }
147 
148  template <class F>
149  void
150  setLgInd(F* f) noexcept {
151  setLgInd(&c_obj_call<co_nmt_lg_ind_t*, F>::function, static_cast<void*>(f));
152  }
153 
154  template <class C, typename c_mem_fn<co_nmt_lg_ind_t*, C>::type M>
155  void
156  setLgInd(C* obj) noexcept {
158  static_cast<void*>(obj));
159  }
160 
161  void
162  onLg(int state) noexcept {
163  co_nmt_on_lg(this, state);
164  }
165 
166  void
167  getHbInd(co_nmt_hb_ind_t** pind, void** pdata) const noexcept {
168  co_nmt_get_hb_ind(this, pind, pdata);
169  }
170 
171  void
172  setHbInd(co_nmt_hb_ind_t* ind, void* data) noexcept {
173  co_nmt_set_hb_ind(this, ind, data);
174  }
175 
176  template <class F>
177  void
178  setHbInd(F* f) noexcept {
179  setHbInd(&c_obj_call<co_nmt_hb_ind_t*, F>::function, static_cast<void*>(f));
180  }
181 
182  template <class C, typename c_mem_fn<co_nmt_hb_ind_t*, C>::type M>
183  void
184  setHbInd(C* obj) noexcept {
186  static_cast<void*>(obj));
187  }
188 
189  void
190  onHb(co_unsigned8_t id, int state, int reason) noexcept {
191  co_nmt_on_hb(this, id, state, reason);
192  }
193 
194  void
195  getStInd(co_nmt_st_ind_t** pind, void** pdata) const noexcept {
196  co_nmt_get_st_ind(this, pind, pdata);
197  }
198 
199  void
200  setStInd(co_nmt_st_ind_t* ind, void* data) noexcept {
201  co_nmt_set_st_ind(this, ind, data);
202  }
203 
204  template <class F>
205  void
206  setStInd(F* f) noexcept {
207  setStInd(&c_obj_call<co_nmt_st_ind_t*, F>::function, static_cast<void*>(f));
208  }
209 
210  template <class C, typename c_mem_fn<co_nmt_st_ind_t*, C>::type M>
211  void
212  setStInd(C* obj) noexcept {
214  static_cast<void*>(obj));
215  }
216 
217  void
218  onSt(co_unsigned8_t id, co_unsigned8_t st) noexcept {
219  co_nmt_on_st(this, id, st);
220  }
221 
222  void
223  getLSSReq(co_nmt_lss_req_t** preq, void** pdata) const noexcept {
224  co_nmt_get_lss_req(this, preq, pdata);
225  }
226 
227  void
228  setLSSReq(co_nmt_lss_req_t* req, void* data) noexcept {
229  co_nmt_set_lss_req(this, req, data);
230  }
231 
232  template <class F>
233  void
234  setLSSReq(F* f) noexcept {
236  static_cast<void*>(f));
237  }
238 
239  template <class C, typename c_mem_fn<co_nmt_lss_req_t*, C>::type M>
240  void
241  setLSSReq(C* obj) noexcept {
243  static_cast<void*>(obj));
244  }
245 
246  void
247  getBootInd(co_nmt_boot_ind_t** pind, void** pdata) const noexcept {
248  co_nmt_get_boot_ind(this, pind, pdata);
249  }
250 
251  void
252  setBootInd(co_nmt_boot_ind_t* ind, void* data) noexcept {
253  co_nmt_set_boot_ind(this, ind, data);
254  }
255 
256  template <class F>
257  void
258  setBootInd(F* f) noexcept {
260  static_cast<void*>(f));
261  }
262 
263  template <class C, typename c_mem_fn<co_nmt_boot_ind_t*, C>::type M>
264  void
265  setBootInd(C* obj) noexcept {
267  static_cast<void*>(obj));
268  }
269 
270  void
271  getCfgInd(co_nmt_cfg_ind_t** pind, void** pdata) const noexcept {
272  co_nmt_get_cfg_ind(this, pind, pdata);
273  }
274 
275  void
276  setCfgInd(co_nmt_cfg_ind_t* ind, void* data) noexcept {
277  co_nmt_set_cfg_ind(this, ind, data);
278  }
279 
280  template <class F>
281  void
282  setCfgInd(F* f) noexcept {
284  static_cast<void*>(f));
285  }
286 
287  template <class C, typename c_mem_fn<co_nmt_cfg_ind_t*, C>::type M>
288  void
289  setCfgInd(C* obj) noexcept {
291  static_cast<void*>(obj));
292  }
293 
294  void
295  getDnInd(co_nmt_sdo_ind_t** pind, void** pdata) const noexcept {
296  co_nmt_get_dn_ind(this, pind, pdata);
297  }
298 
299  void
300  setDnInd(co_nmt_sdo_ind_t* ind, void* data) noexcept {
301  co_nmt_set_dn_ind(this, ind, data);
302  }
303 
304  template <class F>
305  void
306  setDnInd(F* f) noexcept {
308  static_cast<void*>(f));
309  }
310 
311  template <class C, typename c_mem_fn<co_nmt_sdo_ind_t*, C>::type M>
312  void
313  setDnInd(C* obj) noexcept {
315  static_cast<void*>(obj));
316  }
317 
318  void
319  getUpInd(co_nmt_sdo_ind_t** pind, void** pdata) const noexcept {
320  co_nmt_get_up_ind(this, pind, pdata);
321  }
322 
323  void
324  setUpInd(co_nmt_sdo_ind_t* ind, void* data) noexcept {
325  co_nmt_set_up_ind(this, ind, data);
326  }
327 
328  template <class F>
329  void
330  setUpInd(F* f) noexcept {
332  static_cast<void*>(f));
333  }
334 
335  template <class C, typename c_mem_fn<co_nmt_sdo_ind_t*, C>::type M>
336  void
337  setUpInd(C* obj) noexcept {
339  static_cast<void*>(obj));
340  }
341 
342  void
343  getSyncInd(co_nmt_sync_ind_t** pind, void** pdata) const noexcept {
344  co_nmt_get_sync_ind(this, pind, pdata);
345  }
346 
347  void
348  setSyncInd(co_nmt_sync_ind_t* ind, void* data) noexcept {
349  co_nmt_set_sync_ind(this, ind, data);
350  }
351 
352  template <class F>
353  void
354  setSyncInd(F* f) noexcept {
356  static_cast<void*>(f));
357  }
358 
359  template <class C, typename c_mem_fn<co_nmt_sync_ind_t*, C>::type M>
360  void
361  setSyncInd(C* obj) noexcept {
363  static_cast<void*>(obj));
364  }
365 
366  void
367  onSync(co_unsigned8_t cs = 0) noexcept {
368  co_nmt_on_sync(this, cs);
369  }
370 
371  void
372  onErr(co_unsigned16_t eec, co_unsigned8_t er,
373  const co_unsigned8_t msef[5] = 0) noexcept {
374  co_nmt_on_err(this, eec, er, msef);
375  }
376 
377  void
378  onTPDOEvent(co_unsigned16_t n = 0) noexcept {
379  co_nmt_on_tpdo_event(this, n);
380  }
381 
382  void
383  onTPDOEventLock() noexcept {
385  }
386 
387  void
388  onTPDOEventUnlock() noexcept {
390  }
391 
392  co_unsigned8_t
393  getId() const noexcept {
394  return co_nmt_get_id(this);
395  }
396 
397  int
398  setId(co_unsigned8_t id) noexcept {
399  return co_nmt_set_id(this, id);
400  }
401 
402  co_unsigned8_t
403  getSt() const noexcept {
404  return co_nmt_get_st(this);
405  }
406 
407  bool
408  isMaster() const noexcept {
409  return !!co_nmt_is_master(this);
410  }
411 
412  int
413  getTimeout() const noexcept {
414  return co_nmt_get_timeout(this);
415  }
416 
417  void
418  setTimeout(int timeout) noexcept {
419  co_nmt_set_timeout(this, timeout);
420  }
421 
422  int
423  csReq(co_unsigned8_t cs, co_unsigned8_t id = 0) noexcept {
424  return co_nmt_cs_req(this, cs, id);
425  }
426 
427  int
428  LSSCon() noexcept {
429  return co_nmt_lss_con(this);
430  }
431 
432  int
433  bootReq(co_unsigned8_t id, int timeout) noexcept {
434  return co_nmt_boot_req(this, id, timeout);
435  }
436 
437  bool
438  isBooting(co_unsigned8_t id) const noexcept {
439  return !!co_nmt_is_booting(this, id);
440  }
441 
442  int
443  cfgReq(co_unsigned8_t id, int timeout, co_nmt_cfg_con_t* con,
444  void* data) noexcept {
445  return co_nmt_cfg_req(this, id, timeout, con, data);
446  }
447 
448  template <class F>
449  int
450  cfgReq(co_unsigned8_t id, int timeout, F* f) noexcept {
451  return cfgReq(id, timeout, &c_obj_call<co_nmt_cfg_con_t*, F>::function,
452  static_cast<void*>(f));
453  }
454 
455  template <class C, typename c_mem_fn<co_nmt_cfg_con_t*, C>::type M>
456  int
457  cfgReq(co_unsigned8_t id, int timeout, C* obj) noexcept {
458  return cfgReq(id, timeout, &c_mem_call<co_nmt_cfg_con_t*, C, M>::function,
459  static_cast<void*>(obj));
460  }
461 
462  int
463  cfgRes(co_unsigned8_t id, co_unsigned32_t ac) noexcept {
464  return co_nmt_cfg_res(this, id, ac);
465  }
466 
467  int
468  ngReq(co_unsigned8_t id, co_unsigned16_t gt, co_unsigned8_t ltf) noexcept {
469  return co_nmt_ng_req(this, id, gt, ltf);
470  }
471 
472  int
473  csInd(co_unsigned8_t cs) noexcept {
474  return co_nmt_cs_ind(this, cs);
475  }
476 
477  void
478  commErrInd() noexcept {
479  co_nmt_comm_err_ind(this);
480  }
481 
482  int
483  nodeErrInd(co_unsigned8_t id) noexcept {
484  return co_nmt_node_err_ind(this, id);
485  }
486 
487  CORPDO*
488  getRPDO(co_unsigned16_t n) const noexcept {
489  return co_nmt_get_rpdo(this, n);
490  }
491 
492  COTPDO*
493  getTPDO(co_unsigned16_t n) const noexcept {
494  return co_nmt_get_tpdo(this, n);
495  }
496 
497  COSSDO*
498  getSSDO(co_unsigned8_t n) const noexcept {
499  return co_nmt_get_ssdo(this, n);
500  }
501 
502  COCSDO*
503  getCSDO(co_unsigned8_t n) const noexcept {
504  return co_nmt_get_csdo(this, n);
505  }
506 
507  COSync*
508  getSync() const noexcept {
509  return co_nmt_get_sync(this);
510  }
511 
512  COTime*
513  getTime() const noexcept {
514  return co_nmt_get_time(this);
515  }
516 
517  COEmcy*
518  getEmcy() const noexcept {
519  return co_nmt_get_emcy(this);
520  }
521 
522  COLSS*
523  getLSS() const noexcept {
524  return co_nmt_get_lss(this);
525  }
526 
527  protected:
528  ~CONMT() = default;
529 };
530 
531 } // namespace lely
532 
533 #endif // !LELY_CO_NMT_HPP_
lely::incomplete_c_type
The base class for a C++ interface to an incomplete C type.
Definition: c_type.hpp:249
co_nmt_get_dn_ind
void co_nmt_get_dn_ind(const co_nmt_t *nmt, co_nmt_sdo_ind_t **pind, void **pdata)
Retrieves the indication function used to notify the user of the progress of the current SDO download...
Definition: nmt.c:1324
lely::COCSDO
An opaque CANopen Client-SDO service type.
Definition: csdo.hpp:156
co_nmt_get_ng_ind
void co_nmt_get_ng_ind(const co_nmt_t *nmt, co_nmt_ng_ind_t **pind, void **pdata)
Retrieves the indication function invoked when a node guarding event occurs.
Definition: nmt.c:1115
co_nmt_cfg_req
int co_nmt_cfg_req(co_nmt_t *nmt, co_unsigned8_t id, int timeout, co_nmt_cfg_con_t *con, void *data)
Issues the NMT 'configuration request' for the specified node.
Definition: nmt.c:1701
co_nmt_cs_ind_t
void co_nmt_cs_ind_t(co_nmt_t *nmt, co_unsigned8_t cs, void *data)
The type of a CANopen NMT command indication function, invoked when an NMT command is received (and a...
Definition: nmt.h:110
co_nmt_set_hb_ind
void co_nmt_set_hb_ind(co_nmt_t *nmt, co_nmt_hb_ind_t *ind, void *data)
Sets the indication function invoked when a heartbeat event occurs.
Definition: nmt.c:1190
co_nmt_get_lss_req
void co_nmt_get_lss_req(const co_nmt_t *nmt, co_nmt_lss_req_t **pind, void **pdata)
Retrieves the request function invoked to perform LSS when booting an NMT master.
Definition: nmt.c:1262
co_nmt_hb_ind_t
void co_nmt_hb_ind_t(co_nmt_t *nmt, co_unsigned8_t id, int state, int reason, void *data)
The type of a CANopen NMT heartbeat indication function, invoked when a heartbeat event occurs (see s...
Definition: nmt.h:155
co_nmt_get_lg_ind
void co_nmt_get_lg_ind(const co_nmt_t *nmt, co_nmt_lg_ind_t **pind, void **pdata)
Retrieves the indication function invoked when a life guarding event occurs.
Definition: nmt.c:1150
co_nmt_get_sync_ind
void co_nmt_get_sync_ind(const co_nmt_t *nmt, co_nmt_sync_ind_t **pind, void **pdata)
Retrieves the indication function invoked by co_nmt_on_sync() after all PDOs have been transmitted/pr...
Definition: nmt.c:1366
co_nmt_set_ng_ind
void co_nmt_set_ng_ind(co_nmt_t *nmt, co_nmt_ng_ind_t *ind, void *data)
Sets the indication function invoked when a node guarding event occurs.
Definition: nmt.c:1126
net.hpp
co_nmt_on_hb
void co_nmt_on_hb(co_nmt_t *nmt, co_unsigned8_t id, int state, int reason)
Implements the default behavior when a heartbeat event occurs (see sections 7.2.8....
Definition: nmt.c:1199
co_nmt_get_ssdo
co_ssdo_t * co_nmt_get_ssdo(const co_nmt_t *nmt, co_unsigned8_t n)
Returns a pointer to a Server-SDO service.
Definition: nmt.c:1921
co_nmt_get_cs_ind
void co_nmt_get_cs_ind(const co_nmt_t *nmt, co_nmt_cs_ind_t **pind, void **pdata)
Retrieves the indication function invoked when an NMT command is received.
Definition: nmt.c:1093
co_nmt_ng_ind_t
void co_nmt_ng_ind_t(co_nmt_t *nmt, co_unsigned8_t id, int state, int reason, void *data)
The type of a CANopen NMT node guarding indication function, invoked when a node guarding event occur...
Definition: nmt.h:126
co_nmt_get_up_ind
void co_nmt_get_up_ind(const co_nmt_t *nmt, co_nmt_sdo_ind_t **pind, void **pdata)
Retrieves the indication function used to notify the user of the progress of the current SDO upload r...
Definition: nmt.c:1344
lely::c_obj_call
Definition: c_call.hpp:62
co_nmt_sdo_ind_t
void co_nmt_sdo_ind_t(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned16_t idx, co_unsigned8_t subidx, size_t size, size_t nbyte, void *data)
The type of an SDO request progress indication function, invoked by a CANopen NMT master to notify th...
Definition: nmt.h:246
co_nmt_cfg_con_t
void co_nmt_cfg_con_t(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned32_t ac, void *data)
The type of a CANopen NMT 'configuration request' confirmation callback function, invoked when a conf...
Definition: nmt.h:227
co_nmt_lg_ind_t
void co_nmt_lg_ind_t(co_nmt_t *nmt, int state, void *data)
The type of a CANopen NMT life guarding indication function, invoked when a life guarding event occur...
Definition: nmt.h:139
co_nmt_boot_ind_t
void co_nmt_boot_ind_t(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned8_t st, char es, void *data)
The type of a CANopen NMT 'boot slave' indication function, invoked when the 'boot slave' process com...
Definition: nmt.h:200
co_nmt_get_sync
co_sync_t * co_nmt_get_sync(const co_nmt_t *nmt)
Returns a pointer to the SYNC producer/consumer service.
Definition: nmt.c:1943
co_nmt_on_ng
void co_nmt_on_ng(co_nmt_t *nmt, co_unsigned8_t id, int state, int reason)
Implements the default behavior when a node guarding event occurs (see sections 7....
Definition: nmt.c:1135
co_nmt_get_id
co_unsigned8_t co_nmt_get_id(const co_nmt_t *nmt)
Returns the pending node-ID.
Definition: nmt.c:1506
co_nmt_cfg_ind_t
void co_nmt_cfg_ind_t(co_nmt_t *nmt, co_unsigned8_t id, co_csdo_t *sdo, void *data)
The type of a CANopen NMT 'update configuration' indication function, invoked when a configuration re...
Definition: nmt.h:214
lely::CORPDO
An opaque CANopen Receive-PDO service type.
Definition: rpdo.hpp:65
co_nmt_on_err
void co_nmt_on_err(co_nmt_t *nmt, co_unsigned16_t eec, co_unsigned8_t er, const co_unsigned8_t msef[5])
Implements the default error handling behavior by generating an EMCY message with co_emcy_push() and ...
Definition: nmt.c:1412
lely::CONMT
An opaque CANopen NMT master/slave service type.
Definition: nmt.hpp:71
co_nmt_cs_req
int co_nmt_cs_req(co_nmt_t *nmt, co_unsigned8_t cs, co_unsigned8_t id)
Submits an NMT request to a slave.
Definition: nmt.c:1569
co_nmt_boot_req
int co_nmt_boot_req(co_nmt_t *nmt, co_unsigned8_t id, int timeout)
Requests the NMT 'boot slave' process for the specified node.
Definition: nmt.c:1632
co_dev_cfg_hb
co_unsigned32_t co_dev_cfg_hb(co_dev_t *dev, co_unsigned8_t id, co_unsigned16_t ms)
Configures heartbeat consumption for the specified node by updating CANopen object 1016 (Consumer hea...
Definition: nmt.c:661
co_nmt_lss_req_t
void co_nmt_lss_req_t(co_nmt_t *nmt, co_lss_t *lss, void *data)
The type of a CANopen LSS request function, invoked by an NMT master before booting the slaves (see F...
Definition: nmt.h:188
co_nmt_on_sync
void co_nmt_on_sync(co_nmt_t *nmt, co_unsigned8_t cnt)
Implements the default behavior after a SYNC object is received or transmitted.
Definition: nmt.c:1386
co_nmt_get_st
co_unsigned8_t co_nmt_get_st(const co_nmt_t *nmt)
Returns the current state of a CANopen NMT service (one of CO_NMT_ST_BOOTUP, CO_NMT_ST_STOP,...
Definition: nmt.c:1529
co_nmt_set_up_ind
void co_nmt_set_up_ind(co_nmt_t *nmt, co_nmt_sdo_ind_t *ind, void *data)
Sets the indication function used to notify the user of the progress of the current SDO upload reques...
Definition: nmt.c:1355
co_nmt_on_tpdo_event_lock
void co_nmt_on_tpdo_event_lock(co_nmt_t *nmt)
Postpones the transmission of PDOs triggered by co_nmt_on_tpdo_event() until a matching call to co_nm...
Definition: nmt.c:1466
co_nmt_get_tpdo
co_tpdo_t * co_nmt_get_tpdo(const co_nmt_t *nmt, co_unsigned16_t n)
Returns a pointer to a Transmit-PDO service.
Definition: nmt.c:1910
lely::COTPDO
An opaque CANopen Transmit-PDO service type.
Definition: tpdo.hpp:65
lely::COTime
An opaque CANopen TIME producer/consumer service type.
Definition: time.hpp:65
lely::COSSDO
An opaque CANopen Server-SDO service type.
Definition: ssdo.hpp:65
co_nmt_node_err_ind
int co_nmt_node_err_ind(co_nmt_t *nmt, co_unsigned8_t id)
Indicates the occurrence of an error event and triggers the error handling process (see Fig.
Definition: nmt.c:1856
co_nmt_get_boot_ind
void co_nmt_get_boot_ind(const co_nmt_t *nmt, co_nmt_boot_ind_t **pind, void **pdata)
Retrieves the indication function invoked when a CANopen NMT 'boot slave' process completes.
Definition: nmt.c:1284
lely::COSync
An opaque CANopen SYNC producer/consumer service type.
Definition: sync.hpp:65
co_nmt_set_dn_ind
void co_nmt_set_dn_ind(co_nmt_t *nmt, co_nmt_sdo_ind_t *ind, void *data)
Sets the indication function used to notify the user of the progress of the current SDO download requ...
Definition: nmt.c:1335
co_nmt_sync_ind_t
void co_nmt_sync_ind_t(co_nmt_t *nmt, co_unsigned8_t cnt, void *data)
The type of a SYNC indication function, invoked by co_nmt_on_sync() after PDOs are transmitted/proces...
Definition: nmt.h:260
co_nmt_set_cfg_ind
void co_nmt_set_cfg_ind(co_nmt_t *nmt, co_nmt_cfg_ind_t *ind, void *data)
Sets the indication function invoked when a CANopen NMT 'configuration request' process is received.
Definition: nmt.c:1315
lely::CANNet
An opaque CAN network interface type.
Definition: net.hpp:85
co_nmt_is_master
int co_nmt_is_master(const co_nmt_t *nmt)
Returns 1 if the specified CANopen NMT service is a master, and 0 if not.
Definition: nmt.c:1537
lely::c_type_traits
A class template supplying a uniform interface to certain attributes of C types.
Definition: c_type.hpp:120
co_nmt_on_tpdo_event_unlock
void co_nmt_on_tpdo_event_unlock(co_nmt_t *nmt)
Undoes the effect of a single call to co_nmt_on_tpdo_event_lock() and possibly triggers the transmiss...
Definition: nmt.c:1474
co_nmt_set_cs_ind
void co_nmt_set_cs_ind(co_nmt_t *nmt, co_nmt_cs_ind_t *ind, void *data)
Sets the indication function invoked when an NMT command is received.
Definition: nmt.c:1104
co_nmt_cs_ind
int co_nmt_cs_ind(co_nmt_t *nmt, co_unsigned8_t cs)
Processes an NMT command from the master or the application.
Definition: nmt.c:1822
__co_nmt
A CANopen NMT master/slave service.
Definition: nmt.c:104
co_nmt_get_rpdo
co_rpdo_t * co_nmt_get_rpdo(const co_nmt_t *nmt, co_unsigned16_t n)
Returns a pointer to a Receive-PDO service.
Definition: nmt.c:1899
nmt.h
co_nmt_set_id
int co_nmt_set_id(co_nmt_t *nmt, co_unsigned8_t id)
Sets the pending node-ID.
Definition: nmt.c:1514
co_nmt_get_hb_ind
void co_nmt_get_hb_ind(const co_nmt_t *nmt, co_nmt_hb_ind_t **pind, void **pdata)
Retrieves the indication function invoked when a heartbeat event occurs.
Definition: nmt.c:1179
co_nmt_get_cfg_ind
void co_nmt_get_cfg_ind(const co_nmt_t *nmt, co_nmt_cfg_ind_t **pind, void **pdata)
Retrieves the indication function invoked when a CANopen NMT 'configuration request' is received.
Definition: nmt.c:1304
co_nmt_cfg_res
int co_nmt_cfg_res(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned32_t ac)
Indicates the result of the 'update configuration' step of an NMT 'request configuration' request for...
Definition: nmt.c:1759
co_nmt_set_st_ind
void co_nmt_set_st_ind(co_nmt_t *nmt, co_nmt_st_ind_t *ind, void *data)
Sets the indication function invoked when a state change is detected.
Definition: nmt.c:1229
co_nmt_on_lg
void co_nmt_on_lg(co_nmt_t *nmt, int state)
Implements the default behavior when a life guarding event occurs (see section 7.2....
Definition: nmt.c:1170
lely::c_mem_call
Definition: c_call.hpp:67
co_nmt_get_dev
co_dev_t * co_nmt_get_dev(const co_nmt_t *nmt)
Returns a pointer to the CANopen device of an NMT master/slave service.
Definition: nmt.c:1085
co_nmt_st_ind_t
void co_nmt_st_ind_t(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned8_t st, void *data)
The type of a CANopen NMT state change indication function, invoked when a state change is detected b...
Definition: nmt.h:176
co_nmt_set_sync_ind
void co_nmt_set_sync_ind(co_nmt_t *nmt, co_nmt_sync_ind_t *ind, void *data)
Sets the indication function invoked by co_nmt_on_sync() after all PDOs have been transmitted/process...
Definition: nmt.c:1377
co_nmt_set_timeout
void co_nmt_set_timeout(co_nmt_t *nmt, int timeout)
Sets the default SDO timeout used during the NMT 'boot slave' and 'check configuration' processes.
Definition: nmt.c:1561
co_nmt_set_boot_ind
void co_nmt_set_boot_ind(co_nmt_t *nmt, co_nmt_boot_ind_t *ind, void *data)
Sets the indication function invoked when a CANopen NMT 'boot slave' process completes.
Definition: nmt.c:1295
co_nmt_get_csdo
co_csdo_t * co_nmt_get_csdo(const co_nmt_t *nmt, co_unsigned8_t n)
Returns a pointer to a Client-SDO service.
Definition: nmt.c:1932
co_nmt_get_time
co_time_t * co_nmt_get_time(const co_nmt_t *nmt)
Returns a pointer to the TIME producer/consumer service.
Definition: nmt.c:1951
lely::COLSS
An opaque CANopen LSS master/slave service type.
Definition: lss.hpp:66
co_nmt_set_lss_req
void co_nmt_set_lss_req(co_nmt_t *nmt, co_nmt_lss_req_t *ind, void *data)
Sets the request function invoked to perform LSS when booting an NMT master.
Definition: nmt.c:1273
lely::COEmcy
An opaque CANopen EMCY producer/consumer service type.
Definition: emcy.hpp:65
co_nmt_comm_err_ind
void co_nmt_comm_err_ind(co_nmt_t *nmt)
Indicates the occurrence of a communication error and invokes the specified error behavior (object 10...
Definition: nmt.c:1840
co_nmt_get_net
can_net_t * co_nmt_get_net(const co_nmt_t *nmt)
Returns a pointer to the CAN network of an NMT master/slave service.
Definition: nmt.c:1077
co_nmt_on_tpdo_event
void co_nmt_on_tpdo_event(co_nmt_t *nmt, co_unsigned16_t n)
Implements the default behavior when an event is indicated for an event-driven (asynchronous) Transmi...
Definition: nmt.c:1435
co_nmt_ng_req
int co_nmt_ng_req(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned16_t gt, co_unsigned8_t ltf)
Request the node guarding service for the specified node, even if it is not in the network list.
Definition: nmt.c:1777
co_nmt_set_lg_ind
void co_nmt_set_lg_ind(co_nmt_t *nmt, co_nmt_lg_ind_t *ind, void *data)
Sets the indication function invoked when a life guarding event occurs.
Definition: nmt.c:1161
co_nmt_get_st_ind
void co_nmt_get_st_ind(const co_nmt_t *nmt, co_nmt_st_ind_t **pind, void **pdata)
Retrieves the indication function invoked when a state change is detected.
Definition: nmt.c:1218
co_nmt_get_timeout
int co_nmt_get_timeout(const co_nmt_t *nmt)
Returns the default SDO timeout used during the NMT 'boot slave' and 'check configuration' processes.
Definition: nmt.c:1553
co_nmt_get_lss
co_lss_t * co_nmt_get_lss(const co_nmt_t *nmt)
Returns a pointer to the LSS master/slave service.
Definition: nmt.c:1967
co_nmt_get_emcy
co_emcy_t * co_nmt_get_emcy(const co_nmt_t *nmt)
Returns a pointer to the EMCY producer/consumer service.
Definition: nmt.c:1959
co_nmt_is_booting
int co_nmt_is_booting(const co_nmt_t *nmt, co_unsigned8_t id)
Returns 1 if the NMT 'boot slave' process is currently running for the specified node,...
Definition: nmt.c:1687
co_nmt_on_st
void co_nmt_on_st(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned8_t st)
Implements the default behavior when a state change is detected by the node guarding or heartbeat pro...
Definition: nmt.c:1238
lely::CODev
An opaque CANopen device type.
Definition: dev.hpp:77
co_nmt_lss_con
int co_nmt_lss_con(co_nmt_t *nmt)
Confirms the completion of the process when booting an NMT master.
Definition: nmt.c:1616