Fix off-by-one error in parameter count [resolves PX4/Firmware#3162]

This commit is contained in:
Ben Dyer
2015-11-20 23:32:54 +11:00
parent 1f33451690
commit 442c0d47ef

View File

@@ -575,7 +575,8 @@ void UavcanServers::cb_getset(const uavcan::ServiceCallResult<uavcan::protocol::
if (result.isSuccessful()) {
uavcan::protocol::param::GetSet::Response resp = result.getResponse();
if (resp.name.size()) {
_param_counts[node_id] = _count_index++;
_count_index++;
_param_counts[node_id] = _count_index;
uavcan::protocol::param::GetSet::Request req;
req.index = _count_index;