Lely core libraries
2.3.4
|
Go to the documentation of this file.
23 #ifndef LELY_CO_EMCY_HPP_
24 #define LELY_CO_EMCY_HPP_
26 #if !defined(__cplusplus) || LELY_NO_CXX
27 #error "include <lely/co/emcy.h> for the C interface"
46 return __co_emcy_alloc();
50 free(
void* ptr) noexcept {
56 return __co_emcy_init(p, net, dev);
83 getNet()
const noexcept {
88 getDev()
const noexcept {
93 push(co_unsigned16_t eec, co_unsigned8_t er,
94 const co_unsigned8_t msef[5] = 0) noexcept {
99 pop(co_unsigned16_t* peec = 0, co_unsigned8_t* per = 0) noexcept {
104 peek(co_unsigned16_t* peec = 0, co_unsigned8_t* per = 0)
const noexcept {
109 remove(
size_t n) noexcept {
114 find(co_unsigned16_t eec)
const noexcept {
135 setInd(F* f) noexcept {
139 template <class C, typename c_mem_fn<co_emcy_ind_t*, C>::type M>
141 setInd(C* obj) noexcept {
143 static_cast<void*
>(obj));
152 #endif // !LELY_CO_EMCY_HPP_
The base class for a C++ interface to an incomplete C type.
ssize_t co_emcy_find(const co_emcy_t *emcy, co_unsigned16_t eec)
Finds a CANopen EMCY message in the stack.
void co_emcy_stop(co_emcy_t *emcy)
Stops an EMCY service.
void co_emcy_get_ind(const co_emcy_t *emcy, co_emcy_ind_t **pind, void **pdata)
Retrieves the indication function invoked when a CANopen EMCY message is received.
co_dev_t * co_emcy_get_dev(const co_emcy_t *emcy)
Returns a pointer to the CANopen device of an EMCY producer/consumer service.
void co_emcy_peek(const co_emcy_t *emcy, co_unsigned16_t *peec, co_unsigned8_t *per)
Retrieves, but does not pop, the most recent CANopen EMCY message from the stack.
int co_emcy_start(co_emcy_t *emcy)
Starts an EMCY service.
can_net_t * co_emcy_get_net(const co_emcy_t *emcy)
Returns a pointer to the CAN network of an EMCY producer/consumer service.
void co_emcy_ind_t(co_emcy_t *emcy, co_unsigned8_t id, co_unsigned16_t eec, co_unsigned8_t er, co_unsigned8_t msef[5], void *data)
The type of a CANopen EMCY indication function, invoked when an EMCY message is received.
A CANopen EMCY producer/consumer service.
An opaque CAN network interface type.
A class template supplying a uniform interface to certain attributes of C types.
int co_emcy_pop(co_emcy_t *emcy, co_unsigned16_t *peec, co_unsigned8_t *per)
Pops the most recent CANopen EMCY message from the stack and broadcasts an 'error reset' message if t...
int co_emcy_remove(co_emcy_t *emcy, size_t n)
Pops a CANopen EMCY message from the stack, even if it is not the most recent message,...
int co_emcy_push(co_emcy_t *emcy, co_unsigned16_t eec, co_unsigned8_t er, const co_unsigned8_t msef[5])
Pushes a CANopen EMCY message to the stack and broadcasts it if the EMCY producer service is active.
void co_emcy_set_ind(co_emcy_t *emcy, co_emcy_ind_t *ind, void *data)
Sets the indication function invoked when a CANopen EMCY message is received.
An opaque CANopen EMCY producer/consumer service type.
int co_emcy_clear(co_emcy_t *emcy)
Clears the CANopen EMCY message stack and broadcasts the 'error reset/no error' message if the EMCY p...
An opaque CANopen device type.