Commit 007422d5 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Support multi-line responses in Camera::getCmd

parent 10bede9e
Pipeline #39830 failed with stages
in 6 minutes and 6 seconds
......@@ -525,11 +525,14 @@ string Camera::getCmd(const string& s, int idx)
string::size_type p = s.find(':');
string raw_s = s.substr((p == string::npos) ? 0 : (p + 1));
DEB_TRACE() << DEB_VAR2(s, raw_s);
if (r.find(raw_s + ' ') != 0)
THROW_HW_ERROR(Error) << "Invalid response: " << r;
string::size_type e = raw_s.size() + 1;
p = r.find('\n', e);
r = r.substr(e, (p == string::npos) ? p : (p - e));
bool multi_line = ((s == "list") || (s == "versions"));
if (!multi_line) {
if (r.find(raw_s + ' ') != 0)
THROW_HW_ERROR(Error) << "Invalid response: " << r;
string::size_type e = raw_s.size() + 1;
p = r.find('\n', e);
r = r.substr(e, (p == string::npos) ? p : (p - e));
}
DEB_RETURN() << DEB_VAR1(r);
return r;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment