#include <canopen.h>
Public Types | |
enum | State { Unknown = 255, BootUp = 0, Stopped = 4, Operational = 5, PreOperational = 127 } |
using | StateDelegate = can::DelegateHelper< StateFunc > |
using | StateFunc = std::function< void(const State &)> |
typedef can::Listener< const StateFunc, const State & > | StateListener |
typedef StateListener::ListenerConstSharedPtr | StateListenerConstSharedPtr |
Public Types inherited from canopen::Layer | |
enum | LayerState { Off, Init, Shutdown, Error, Halt, Recover, Ready } |
Public Member Functions | |
StateListenerConstSharedPtr | addStateListener (const StateFunc &s) |
void | enterState (const State &s) |
template<typename T > | |
T | get (const ObjectDict::Key &k) |
const State | getState () |
const ObjectStorageSharedPtr | getStorage () |
Node (const can::CommInterfaceSharedPtr interface, const ObjectDictSharedPtr dict, uint8_t node_id, const SyncCounterSharedPtr sync=SyncCounterSharedPtr()) | |
bool | prepare () |
bool | reset () |
bool | reset_com () |
bool | start () |
bool | stop () |
Public Member Functions inherited from canopen::Layer | |
void | diag (LayerReport &report) |
LayerState | getLayerState () |
void | halt (LayerStatus &status) |
void | init (LayerStatus &status) |
Layer (const std::string &n) | |
void | read (LayerStatus &status) |
void | recover (LayerStatus &status) |
void | shutdown (LayerStatus &status) |
void | write (LayerStatus &status) |
virtual | ~Layer () |
Public Attributes | |
const uint8_t | node_id_ |
Public Attributes inherited from canopen::Layer | |
const std::string | name |
Private Member Functions | |
bool | checkHeartbeat () |
uint16_t | getHeartbeatInterval () |
virtual void | handleDiag (LayerReport &report) |
virtual void | handleHalt (LayerStatus &status) |
virtual void | handleInit (LayerStatus &status) |
void | handleNMT (const can::Frame &msg) |
virtual void | handleRead (LayerStatus &status, const LayerState ¤t_state) |
virtual void | handleRecover (LayerStatus &status) |
virtual void | handleShutdown (LayerStatus &status) |
virtual void | handleWrite (LayerStatus &status, const LayerState ¤t_state) |
void | setHeartbeatInterval () |
void | switchState (const uint8_t &s) |
template<typename T > | |
int | wait_for (const State &s, const T &timeout) |
Private Attributes | |
boost::condition_variable | cond |
boost::mutex | cond_mutex |
ObjectStorage::Entry< ObjectStorage::DataType< ObjectDict::DEFTYPE_UNSIGNED16 >::type > | heartbeat_ |
boost::chrono::high_resolution_clock::time_point | heartbeat_timeout_ |
const can::CommInterfaceSharedPtr | interface_ |
boost::timed_mutex | mutex |
can::FrameListenerConstSharedPtr | nmt_listener_ |
PDOMapper | pdo_ |
SDOClient | sdo_ |
State | state_ |
can::SimpleDispatcher< StateListener > | state_dispatcher_ |
const SyncCounterSharedPtr | sync_ |
Additional Inherited Members |
using canopen::Node::StateFunc = std::function<void(const State&)> |
typedef can::Listener<const StateFunc, const State&> canopen::Node::StateListener |
enum canopen::Node::State |
Node::Node | ( | const can::CommInterfaceSharedPtr | interface, |
const ObjectDictSharedPtr | dict, | ||
uint8_t | node_id, | ||
const SyncCounterSharedPtr | sync = SyncCounterSharedPtr() |
||
) |
|
inline |
void canopen::Node::enterState | ( | const State & | s | ) |
|
inline |
|
inlineprivate |
const Node::State Node::getState | ( | ) |
|
inline |
|
privatevirtual |
Implements canopen::Layer.
|
privatevirtual |
Implements canopen::Layer.
|
privatevirtual |
Implements canopen::Layer.
|
private |
|
privatevirtual |
Implements canopen::Layer.
|
privatevirtual |
Implements canopen::Layer.
|
privatevirtual |
Implements canopen::Layer.
|
privatevirtual |
Implements canopen::Layer.
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |