Skip to content
Snippets Groups Projects
Commit dde9e67e authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Change SlaveIdentifier to also read config from node Identifier

parent 7b570943
No related branches found
No related tags found
No related merge requests found
......@@ -27,9 +27,35 @@ using namespace armarx;
SlaveIdentifier::SlaveIdentifier(const RapidXmlReaderNode& node)
{
VendorID = node.first_node("VendorID").value_as_uint32();
ProductID = node.first_node("ProductID").value_as_uint32();
Serial = node.first_node("Serial").value_as_uint32();
ARMARX_TRACE;
ARMARX_DEBUG << "node valid " << node.is_valid()
<< "\npaths: " << node.getChildPaths();
ARMARX_CHECK_EXPRESSION(
(
node.has_node("VendorID") &&
node.has_node("ProductID") &&
node.has_node("Serial")
) ||
node.has_node("Identifier")
);
if (node.has_node("Identifier"))
{
const auto inode = node.first_node("Identifier");
ARMARX_CHECK_EXPRESSION(
inode.has_node("VendorID") &&
inode.has_node("ProductID") &&
inode.has_node("Serial")
) << "paths: " << inode.getChildPaths();
VendorID = inode.first_node("VendorID").value_as_uint32();
ProductID = inode.first_node("ProductID").value_as_uint32();
Serial = inode.first_node("Serial").value_as_uint32();
}
else
{
VendorID = node.first_node("VendorID").value_as_uint32();
ProductID = node.first_node("ProductID").value_as_uint32();
Serial = node.first_node("Serial").value_as_uint32();
}
}
SlaveIdentifier::SlaveIdentifier(uint32_t VendorID, uint32_t ProductID, uint32_t Serial, const std::string& humanName)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment