The DS301Group class is the base Class for all canOpen device groups, providing basic interfaces to the DS301 functionality. More...
#include <DS301Group.h>
Public Types | |
typedef boost::shared_ptr < const DS301Group > | ConstPtr |
Shared pointer to a const DS301Group. | |
typedef boost::shared_ptr < DS301Group > | Ptr |
Shared pointer to a DS301Group. | |
Public Member Functions | |
virtual void | appendPDOMappingSingle (const PDO::MappingConfigurationList &config, const uint16_t pdo_nr, const PDO::eTransmissionType &transmission_type, const DS301Node::ePDO_TYPE &pdo_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0, const int16_t node_id=-1) |
Appends one or more mapping parameters to the existing mapping. Note that the PDO will be disabled while appending another mapping. | |
virtual bool | deleteNodeFromId (const uint8_t node_id) |
Deletes a node with a given node id from the node list, if it is present. If the node can't be found in this group, this function will return false;. | |
virtual void | deleteNodes (std::vector< uint8_t > &deleted_ids) |
Deletes all nodes assigned to the group. | |
void | downloadPDOs () |
DS301Group (const std::string &name="") | |
std::string | getName () const |
Returns the group's identifier string. | |
virtual std::vector < DS301Node::Ptr > | getNodes () const |
Returns the group's node vector. | |
virtual void | initPDOMappingSingle (const PDO::MappingConfigurationList &config, const uint16_t pdo_nr, const PDO::eTransmissionType &transmission_type, const DS301Node::ePDO_TYPE &pdo_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0, const int16_t node_id=-1) |
Init PDO mapping with a given mapping configuration for a given pdo nr. | |
void | printPDOMapping (const uint8_t node_id=-1) |
Will query the PDO mapping from the device and print that to the output. | |
void | registerWSBroadcaster (boost::shared_ptr< icl_comm::websocket::WsBroadcaster > broadcaster) |
registerWSBroadcaster Adds a debug interface | |
void | uploadPDOs () |
Protected Member Functions | |
template<typename NodeT > | |
DS301Node::Ptr | addNode (const uint8_t node_id, const CanDevPtr can_device, HeartBeatMonitor::Ptr heartbeat_monitor) |
Creates a new DS301Node and adds it to the group-. | |
Protected Attributes | |
std::string | m_name |
std::vector< DS301Node::Ptr > | m_nodes |
boost::shared_ptr < icl_comm::websocket::WsBroadcaster > | m_ws_broadcaster |
Interface to send out diagnostics data. Only available if compiled with _IC_BUILDER_ICL_COMM_WEBSOCKET_. | |
Friends | |
class | CanOpenController |
The DS301Group class is the base Class for all canOpen device groups, providing basic interfaces to the DS301 functionality.
The DS301 Group provides the interface to access devices using the DS301 protocol (canOpen). It implements the interfaces needs to set up devices of a group and to access the relevant functions, such as NMT to bring the nodes into the correct state. While the DS301Group implements the basic calls that can be used for canOpen device management, it is intended to be used as a Base class that is derived from by the profile specific groups that offer a hardware related interface
Definition at line 41 of file DS301Group.h.
typedef boost::shared_ptr<const DS301Group> icl_hardware::canopen_schunk::DS301Group::ConstPtr |
Shared pointer to a const DS301Group.
Reimplemented in icl_hardware::canopen_schunk::DS402Group.
Definition at line 47 of file DS301Group.h.
typedef boost::shared_ptr<DS301Group> icl_hardware::canopen_schunk::DS301Group::Ptr |
Shared pointer to a DS301Group.
Reimplemented in icl_hardware::canopen_schunk::DS402Group.
Definition at line 45 of file DS301Group.h.
icl_hardware::canopen_schunk::DS301Group::DS301Group | ( | const std::string & | name = "" | ) |
Definition at line 30 of file DS301Group.cpp.
DS301Node::Ptr icl_hardware::canopen_schunk::DS301Group::addNode | ( | const uint8_t | node_id, |
const CanDevPtr | can_device, | ||
HeartBeatMonitor::Ptr | heartbeat_monitor | ||
) | [protected] |
Creates a new DS301Node and adds it to the group-.
node_id | ID of the new node |
can_device | Shared pointer to the can device |
Reimplemented in icl_hardware::canopen_schunk::DS402Group.
Definition at line 31 of file DS301Group.hpp.
void icl_hardware::canopen_schunk::DS301Group::appendPDOMappingSingle | ( | const PDO::MappingConfigurationList & | config, |
const uint16_t | pdo_nr, | ||
const PDO::eTransmissionType & | transmission_type, | ||
const DS301Node::ePDO_TYPE & | pdo_type, | ||
const bool | dummy_mapping = false , |
||
const uint8_t | cyclic_timeout_cycles = 0 , |
||
const int16_t | node_id = -1 |
||
) | [virtual] |
Appends one or more mapping parameters to the existing mapping. Note that the PDO will be disabled while appending another mapping.
config | List of MappingConfigurations that should be appended. |
pdo_nr | Index of the PDO this mapping should be done. |
transmission_type | Transmission type of this PDO |
pdo_type | Is it a receive PDO or a transmit PDO? |
dummy_mapping | if set to True, no download to the device will be performed, but the mapping will be done on host side. This is especially useful if a device has preconfigured PDOs which you like to use. |
cyclic_timeout_cycles | In case of transmission type SYNCHRONOUS_CYCLIC this parameter defines the PDO's frequency by defining the number of cycles between two send attempts. For example, a parameter value of 4 means, that the PDO is sent every 5th cycle. |
node_id | If left out or given a negative value, the mapping will be applied to all nodes in the group, otherwise it will only be used for the given node-id. |
Definition at line 80 of file DS301Group.cpp.
bool icl_hardware::canopen_schunk::DS301Group::deleteNodeFromId | ( | const uint8_t | node_id | ) | [virtual] |
Deletes a node with a given node id from the node list, if it is present. If the node can't be found in this group, this function will return false;.
node_id | CANOPEN-Id of node that should be deleted. |
Definition at line 45 of file DS301Group.cpp.
void icl_hardware::canopen_schunk::DS301Group::deleteNodes | ( | std::vector< uint8_t > & | deleted_ids | ) | [virtual] |
Deletes all nodes assigned to the group.
[out] | deleted_ids | Vector of CANOPEN IDs of deleted objects |
Definition at line 35 of file DS301Group.cpp.
Definition at line 110 of file DS301Group.cpp.
std::string icl_hardware::canopen_schunk::DS301Group::getName | ( | ) | const [inline] |
Returns the group's identifier string.
Definition at line 130 of file DS301Group.h.
virtual std::vector<DS301Node::Ptr> icl_hardware::canopen_schunk::DS301Group::getNodes | ( | ) | const [inline, virtual] |
Returns the group's node vector.
Definition at line 54 of file DS301Group.h.
void icl_hardware::canopen_schunk::DS301Group::initPDOMappingSingle | ( | const PDO::MappingConfigurationList & | config, |
const uint16_t | pdo_nr, | ||
const PDO::eTransmissionType & | transmission_type, | ||
const DS301Node::ePDO_TYPE & | pdo_type, | ||
const bool | dummy_mapping = false , |
||
const uint8_t | cyclic_timeout_cycles = 0 , |
||
const int16_t | node_id = -1 |
||
) | [virtual] |
Init PDO mapping with a given mapping configuration for a given pdo nr.
config | List of MappingConfigurations that should be mapped |
pdo_nr | Index of the PDO this mapping should be done. |
transmission_type | Transmission type of this PDO |
pdo_type | Is it a receive PDO or a transmit PDO? |
dummy_mapping | if set to True, no download to the device will be performed, but the mapping will be done on host side. This is especially useful if a device has preconfigured PDOs which you like to use. |
cyclic_timeout_cycles | If the transmission type SYNCHRONOUS_CYCLIC is used, this parameter defines the PDO's frequency by defining the number of cycles between two send attempts. For example, a parameter value of 4 means, that the PDO is sent every 5th cycle. |
node_id | If left out or given a negative value, the mapping will be applied to all nodes in the group, otherwise it will only be used for the given node-id. |
PDOException | when something goes wrong. |
Definition at line 58 of file DS301Group.cpp.
void icl_hardware::canopen_schunk::DS301Group::printPDOMapping | ( | const uint8_t | node_id = -1 | ) |
Will query the PDO mapping from the device and print that to the output.
node_id | If no or negative id given, the function will be called on every node within this group. If a positive node_id is given, only the specified node will be affected. |
Definition at line 118 of file DS301Group.cpp.
void icl_hardware::canopen_schunk::DS301Group::registerWSBroadcaster | ( | boost::shared_ptr< icl_comm::websocket::WsBroadcaster > | broadcaster | ) |
registerWSBroadcaster Adds a debug interface
Definition at line 129 of file DS301Group.cpp.
Definition at line 102 of file DS301Group.cpp.
friend class CanOpenController [friend] |
Reimplemented in icl_hardware::canopen_schunk::DS402Group.
Definition at line 165 of file DS301Group.h.
std::string icl_hardware::canopen_schunk::DS301Group::m_name [protected] |
Definition at line 162 of file DS301Group.h.
Definition at line 161 of file DS301Group.h.
boost::shared_ptr<icl_comm::websocket::WsBroadcaster> icl_hardware::canopen_schunk::DS301Group::m_ws_broadcaster [protected] |
Interface to send out diagnostics data. Only available if compiled with _IC_BUILDER_ICL_COMM_WEBSOCKET_.
Definition at line 168 of file DS301Group.h.