mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-11 11:03:34 +08:00
ParamServer logic improvement
This commit is contained in:
@@ -33,6 +33,12 @@ void ParamServer::handleGetSet(const protocol::param::GetSet::Request& in, proto
|
||||
out.name = in.name;
|
||||
}
|
||||
|
||||
if (out.name.empty())
|
||||
{
|
||||
UAVCAN_TRACE("ParamServer", "GetSet: Can't resolve parameter name, index=%i", int(in.index));
|
||||
return;
|
||||
}
|
||||
|
||||
// Assign if needed, read back
|
||||
if (isValueNonEmpty(in.value))
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ struct ParamServerTestManager : public uavcan::IParamManager
|
||||
|
||||
virtual void assignParamValue(const ParamName& name, const ParamValue& value)
|
||||
{
|
||||
assert(!name.empty());
|
||||
std::cout << "ASSIGN [" << name.c_str() << "]\n" << value << "\n---" << std::endl;
|
||||
KeyValue::iterator it = kv.find(name.c_str());
|
||||
if (it != kv.end())
|
||||
@@ -56,6 +57,7 @@ struct ParamServerTestManager : public uavcan::IParamManager
|
||||
|
||||
virtual void readParamValue(const ParamName& name, ParamValue& out_value) const
|
||||
{
|
||||
assert(!name.empty());
|
||||
KeyValue::const_iterator it = kv.find(name.c_str());
|
||||
if (it != kv.end())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user