The SlaveIdentifier class is a POD-type representing a unique set of values identifying an EtherCAT slave.
More...
#include <armarx/control/ethercat/SlaveIdentifier.h>
|
| std::uint32_t | productCode = 0 |
| | The product code of the slave.
|
| |
| std::uint32_t | revisionNumber = 0 |
| | The revision number of the slave hard- or firmware (is not used for identifying a slave on the bus)
|
| |
| std::uint32_t | serialNumber = 0 |
| | The serial number of a slave with a certain productCode.
|
| |
| std::int16_t | slaveIndex = -1 |
| | The index of the slave on the bus.
|
| |
| std::uint32_t | vendorID = 0 |
| | The unique id of the vendor of the slave hardware.
|
| |
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.
◆ SlaveIdentifier() [1/2]
◆ SlaveIdentifier() [2/2]
◆ getName()
| 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.
- Returns
- The name as a std::string
◆ getNameAsCStr()
| 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.
- Returns
- The name as a const pointer to a char array
◆ setName()
| 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.
- Parameters
-
- Returns
- true if the provided name could be fully set as the salve name, false if parts of the combined name needed to be cut
◆ setParentDeviceName()
| bool setParentDeviceName |
( |
const std::string & | parentDeviceName | ) |
|
Sets the name of the parent device of a slave identifier.
- See also
- setName for conditions on possible cutting of the provided name.
- Parameters
-
| parentDeviceName | the new name of the parent device |
- Returns
- true if the provided name could be set without losing data, false if not.
◆ toMinimalString()
| 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.
- Parameters
-
| linePrefix | the string which will be put in front of every line |
- Returns
- A minimal string representation.
◆ toString()
| 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.
- Parameters
-
| linePrefix | the string which will be put in front of every line |
- Returns
- A full string representation.
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | stream, |
|
|
const SlaveIdentifier & | rhs ) |
|
friend |
◆ productCode
| std::uint32_t productCode = 0 |
The product code of the slave.
The same product code means the same salve hardware
◆ revisionNumber
| std::uint32_t revisionNumber = 0 |
The revision number of the slave hard- or firmware (is not used for identifying a slave on the bus)
◆ serialNumber
| std::uint32_t serialNumber = 0 |
The serial number of a slave with a certain productCode.
◆ slaveIndex
| std::int16_t slaveIndex = -1 |
The index of the slave on the bus.
◆ vendorID
| std::uint32_t vendorID = 0 |
The unique id of the vendor of the slave hardware.
The documentation for this class was generated from the following files: