Lely core libraries 2.3.4
|
The abstract driver interface for a remote CANopen node. More...
#include <driver.hpp>
Public Member Functions | |
virtual ev::Executor | 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 (io::CanState new_state, io::CanState old_state) noexcept=0 |
The function invoked when a CAN bus state change is detected. | |
virtual void | OnCanError (io::CanError error) noexcept=0 |
The function invoked when an error is detected on the CAN bus. | |
virtual void | OnCommand (NmtCommand cs) noexcept=0 |
The function invoked when an NMT state change occurs on the master. | |
virtual void | OnHeartbeat (bool occurred) noexcept=0 |
The function invoked when a heartbeat timeout event occurs or is resolved for the remote node. | |
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. | |
virtual void | OnSync (uint8_t cnt, const time_point &t) noexcept=0 |
The function invoked when a SYNC message is sent/received by the master. | |
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. | |
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. | |
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. | |
virtual void | OnNodeGuarding (bool occurred) noexcept=0 |
The function invoked when a node guarding timeout event occurs or is resolved for the remote node. | |
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. | |
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. | |
virtual void | OnDeconfig (::std::function< void(::std::error_code ec)> res) noexcept=0 |
The function invoked by BasicMaster::AsyncDeconfig() to start the deconfiguration process. | |
The abstract driver interface for a remote CANopen node.
Definition at line 36 of file driver.hpp.
|
pure virtualnoexcept |
The function invoked when a CAN bus state change is detected.
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
pure virtualnoexcept |
The function invoked when an error is detected on the CAN bus.
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
pure virtualnoexcept |
The function invoked when an NMT state change occurs on the master.
cs | the NMT command specifier. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
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. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
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. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
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. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
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). |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
pure virtualnoexcept |
The function invoked when a TIME message is received by the master.
abs_time | a time point representing the received time stamp. |
Implemented in lely::canopen::BasicLogicalDriver< BasicDriver >, and lely::canopen::BasicDriver.
|
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. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
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. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
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. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
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. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.
|
pure virtualnoexcept |
The function invoked by BasicMaster::AsyncDeconfig() to start the deconfiguration process.
The process does not complete until the result is communicated to the master.
Note that OnDeconfig()
MUST be a non-blocking function; the deconfiguration process MUST be executed asynchronously or run in a different thread.
res | the function to invoke when the deconfiguration process completes. The argument to res is the result: 0 on success, or an error code on failure. |
Implemented in lely::canopen::BasicDriver, and lely::canopen::BasicLogicalDriver< BasicDriver >.