aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NitrokeyManager.cc8
-rw-r--r--include/NitrokeyManager.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 630a4e4..140d4d3 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -129,7 +129,15 @@ namespace nitrokey{
}
}
return false;
+ }
+
+ bool NitrokeyManager::could_current_device_be_enumerated() {
+ std::lock_guard<std::mutex> lock(mex_dev_com);
+ if (device != nullptr) {
+ return device->could_be_enumerated();
}
+ return false;
+ }
void NitrokeyManager::set_debug(bool state) {
if (state){
diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h
index 71ac6fa..4f11314 100644
--- a/include/NitrokeyManager.h
+++ b/include/NitrokeyManager.h
@@ -44,7 +44,9 @@ namespace nitrokey {
bool connect();
bool disconnect();
bool is_connected() throw() ;
- DeviceModel get_connected_device_model() const;
+ bool could_current_device_be_enumerated();
+
+ DeviceModel get_connected_device_model() const;
void set_debug(bool state);
stick10::GetStatus::ResponsePayload get_status();
string get_status_as_string();