temp workaround, but must fix in cmdproxy the possibility of getting extra packets in rx_missingpackets

This commit is contained in:
maliakal_d 2022-01-05 14:23:53 +01:00
parent 77fb8280f1
commit 4fce0dcd9c

View File

@ -1285,20 +1285,20 @@ std::string CmdProxy::RxMissingPackets(int action) {
if (!args.empty()) { if (!args.empty()) {
WrongNumberOfParameters(0); WrongNumberOfParameters(0);
} }
auto mp = det->getNumMissingPackets(std::vector<int>{det_id});
/*
auto tmp = det->getNumMissingPackets(std::vector<int>{det_id}); auto tmp = det->getNumMissingPackets(std::vector<int>{det_id});
// convert to signed missing packets (to get excess) // convert to signed missing packets (to get excess)
/*
Result<std::vector<int64_t>> mp(tmp.size()); Result<std::vector<int64_t>> mp(tmp.size());
for (unsigned int i = 0; i < mp.size(); ++i) { for (unsigned int i = 0; i < mp.size(); ++i) {
mp[i] = static_cast<int64_t>(tmp[i]); mp[i] = static_cast<int64_t>(tmp[i]);
} }
*/ OR
Result<std::vector<int64_t>> tmp;
Result<std::vector<int64_t>> mp;
for (auto val : tmp) { for (auto val : tmp) {
mp.push_back(static_cast<int64_t>(val)); mp.push_back(static_cast<int64_t>(val));
} }
*/
os << OutString(mp) << '\n'; os << OutString(mp) << '\n';
} else if (action == defs::PUT_ACTION) { } else if (action == defs::PUT_ACTION) {
throw sls::RuntimeError("Cannot put"); throw sls::RuntimeError("Cannot put");