aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device.cc1
-rw-r--r--include/device_proto.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/device.cc b/device.cc
index 477884b..0427d29 100644
--- a/device.cc
+++ b/device.cc
@@ -91,4 +91,5 @@ Stick10::Stick10() {
Stick20::Stick20() {
m_vid = 0x20a0;
m_pid = 0x4109;
+ m_retry_timeout = std::chrono::milliseconds(500);
}
diff --git a/include/device_proto.h b/include/device_proto.h
index c248b10..82606a1 100644
--- a/include/device_proto.h
+++ b/include/device_proto.h
@@ -165,6 +165,7 @@ class Transaction : semantics::non_constructible {
const command_payload &payload) {
using namespace ::nitrokey::device;
using namespace ::nitrokey::log;
+ using namespace std::chrono_literals;
Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
@@ -190,7 +191,9 @@ class Transaction : semantics::non_constructible {
std::string("Device error while sending command ") +
std::to_string((int)(status)));
- // FIXME make checks done in device:recv here
+ std::this_thread::sleep_for(1000ms);
+
+ // FIXME make checks done in device:recv here
int retry = dev.get_retry_count();
while (retry-- > 0) {
status = dev.recv(&resp);