Commit ca891316 authored by ahoms's avatar ahoms

* Fixed problem leaving Frelon::SerialLine locked when camera sends an error


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@280 45c4679d-1946-429d-baad-37912b19538b
parent 487985fb
......@@ -92,6 +92,22 @@ class SerialLine : public HwSerialLine
int max_len = MaxReadLen,
double timeout = TimeoutDefault);
class ReadRespCleanup {
public:
ReadRespCleanup(SerialLine& ser_line)
: m_ser_line(ser_line)
{}
~ReadRespCleanup()
{ m_ser_line.readRespCleanup(); }
private:
SerialLine& m_ser_line;
};
friend class RespCleanup;
void readRespCleanup();
bool isRegCacheable(Reg reg);
bool getRegCacheVal(Reg reg, int& val);
......
......@@ -156,11 +156,18 @@ void SerialLine::readResp(string& buffer, int max_len, double timeout)
throw LIMA_HW_EXC(Error, "readLine without previous write");
}
ReadRespCleanup read_resp_clenup(*this);
if ((m_curr_op == MultiRead) && (timeout == TimeoutDefault))
readMultiLine(buffer, max_len);
else
readSingleLine(buffer, max_len, timeout);
}
void SerialLine::readRespCleanup()
{
DEB_MEMBER_FUNCT();
m_curr_op = None;
m_cond.signal();
}
......
Markdown is supported
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