Lely core libraries  2.2.5
nmt_hb.h
Go to the documentation of this file.
1 
23 #ifndef LELY_CO_INTERN_NMT_HB_H_
24 #define LELY_CO_INTERN_NMT_HB_H_
25 
26 #include "co.h"
27 #include <lely/co/nmt.h>
28 
29 struct __co_nmt_hb;
30 #ifndef __cplusplus
31 typedef struct __co_nmt_hb co_nmt_hb_t;
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
52 void co_nmt_hb_ind(co_nmt_t *nmt, co_unsigned8_t id, int state, int reason,
53  co_unsigned8_t st);
54 
55 void *__co_nmt_hb_alloc(void);
56 void __co_nmt_hb_free(void *ptr);
57 struct __co_nmt_hb *__co_nmt_hb_init(
58  struct __co_nmt_hb *hb, can_net_t *net, co_nmt_t *nmt);
59 void __co_nmt_hb_fini(struct __co_nmt_hb *hb);
60 
73 
76 
89 void co_nmt_hb_set_1016(co_nmt_hb_t *hb, co_unsigned8_t id, co_unsigned16_t ms);
90 
100 void co_nmt_hb_set_st(co_nmt_hb_t *hb, co_unsigned8_t st);
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif // !LELY_CO_INTERN_NMT_HB_H_
void co_nmt_hb_destroy(co_nmt_hb_t *hb)
Destroys a CANopen NMT heartbeat consumer service.
Definition: nmt_hb.c:160
A CAN network interface.
Definition: net.c:37
void co_nmt_hb_set_1016(co_nmt_hb_t *hb, co_unsigned8_t id, co_unsigned16_t ms)
Processes the value of CANopen object 1016 (Consumer heartbeat time) for the specified heartbeat cons...
Definition: nmt_hb.c:169
co_unsigned16_t ms
The consumer heartbeat time (in milliseconds).
Definition: nmt_hb.c:47
This is the internal header file of the CANopen library.
void co_nmt_hb_ind(co_nmt_t *nmt, co_unsigned8_t id, int state, int reason, co_unsigned8_t st)
The CANopen NMT heartbeat indication function, invoked when a heartbeat event occurs.
Definition: nmt.c:2089
A CANopen NMT master/slave service.
Definition: nmt.c:104
void co_nmt_hb_set_st(co_nmt_hb_t *hb, co_unsigned8_t st)
Sets the expected state of a remote NMT node.
Definition: nmt_hb.c:190
int state
Indicates whether a heartbeat error occurred (CO_NMT_EC_OCCURRED or CO_NMT_EC_RESOLVED).
Definition: nmt_hb.c:52
A CANopen NMT heartbeat consumer.
Definition: nmt_hb.c:33
can_net_t * net
A pointer to a CAN network interface.
Definition: nmt_hb.c:35
co_nmt_t * nmt
A pointer to an NMT master/slave service.
Definition: nmt_hb.c:37
co_unsigned8_t st
The state of the node (excluding the toggle bit).
Definition: nmt_hb.c:45
This header file is part of the CANopen library; it contains the network management (NMT) declaration...
co_nmt_hb_t * co_nmt_hb_create(can_net_t *net, co_nmt_t *nmt)
Creates a new CANopen NMT heartbeat consumer service.
Definition: nmt_hb.c:135