Skip to content

Commit

Permalink
Fix checks and missing acks, allow string cmds
Browse files Browse the repository at this point in the history
That is, when not checking isVocab(), CLI users may pass 'prms'
instead of '[prms]'.
  • Loading branch information
PeterBowman committed Jan 23, 2018
1 parent 14ea804 commit f8dd1fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/YarpPlugins/CartesianControlServer/RpcResponder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace
{
inline bool isGroupParam(const yarp::os::Bottle& in)
{
return in.size() > 1 && in.get(1).isVocab() && in.get(1).asVocab() == VOCAB_CC_CONFIG_PARAMS;
return in.size() > 1 && in.get(1).asVocab() == VOCAB_CC_CONFIG_PARAMS;
}
}

Expand Down Expand Up @@ -248,6 +248,7 @@ bool roboticslab::RpcResponder::handleParameterSetterGroup(const yarp::os::Bottl
if (!in.get(i).isList() || in.get(i).asList()->size() != 2)
{
CD_ERROR("bottle format error\n");
out.addVocab(VOCAB_CC_FAILED);
return false;
}

Expand All @@ -262,6 +263,7 @@ bool roboticslab::RpcResponder::handleParameterSetterGroup(const yarp::os::Bottl
return false;
}

out.addVocab(VOCAB_CC_OK);
return true;
}
else
Expand All @@ -276,7 +278,7 @@ bool roboticslab::RpcResponder::handleParameterSetterGroup(const yarp::os::Bottl

bool roboticslab::RpcResponder::handleParameterGetterGroup(const yarp::os::Bottle& in, yarp::os::Bottle& out)
{
if (in.size() != 2)
if (in.size() == 2)
{
std::map<int, double> params;

Expand Down

0 comments on commit f8dd1fb

Please sign in to comment.