summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/device.h6
-rw-r--r--include/device_proto.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/include/device.h b/include/device.h
index 67b739c..34b7a5b 100644
--- a/include/device.h
+++ b/include/device.h
@@ -38,7 +38,8 @@ public:
*/
virtual int recv(void *packet);
- int get_retry_count() const { return m_retry_count; };
+ int get_retry_receiving_count() const { return m_retry_receiving_count; };
+ int get_retry_sending_count() const { return m_retry_sending_count; };
std::chrono::milliseconds get_retry_timeout() const { return m_retry_timeout; };
std::chrono::milliseconds get_send_receive_delay() const {return m_send_receive_delay;}
@@ -59,7 +60,8 @@ private:
* library, there's no way of doing it asynchronously,
* hence polling.
*/
- int m_retry_count;
+ int m_retry_sending_count;
+ int m_retry_receiving_count;
std::chrono::milliseconds m_retry_timeout;
std::chrono::milliseconds m_send_receive_delay;
diff --git a/include/device_proto.h b/include/device_proto.h
index bf78d29..d64c341 100644
--- a/include/device_proto.h
+++ b/include/device_proto.h
@@ -219,7 +219,7 @@ namespace nitrokey {
if (!outp.isValid()) throw std::runtime_error("Invalid outgoing packet");
int receiving_retry_counter = 0;
- int sending_retry_counter = 3;
+ int sending_retry_counter = dev.get_retry_sending_count();
while (sending_retry_counter-- > 0) {
status = dev.send(&outp);
if (status <= 0)
@@ -230,7 +230,7 @@ namespace nitrokey {
std::this_thread::sleep_for(dev.get_send_receive_delay());
// FIXME make checks done in device:recv here
- receiving_retry_counter = dev.get_retry_count();
+ receiving_retry_counter = dev.get_retry_receiving_count();
while (receiving_retry_counter-- > 0) {
status = dev.recv(&resp);