diff options
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index b29b27d..6c3634e 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -12,6 +12,8 @@ std::mutex nitrokey::proto::send_receive_mtx; +nitrokey::proto::retry_type nitrokey::proto::on_retry = [](int){return 0;}; + namespace nitrokey{ std::mutex mex_dev_com_manager; @@ -61,6 +63,10 @@ using nitrokey::misc::strcpyT; NitrokeyManager::~NitrokeyManager() { } + void NitrokeyManager::set_retry_function(const nitrokey::proto::retry_type retry_func){ + nitrokey::proto::on_retry = retry_func; + } + bool NitrokeyManager::set_current_device_speed(int retry_delay, int send_receive_delay){ if (retry_delay < 20 || send_receive_delay < 20){ LOG("Delay set too low: " + to_string(retry_delay) +" "+ to_string(send_receive_delay), Loglevel::WARNING); |