Basic support for string parameters

This commit is contained in:
Pavel Kirienko
2015-03-19 00:19:40 +03:00
parent ddc4b649a8
commit 3b7669219e
4 changed files with 20 additions and 4 deletions
@@ -88,6 +88,10 @@ std::string paramValueToString(const uavcan::protocol::param::Value& value)
{
return std::to_string(value.value_float[0]);
}
else if (!value.value_string.empty())
{
return std::string(value.value_string[0].value.c_str());
}
else
{
return "?";
@@ -176,6 +180,7 @@ const std::map<std::string,
else
{
request.name = args.at(0).c_str();
// TODO: add support for string parameters
request.value.value_float.push_back(std::stof(args.at(1)));
printGetSetResponse(call(*client, node_id, request));
}