Go to the documentation of this file.
45 return std::string(m_name);
57 std::string dname = std::string(&m_name[m_start_pos_device_name]);
58 std::size_t old_len = strlen(m_name);
60 std::snprintf(m_name,
sizeof(m_name),
"%s%s", name.c_str(), dname.c_str());
61 m_start_pos_device_name +=
static_cast<std::size_t
>(written_chars) - old_len;
62 return written_chars >
static_cast<int>(MAX_NAME_LENGTH);
68 return std::snprintf(&m_name[m_start_pos_device_name],
69 sizeof(m_name) - m_start_pos_device_name,
71 parentDeviceName.c_str()) >
static_cast<int>(MAX_NAME_LENGTH);
78 constexpr std::uint16_t fw = 16;
81 ss << linePrefix <<
left << setw(fw) <<
"Name:"
83 ss << linePrefix <<
left << setw(fw) <<
"VendorID:"
85 ss << linePrefix <<
left << setw(fw) <<
"ProductCode:"
87 ss << linePrefix <<
left << setw(fw) <<
"RevisionNumber:"
89 ss << linePrefix <<
left << setw(fw) <<
"SerialNumber:"
91 ss << linePrefix <<
left << setw(fw) <<
"SlaveIndex:"
101 std::stringstream ss;
102 constexpr std::uint16_t fw = 16;
105 ss << linePrefix <<
left << setw(fw) <<
"Name:"
107 ss << linePrefix <<
left << setw(fw) <<
"SlaveIndex:"
Data structure holding the information necessary to create a SlaveIdentifier.
SlaveIdentifier()=default
std::uint32_t getProductCode()
std::uint32_t getVendorID()
std::uint32_t productCode
The product code of the slave.
bool setParentDeviceName(const std::string &parentDeviceName)
Sets the name of the parent device of a slave identifier.
bool setName(const std::string &name)
Sets the slave name of a SlaveIdentifier and returns whether the new name fits together with the pare...
std::uint32_t getSerialNumber()
std::uint32_t serialNumber
The serial number of a slave with a certain productCode.
std::uint32_t vendorID
The unique id of the vendor of the slave hardware.
std::string getName() const
Returns the combination of slave name and name of the parent device of a slave identifier as a string...
std::uint32_t revisionNumber
The revision number of the slave hard- or firmware (is not used for identifying a slave on the bus)
std::string toMinimalString(const std::string &linePrefix="") const
Returns a minimal string representation of a SlaveIdentifier.
std::int16_t slaveIndex
The index of the slave on the bus.
const char * getNameAsCStr() const
Returns the combination of slave name and name of the parent device of a slave identifier as char arr...
state::Type left(state::Type previous)
std::string toString(const std::string &linePrefix="") const
Returns a full string representation of a SlaveIdentifier.