Node callbacks, all called from the node's thread.
More...
#include <canopen.h>
|
| void(* | nmt )(struct pbl_canopen *co, enum pbl_canopen_nmt_state state, void *arg) |
| | NMT state changed.
|
| |
| void(* | reset )(struct pbl_canopen *co, enum pbl_canopen_reset reset, void *arg) |
| | Reset requested by the NMT master, called once the defaults are restored and before the boot-up message, to set the values that differ from them.
|
| |
| int(* | write )(struct pbl_canopen *co, uint16_t index, uint8_t subindex, const void *data, size_t len, void *arg) |
| | An application entry is about to be written over the bus, by an SDO or an RPDO.
|
| |
| void(* | sync )(struct pbl_canopen *co, uint8_t counter, uint32_t cycles, void *arg) |
| | SYNC received in operational state, after the synchronous RPDOs are applied and before the synchronous TPDOs are sampled: where the application takes its new values and reports its own.
|
| |
| void(* | heartbeat )(struct pbl_canopen *co, uint8_t node_id, enum pbl_canopen_hb_event event, enum pbl_canopen_nmt_state state, void *arg) |
| | Heartbeat consumer event.
|
| |
Node callbacks, all called from the node's thread.
◆ heartbeat
Heartbeat consumer event.
- Parameters
-
| co | Node. |
| node_id | Monitored node. |
| event | Event. |
| state | The node's last state. |
| arg | Callback argument. |
◆ nmt
NMT state changed.
- Parameters
-
| co | Node. |
| state | New state. |
| arg | Callback argument. |
◆ reset
| void(* pbl_canopen_callbacks::reset) (struct pbl_canopen *co, enum pbl_canopen_reset reset, void *arg) |
Reset requested by the NMT master, called once the defaults are restored and before the boot-up message, to set the values that differ from them.
- Parameters
-
| co | Node. |
| reset | Reset. |
| arg | Callback argument. |
◆ sync
| void(* pbl_canopen_callbacks::sync) (struct pbl_canopen *co, uint8_t counter, uint32_t cycles, void *arg) |
SYNC received in operational state, after the synchronous RPDOs are applied and before the synchronous TPDOs are sampled: where the application takes its new values and reports its own.
It holds up the node's thread while it runs.
- Parameters
-
| co | Node. |
| counter | SYNC counter, 0 without one. |
| cycles | Value of pbl_cycle_get_32() when the controller handed the SYNC over, to measure how late the callback runs. |
| arg | Callback argument. |
◆ write
| int(* pbl_canopen_callbacks::write) (struct pbl_canopen *co, uint16_t index, uint8_t subindex, const void *data, size_t len, void *arg) |
An application entry is about to be written over the bus, by an SDO or an RPDO.
- Parameters
-
| co | Node. |
| index | Index. |
| subindex | Sub-index. |
| data | New value, in the CPU's byte order. |
| len | Size of the new value in bytes. |
| arg | Callback argument. |
- Returns
- 0 to store the value,
-EINVAL or -ERANGE to refuse it as invalid, -EBUSY to refuse it in the present state, or another negative errno to refuse it otherwise.
The documentation for this struct was generated from the following file: