Lely core libraries  1.9.2
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  static void
54  free(void* ptr) noexcept {
55  __co_nmt_free(ptr);
56  }
57 
58  static pointer
59  init(pointer p, CANNet* net, CODev* dev) noexcept {
60  return __co_nmt_init(p, net, dev);
61  }
62 
63  static void
64  fini(pointer p) noexcept {
65  __co_nmt_fini(p);
66  }
67 };
68 
70 class CONMT : public incomplete_c_type<__co_nmt> {
72 
73  public:
74  CONMT(CANNet* net, CODev* dev) : c_base(net, dev) {}
75 
76  CANNet*
77  getNet() const noexcept {
78  return co_nmt_get_net(this);
79  }
80  CODev*
81  getDev() const noexcept {
82  return co_nmt_get_dev(this);
83  }
84 
85  void
86  getCsInd(co_nmt_cs_ind_t** pind, void** pdata) const noexcept {
87  co_nmt_get_cs_ind(this, pind, pdata);
88  }
89 
90  void
91  setCsInd(co_nmt_cs_ind_t* ind, void* data) noexcept {
92  co_nmt_set_cs_ind(this, ind, data);
93  }
94 
95  template <class F>
96  void
97  setCsInd(F* f) noexcept {
98  setCsInd(&c_obj_call<co_nmt_cs_ind_t*, F>::function, static_cast<void*>(f));
99  }
100 
101  template <class C, typename c_mem_fn<co_nmt_cs_ind_t*, C>::type M>
102  void
103  setCsInd(C* obj) noexcept {
105  static_cast<void*>(obj));
106  }
107 
108  void
109  getNgInd(co_nmt_ng_ind_t** pind, void** pdata) const noexcept {
110  co_nmt_get_ng_ind(this, pind, pdata);
111  }
112 
113  void
114  setNgInd(co_nmt_ng_ind_t* ind, void* data) noexcept {
115  co_nmt_set_ng_ind(this, ind, data);
116  }
117 
118  template <class F>
119  void
120  setNgInd(F* f) noexcept {
121  setNgInd(&c_obj_call<co_nmt_ng_ind_t*, F>::function, static_cast<void*>(f));
122  }
123 
124  template <class C, typename c_mem_fn<co_nmt_ng_ind_t*, C>::type M>
125  void
126  setNgInd(C* obj) noexcept {
128  static_cast<void*>(obj));
129  }
130 
131  void
132  onNg(co_unsigned8_t id, int state, int reason) noexcept {
133  co_nmt_on_ng(this, id, state, reason);
134  }
135 
136  void
137  getLgInd(co_nmt_lg_ind_t** pind, void** pdata) const noexcept {
138  co_nmt_get_lg_ind(this, pind, pdata);
139  }
140 
141  void
142  setLgInd(co_nmt_lg_ind_t* ind, void* data) noexcept {
143  co_nmt_set_lg_ind(this, ind, data);
144  }
145 
146  template <class F>
147  void
148  setLgInd(F* f) noexcept {
149  setLgInd(&c_obj_call<co_nmt_lg_ind_t*, F>::function, static_cast<void*>(f));
150  }
151 
152  template <class C, typename c_mem_fn<co_nmt_lg_ind_t*, C>::type M>
153  void
154  setLgInd(C* obj) noexcept {
156  static_cast<void*>(obj));
157  }
158 
159  void
160  onLg(int state) noexcept {
161  co_nmt_on_lg(this, state);
162  }
163 
164  void
165  getHbInd(co_nmt_hb_ind_t** pind, void** pdata) const noexcept {
166  co_nmt_get_hb_ind(this, pind, pdata);
167  }
168 
169  void
170  setHbInd(co_nmt_hb_ind_t* ind, void* data) noexcept {
171  co_nmt_set_hb_ind(this, ind, data);
172  }
173 
174  template <class F>
175  void
176  setHbInd(F* f) noexcept {
177  setHbInd(&c_obj_call<co_nmt_hb_ind_t*, F>::function, static_cast<void*>(f));
178  }
179 
180  template <class C, typename c_mem_fn<co_nmt_hb_ind_t*, C>::type M>
181  void
182  setHbInd(C* obj) noexcept {
184  static_cast<void*>(obj));
185  }
186 
187  void
188  onHb(co_unsigned8_t id, int state, int reason) noexcept {
189  co_nmt_on_hb(this, id, state, reason);
190  }
191 
192  void
193  getStInd(co_nmt_st_ind_t** pind, void** pdata) const noexcept {
194  co_nmt_get_st_ind(this, pind, pdata);
195  }
196 
197  void
198  setStInd(co_nmt_st_ind_t* ind, void* data) noexcept {
199  co_nmt_set_st_ind(this, ind, data);
200  }
201 
202  template <class F>
203  void
204  setStInd(F* f) noexcept {
205  setStInd(&c_obj_call<co_nmt_st_ind_t*, F>::function, static_cast<void*>(f));
206  }
207 
208  template <class C, typename c_mem_fn<co_nmt_st_ind_t*, C>::type M>
209  void
210  setStInd(C* obj) noexcept {
212  static_cast<void*>(obj));
213  }
214 
215  void
216  onSt(co_unsigned8_t id, co_unsigned8_t st) noexcept {
217  co_nmt_on_st(this, id, st);
218  }
219 
220  void
221  getLSSReq(co_nmt_lss_req_t** preq, void** pdata) const noexcept {
222  co_nmt_get_lss_req(this, preq, pdata);
223  }
224 
225  void
226  setLSSReq(co_nmt_lss_req_t* req, void* data) noexcept {
227  co_nmt_set_lss_req(this, req, data);
228  }
229 
230  template <class F>
231  void
232  setLSSReq(F* f) noexcept {
234  static_cast<void*>(f));
235  }
236 
237  template <class C, typename c_mem_fn<co_nmt_lss_req_t*, C>::type M>
238  void
239  setLSSReq(C* obj) noexcept {
241  static_cast<void*>(obj));
242  }
243 
244  void
245  getBootInd(co_nmt_boot_ind_t** pind, void** pdata) const noexcept {
246  co_nmt_get_boot_ind(this, pind, pdata);
247  }
248 
249  void
250  setBootInd(co_nmt_boot_ind_t* ind, void* data) noexcept {
251  co_nmt_set_boot_ind(this, ind, data);
252  }
253 
254  template <class F>
255  void
256  setBootInd(F* f) noexcept {
258  static_cast<void*>(f));
259  }
260 
261  template <class C, typename c_mem_fn<co_nmt_boot_ind_t*, C>::type M>
262  void
263  setBootInd(C* obj) noexcept {
265  static_cast<void*>(obj));
266  }
267 
268  void
269  getCfgInd(co_nmt_cfg_ind_t** pind, void** pdata) const noexcept {
270  co_nmt_get_cfg_ind(this, pind, pdata);
271  }
272 
273  void
274  setCfgInd(co_nmt_cfg_ind_t* ind, void* data) noexcept {
275  co_nmt_set_cfg_ind(this, ind, data);
276  }
277 
278  template <class F>
279  void
280  setCfgInd(F* f) noexcept {
282  static_cast<void*>(f));
283  }
284 
285  template <class C, typename c_mem_fn<co_nmt_cfg_ind_t*, C>::type M>
286  void
287  setCfgInd(C* obj) noexcept {
289  static_cast<void*>(obj));
290  }
291 
292  void
293  getDnInd(co_nmt_sdo_ind_t** pind, void** pdata) const noexcept {
294  co_nmt_get_dn_ind(this, pind, pdata);
295  }
296 
297  void
298  setDnInd(co_nmt_sdo_ind_t* ind, void* data) noexcept {
299  co_nmt_set_dn_ind(this, ind, data);
300  }
301 
302  template <class F>
303  void
304  setDnInd(F* f) noexcept {
306  static_cast<void*>(f));
307  }
308 
309  template <class C, typename c_mem_fn<co_nmt_sdo_ind_t*, C>::type M>
310  void
311  setDnInd(C* obj) noexcept {
313  static_cast<void*>(obj));
314  }
315 
316  void
317  getUpInd(co_nmt_sdo_ind_t** pind, void** pdata) const noexcept {
318  co_nmt_get_up_ind(this, pind, pdata);
319  }
320 
321  void
322  setUpInd(co_nmt_sdo_ind_t* ind, void* data) noexcept {
323  co_nmt_set_up_ind(this, ind, data);
324  }
325 
326  template <class F>
327  void
328  setUpInd(F* f) noexcept {
330  static_cast<void*>(f));
331  }
332 
333  template <class C, typename c_mem_fn<co_nmt_sdo_ind_t*, C>::type M>
334  void
335  setUpInd(C* obj) noexcept {
337  static_cast<void*>(obj));
338  }
339 
340  void
341  getSyncInd(co_nmt_sync_ind_t** pind, void** pdata) const noexcept {
342  co_nmt_get_sync_ind(this, pind, pdata);
343  }
344 
345  void
346  setSyncInd(co_nmt_sync_ind_t* ind, void* data) noexcept {
347  co_nmt_set_sync_ind(this, ind, data);
348  }
349 
350  template <class F>
351  void
352  setSyncInd(F* f) noexcept {
354  static_cast<void*>(f));
355  }
356 
357  template <class C, typename c_mem_fn<co_nmt_sync_ind_t*, C>::type M>
358  void
359  setSyncInd(C* obj) noexcept {
361  static_cast<void*>(obj));
362  }
363 
364  void
365  onSync(co_unsigned8_t cs = 0) noexcept {
366  co_nmt_on_sync(this, cs);
367  }
368 
369  void
370  onErr(co_unsigned16_t eec, co_unsigned8_t er,
371  const uint8_t msef[5] = 0) noexcept {
372  co_nmt_on_err(this, eec, er, msef);
373  }
374 
375  co_unsigned8_t
376  getId() const noexcept {
377  return co_nmt_get_id(this);
378  }
379 
380  int
381  setId(co_unsigned8_t id) noexcept {
382  return co_nmt_set_id(this, id);
383  }
384 
385  co_unsigned8_t
386  getSt() const noexcept {
387  return co_nmt_get_st(this);
388  }
389 
390  bool
391  isMaster() const noexcept {
392  return !!co_nmt_is_master(this);
393  }
394 
395  int
396  getTimeout() const noexcept {
397  return co_nmt_get_timeout(this);
398  }
399 
400  void
401  setTimeout(int timeout) noexcept {
402  co_nmt_set_timeout(this, timeout);
403  }
404 
405  int
406  csReq(co_unsigned8_t cs, co_unsigned8_t id = 0) noexcept {
407  return co_nmt_cs_req(this, cs, id);
408  }
409 
410  int
411  LSSCon() noexcept {
412  return co_nmt_lss_con(this);
413  }
414 
415  int
416  bootReq(co_unsigned8_t id, int timeout) noexcept {
417  return co_nmt_boot_req(this, id, timeout);
418  }
419 
420  bool
421  isBooting(co_unsigned8_t id) const noexcept {
422  return !!co_nmt_is_booting(this, id);
423  }
424 
425  int
426  cfgReq(co_unsigned8_t id, int timeout, co_nmt_cfg_con_t* con,
427  void* data) noexcept {
428  return co_nmt_cfg_req(this, id, timeout, con, data);
429  }
430 
431  template <class F>
432  int
433  cfgReq(co_unsigned8_t id, int timeout, F* f) noexcept {
434  return cfgReq(id, timeout, &c_obj_call<co_nmt_cfg_con_t*, F>::function,
435  static_cast<void*>(f));
436  }
437 
438  template <class C, typename c_mem_fn<co_nmt_cfg_con_t*, C>::type M>
439  int
440  cfgReq(co_unsigned8_t id, int timeout, C* obj) noexcept {
441  return cfgReq(id, timeout, &c_mem_call<co_nmt_cfg_con_t*, C, M>::function,
442  static_cast<void*>(obj));
443  }
444 
445  int
446  cfgRes(co_unsigned8_t id, co_unsigned32_t ac) noexcept {
447  return co_nmt_cfg_res(this, id, ac);
448  }
449 
450  int
451  ngReq(co_unsigned8_t id, co_unsigned16_t gt, co_unsigned8_t ltf) noexcept {
452  return co_nmt_ng_req(this, id, gt, ltf);
453  }
454 
455  int
456  csInd(co_unsigned8_t cs) noexcept {
457  return co_nmt_cs_ind(this, cs);
458  }
459 
460  void
461  commErrInd() noexcept {
462  co_nmt_comm_err_ind(this);
463  }
464 
465  int
466  nodeErrInd(co_unsigned8_t id) noexcept {
467  return co_nmt_node_err_ind(this, id);
468  }
469 
470  CORPDO*
471  getRPDO(co_unsigned16_t n) const noexcept {
472  return co_nmt_get_rpdo(this, n);
473  }
474 
475  COTPDO*
476  getTPDO(co_unsigned16_t n) const noexcept {
477  return co_nmt_get_tpdo(this, n);
478  }
479 
480  COSSDO*
481  getSSDO(co_unsigned8_t n) const noexcept {
482  return co_nmt_get_ssdo(this, n);
483  }
484 
485  COCSDO*
486  getCSDO(co_unsigned8_t n) const noexcept {
487  return co_nmt_get_csdo(this, n);
488  }
489 
490  COSync*
491  getSync() const noexcept {
492  return co_nmt_get_sync(this);
493  }
494 
495  COTime*
496  getTime() const noexcept {
497  return co_nmt_get_time(this);
498  }
499 
500  COEmcy*
501  getEmcy() const noexcept {
502  return co_nmt_get_emcy(this);
503  }
504 
505  COLSS*
506  getLSS() const noexcept {
507  return co_nmt_get_lss(this);
508  }
509 
510  protected:
511  ~CONMT() {}
512 };
513 
514 } // namespace lely
515 
516 #endif // !LELY_CO_NMT_HPP_
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:1455
int co_nmt_set_id(co_nmt_t *nmt, co_unsigned8_t id)
Sets the pending node-ID.
Definition: nmt.c:1400
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:1303
co_sync_t * co_nmt_get_sync(const co_nmt_t *nmt)
Returns a pointer to the SYNC producer/consumer service.
Definition: nmt.c:1831
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.2.8.2.2.1 and 7.2.8.3.2.1 in CiA 301 version 4.2.0).
Definition: nmt.c:1094
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:1728
co_unsigned8_t co_nmt_get_id(const co_nmt_t *nmt)
Returns the pending node-ID.
Definition: nmt.c:1392
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 &#39;configuration request&#39; process is received...
Definition: nmt.c:1274
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:1325
int co_nmt_boot_req(co_nmt_t *nmt, co_unsigned8_t id, int timeout)
Requests the NMT &#39;boot slave&#39; process for the specified node.
Definition: nmt.c:1518
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_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:637
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 &#39;configuration request&#39; for the specified node.
Definition: nmt.c:1588
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:1138
int co_nmt_is_booting(const co_nmt_t *nmt, co_unsigned8_t id)
Returns 1 if the NMT &#39;boot slave&#39; process is currently running for the specified node, and 0 if not.
Definition: nmt.c:1571
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.2.2.3 and 7.2.8.3.2.2 in CiA 301 version 4.2.0).
Definition: nmt.c:1158
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:1336
This header file is part of the CAN library; it contains the C++ interface of the CAN network interfa...
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:1314
co_lss_t * co_nmt_get_lss(const co_nmt_t *nmt)
Returns a pointer to the LSS master/slave service.
Definition: nmt.c:1855
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:1710
int co_nmt_cfg_res(co_nmt_t *nmt, co_unsigned8_t id, co_unsigned32_t ac)
Indicates the result of the &#39;update configuration&#39; step of an NMT &#39;request configuration&#39; request for...
Definition: nmt.c:1644
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:1149
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:1294
An opaque CANopen Client-SDO service type.
Definition: csdo.hpp:156
The base class for a C++ interface to an incomplete C type.
Definition: c_type.hpp:245
An opaque CANopen device type.
Definition: dev.hpp:76
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:1085
An opaque CANopen LSS master/slave service type.
Definition: lss.hpp:65
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:1662
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:1232
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 &#39;configuration request&#39; is received...
Definition: nmt.c:1263
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:1109
An opaque CANopen EMCY producer/consumer service type.
Definition: emcy.hpp:65
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:1809
co_time_t * co_nmt_get_time(const co_nmt_t *nmt)
Returns a pointer to the TIME producer/consumer service.
Definition: nmt.c:1839
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
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 &#39;boot slave&#39; indication function, invoked when the &#39;boot slave&#39; process com...
Definition: nmt.h:200
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:1188
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:1221
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
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:1345
An opaque CANopen Receive-PDO service type.
Definition: rpdo.hpp:65
A CANopen NMT master/slave service.
Definition: nmt.c:104
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:1787
int co_nmt_get_timeout(const co_nmt_t *nmt)
Returns the default SDO timeout used during the NMT &#39;boot slave&#39; and &#39;check configuration&#39; processes...
Definition: nmt.c:1439
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_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:1820
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 &#39;boot slave&#39; process completes...
Definition: nmt.c:1243
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:1074
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:1036
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
An opaque CANopen Server-SDO service type.
Definition: ssdo.hpp:65
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:1120
co_emcy_t * co_nmt_get_emcy(const co_nmt_t *nmt)
Returns a pointer to the EMCY producer/consumer service.
Definition: nmt.c:1847
An opaque CANopen Transmit-PDO service type.
Definition: tpdo.hpp:65
int co_nmt_lss_con(co_nmt_t *nmt)
Confirms the completion of the process when booting an NMT master.
Definition: nmt.c:1502
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:1798
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.8.2.2.2 in CiA 301 version 4.2.0).
Definition: nmt.c:1129
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 &#39;update configuration&#39; indication function, invoked when a configuration re...
Definition: nmt.h:214
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:1177
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:1063
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 &#39;boot slave&#39; process completes.
Definition: nmt.c:1254
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:1744
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:1283
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 &#39;configuration request&#39; confirmation callback function, invoked when a conf...
Definition: nmt.h:227
An opaque CANopen NMT master/slave service type.
Definition: nmt.hpp:70
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:1423
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, CO_NMT_ST_START, CO_NMT_ST_RESET_NODE, CO_NMT_ST_RESET_COMM or CO_NMT_ST_PREOP).
Definition: nmt.c:1415
This header file is part of the CANopen library; it contains the network management (NMT) declaration...
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
Global namespace for the Lely Industries N.V. libraries.
Definition: buf.hpp:32
An opaque CAN network interface type.
Definition: net.hpp:83
An opaque CANopen SYNC producer/consumer service type.
Definition: sync.hpp:65
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:1044
void co_nmt_on_err(co_nmt_t *nmt, co_unsigned16_t eec, co_unsigned8_t er, const uint8_t msef[5])
Implements the default error handling behavior by generating an EMCY message with co_emcy_push() and ...
Definition: nmt.c:1371
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
void co_nmt_set_timeout(co_nmt_t *nmt, int timeout)
Sets the default SDO timeout used during the NMT &#39;boot slave&#39; and &#39;check configuration&#39; processes...
Definition: nmt.c:1447
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:1197
An opaque CANopen TIME producer/consumer service type.
Definition: time.hpp:65
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
A class template supplying a uniform interface to certain attributes of C types.
Definition: c_type.hpp:120
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:1052