device: add a FIXME comment about possible bug

This commit is contained in:
Evgeny Zinoviev 2021-05-22 16:14:41 +03:00
parent 866f15ef6b
commit 12f605c388

View File

@ -55,8 +55,13 @@ size_t Device::run(const u8* inbuf, size_t inbufSize, u8* outbuf, size_t outbufS
send(inbuf, inbufSize); send(inbuf, inbufSize);
if (!getTimeLeft()) if (!getTimeLeft()) {
// FIXME
// we should read incoming data from the device,
// or clean the buffer in some other way.
// otherwise we may get invalid response next time
throw TimeoutError("sending already took " + std::to_string(getElapsedTime()) + " ms"); throw TimeoutError("sending already took " + std::to_string(getElapsedTime()) + " ms");
}
return recv(outbuf, outbufSize); return recv(outbuf, outbufSize);
} }