|
The SlaveIdentifier class is a POD-type representing a unique set of values identifying an EtherCAT slave. More...
#include <armarx/control/ethercat/SlaveIdentifier.h>
Public Member Functions | |
std::string | getName () const |
Returns the combination of slave name and name of the parent device of a slave identifier as a string object. More... | |
const char * | getNameAsCStr () const |
Returns the combination of slave name and name of the parent device of a slave identifier as char array. More... | |
bool | setName (const std::string &name) |
Sets the slave name of a SlaveIdentifier and returns whether the new name fits together with the parent device name into the name-variable. More... | |
bool | setParentDeviceName (const std::string &parentDeviceName) |
Sets the name of the parent device of a slave identifier. More... | |
SlaveIdentifier ()=default | |
SlaveIdentifier (hardware_config::SlaveIdentifierConfig &config) | |
Construct a SlaveIdentifier from a RapidXmlReaderNode by parsing the node for following entries: More... | |
std::string | toMinimalString (const std::string &linePrefix="") const |
Returns a minimal string representation of a SlaveIdentifier. More... | |
std::string | toString (const std::string &linePrefix="") const |
Returns a full string representation of a SlaveIdentifier. More... | |
Public Attributes | |
std::uint32_t | productCode = 0 |
The product code of the slave. More... | |
std::uint32_t | revisionNumber = 0 |
The revision number of the slave hard- or firmware (is not used for identifying a slave on the bus) More... | |
std::uint32_t | serialNumber = 0 |
The serial number of a slave with a certain productCode. More... | |
std::int16_t | slaveIndex = -1 |
The index of the slave on the bus. More... | |
std::uint32_t | vendorID = 0 |
The unique id of the vendor of the slave hardware. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const SlaveIdentifier &rhs) |
The SlaveIdentifier class is a POD-type representing a unique set of values identifying an EtherCAT slave.
The requirement of being a POD-type requires a pre-defined length of the name-variable. Therefore it might happen, that the name of a SlaveIdentifier is cut after a pre-defined amount of characters.
Definition at line 53 of file SlaveIdentifier.h.
|
default |
Construct a SlaveIdentifier from a RapidXmlReaderNode by parsing the node for following entries:
node | The RapidXmlReaderNode which is used as input. |
Definition at line 35 of file SlaveIdentifier.cpp.
std::string getName | ( | ) | const |
Returns the combination of slave name and name of the parent device of a slave identifier as a string object.
This creates a new std::string obejct and therefore might allocate memory.
Definition at line 44 of file SlaveIdentifier.cpp.
const char * getNameAsCStr | ( | ) | const |
Returns the combination of slave name and name of the parent device of a slave identifier as char array.
This function does not allocate memory and is safe to be used in a rt-thread.
Definition at line 50 of file SlaveIdentifier.cpp.
bool setName | ( | const std::string & | name | ) |
Sets the slave name of a SlaveIdentifier and returns whether the new name fits together with the parent device name into the name-variable.
The name of the parent device will be kept, unless the combined name is too long for the size of the name-variable and some parts were lost.
name | the new slave name |
Definition at line 56 of file SlaveIdentifier.cpp.
bool setParentDeviceName | ( | const std::string & | parentDeviceName | ) |
Sets the name of the parent device of a slave identifier.
parentDeviceName | the new name of the parent device |
Definition at line 67 of file SlaveIdentifier.cpp.
std::string toMinimalString | ( | const std::string & | linePrefix = "" | ) | const |
Returns a minimal string representation of a SlaveIdentifier.
This representation contains only the combined name and the slaveIndex. Each printed member will be prefixed by the provided linePrefix and printed on its own line.
linePrefix | the string which will be put in front of every line |
Definition at line 100 of file SlaveIdentifier.cpp.
std::string toString | ( | const std::string & | linePrefix = "" | ) | const |
Returns a full string representation of a SlaveIdentifier.
This representation contains all members seperated by newlines. Each line will be prefixed by the provided linePrefix.
linePrefix | the string which will be put in front of every line |
Definition at line 76 of file SlaveIdentifier.cpp.
|
friend |
Definition at line 83 of file SlaveIdentifier.h.
std::uint32_t productCode = 0 |
The product code of the slave.
The same product code means the same salve hardware
Definition at line 75 of file SlaveIdentifier.h.
std::uint32_t revisionNumber = 0 |
The revision number of the slave hard- or firmware (is not used for identifying a slave on the bus)
Definition at line 80 of file SlaveIdentifier.h.
std::uint32_t serialNumber = 0 |
The serial number of a slave with a certain productCode.
Definition at line 77 of file SlaveIdentifier.h.
std::int16_t slaveIndex = -1 |
The index of the slave on the bus.
Definition at line 71 of file SlaveIdentifier.h.
std::uint32_t vendorID = 0 |
The unique id of the vendor of the slave hardware.
Definition at line 73 of file SlaveIdentifier.h.