aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 4008bd0..8bb1a2a 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -273,6 +273,21 @@ using nitrokey::misc::strcpyT;
return device->connect();
}
+ bool NitrokeyManager::connect(device::DeviceModel device_model) {
+ const char *model_string;
+ switch (device_model) {
+ case device::DeviceModel::PRO:
+ model_string = "P";
+ break;
+ case device::DeviceModel::STORAGE:
+ model_string = "S";
+ break;
+ default:
+ throw std::runtime_error("Unknown model");
+ }
+ return connect(model_string);
+ }
+
shared_ptr<NitrokeyManager> NitrokeyManager::instance() {
static std::mutex mutex;
std::lock_guard<std::mutex> lock(mutex);