diff options
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index caf9724..3697369 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -36,8 +36,17 @@ namespace nitrokey{ } NitrokeyManager::~NitrokeyManager() {delete _instance; delete device;} - bool NitrokeyManager::connect() { - device = new Stick10(); + bool NitrokeyManager::connect(const char *device_model) { + switch (device_model[0]){ + case 'P': + device = new Stick10(); + break; + case 'S': + device = new Stick20(); + break; + default: + throw std::runtime_error("Unknown model"); + } return device->connect(); } |