|
Lely core libraries
1.9.2
|
The abstract driver interface for a remote CANopen node. More...
#include <driver.hpp>

Public Member Functions | |
| virtual aio::ExecutorBase | GetExecutor () const noexcept=0 |
| Returns the executor used to execute event handlers for this driver, including SDO confirmation functions. | |
| virtual uint8_t | netid () const noexcept=0 |
| Returns the network-ID. | |
| virtual uint8_t | id () const noexcept=0 |
| Returns the node-ID. | |
| virtual void | OnCanState (CanState new_state, CanState old_state) noexcept=0 |
| The function invoked when a CAN bus state change is detected. More... | |
| virtual void | OnCanError (CanError error) noexcept=0 |
| The function invoked when an error is detected on the CAN bus. More... | |
| virtual void | OnCommand (NmtCommand cs) noexcept=0 |
| The function invoked when an NMT state change occurs on the master. More... | |
| virtual void | OnNodeGuarding (bool occurred) noexcept=0 |
| The function invoked when a node guarding timeout event occurs or is resolved for the remote node. More... | |
| virtual void | OnHeartbeat (bool occurred) noexcept=0 |
| The function invoked when a heartbeat timeout event occurs or is resolved for the remote node. More... | |
| virtual void | OnState (NmtState st) noexcept=0 |
| The function invoked when an NMT state change or boot-up event is detected for the remote node by the heartbeat protocol. More... | |
| virtual void | OnBoot (NmtState st, char es, const ::std::string &what) noexcept=0 |
| The function invoked when the NMT 'boot slave' process completes for the remote node. More... | |
| virtual void | OnConfig (::std::function< void(::std::error_code ec)> res) noexcept=0 |
| The function invoked when the 'update configuration' step is reached during the NMT 'boot slave' process of the remote node. More... | |
| virtual void | OnRpdo (int num, ::std::error_code ec, const void *p, ::std::size_t n) noexcept=0 |
| The function invoked when a Receive-PDO is processed by the master. More... | |
| virtual void | OnRpdoError (int num, uint16_t eec, uint8_t er) noexcept=0 |
| The function invoked when a Receive-PDO length mismatch or timeout error occurs on the master. More... | |
| virtual void | OnTpdo (int num, ::std::error_code ec, const void *p, ::std::size_t n) noexcept=0 |
| The function invoked after a Transmit-PDO is sent by the master or an error occurs. More... | |
| virtual void | OnSync (uint8_t cnt, const Node::time_point &t) noexcept=0 |
| The function invoked when a SYNC message is sent/received by the master. More... | |
| virtual void | OnSyncError (uint16_t eec, uint8_t er) noexcept=0 |
| The function invoked when the data length of a received SYNC message does not match. More... | |
| virtual void | OnTime (const ::std::chrono::system_clock::time_point &abs_time) noexcept=0 |
| The function invoked when a TIME message is received by the master. More... | |
| virtual void | OnEmcy (uint16_t eec, uint8_t er, uint8_t msef[5]) noexcept=0 |
| The function invoked when an EMCY message is received from the remote node. More... | |
The abstract driver interface for a remote CANopen node.
Definition at line 33 of file driver.hpp.
|
pure virtualnoexcept |
The function invoked when a CAN bus state change is detected.
|
pure virtualnoexcept |
The function invoked when an error is detected on the CAN bus.
|
pure virtualnoexcept |
The function invoked when an NMT state change occurs on the master.
| cs | the NMT command specifier. |
|
pure virtualnoexcept |
The function invoked when a node guarding timeout event occurs or is resolved for the remote node.
Note that depending on the value of object 1029:01 (Error behavior object) in the object dictionary of the master, the occurrence of a node guarding event MAY trigger an NMT state transition on the master. If so, this function is called after the state change completes.
| occurred | true if the node guarding event occurred, false if it was resolved. |
|
pure virtualnoexcept |
The function invoked when a heartbeat timeout event occurs or is resolved for the remote node.
Note that depending on the value of object 1029:01 (Error behavior object) in the object dictionary of the master, the occurrence of a heartbeat timeout event MAY trigger an NMT state transition on the master. If so, this function is called after the state change completes.
| occurred | true if the heartbeat timeout event occurred, false if it was resolved. |
|
pure virtualnoexcept |
The function invoked when an NMT state change or boot-up event is detected for the remote node by the heartbeat protocol.
| st | the state of the remote node. Note that the NMT sub-states NmtState::RESET_NODE and NmtState::RESET_COMM are never reported for remote nodes. |
|
pure virtualnoexcept |
The function invoked when the NMT 'boot slave' process completes for the remote node.
| st | the state of the remote node (including the toggle bit (NmtState::TOGGLE) if node guarding is enabled). |
| es | the error status (in the range ['A'..'O'], or 0 on success):
|
| what | if es is non-zero, contains a string explaining the error. |
|
pure virtualnoexcept |
The function invoked when the 'update configuration' step is reached during the NMT 'boot slave' process of the remote node.
The 'boot slave' process is halted until the result of the 'update configuration' step is communicated to the master.
Note that OnConfig() MUST be a non-blocking function; the configuration update MUST be executed asynchronously or run in a different thread.
| res | the function to invoke on completion of the 'update configuration' step. The argument to res is the result: 0 on success, or an SDO abort code on error. |
|
pure virtualnoexcept |
The function invoked when a Receive-PDO is processed by the master.
In case of a PDO length mismatch error, OnRpdoError() is invoked after this function.
| num | the PDO number (in the range [1..512]). |
| ec | the SDO abort code:
|
| p | a pointer to the bytes received. |
| n | the number of bytes at p. |
|
pure virtualnoexcept |
The function invoked when a Receive-PDO length mismatch or timeout error occurs on the master.
| num | the PDO number (in the range [1..512]). |
| eec | the emergency error code:
|
| er | the error register (0x10). |
|
pure virtualnoexcept |
The function invoked after a Transmit-PDO is sent by the master or an error occurs.
| num | the PDO number (in the range [1..512]). |
| ec | the SDO abort code :
|
| p | a pointer to the bytes sent. |
| n | the number of bytes at p. |
|
pure virtualnoexcept |
The function invoked when a SYNC message is sent/received by the master.
Note that this function is called after all PDOs are processed/sent.
| cnt | the counter (in the range [1..240]), or 0 if the SYNC message is empty. |
| t | the time at which the SYNC message was sent/received. |
|
pure virtualnoexcept |
The function invoked when the data length of a received SYNC message does not match.
| eec | the emergency error code (0x8240). |
| er | the error register (0x10). |
|
pure virtualnoexcept |
The function invoked when a TIME message is received by the master.
| abs_time | a time point representing the received time stamp. |
|
pure virtualnoexcept |
The function invoked when an EMCY message is received from the remote node.
| eec | the emergency error code. |
| er | the error register. |
| msef | the manufacturer-specific error code. |