aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-22 16:14:41 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-22 16:14:41 +0300
commit12f605c388bd3a7ff4f5d930d5ea9d0f07f7adcf (patch)
treefe1b37458dbff98f5e1b939d4802672fbae86269
parent866f15ef6b42ecbc38f61eab47ab606d854aa5c9 (diff)
device: add a FIXME comment about possible bug
-rw-r--r--src/voltronic/device.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/voltronic/device.cc b/src/voltronic/device.cc
index eb332eb..54ea668 100644
--- a/src/voltronic/device.cc
+++ b/src/voltronic/device.cc
@@ -55,8 +55,13 @@ size_t Device::run(const u8* inbuf, size_t inbufSize, u8* outbuf, size_t outbufS
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");
+ }
return recv(outbuf, outbufSize);
}