diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-04-10 08:15:09 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-04-10 08:15:09 +0200 |
commit | 92d4621442795b83dff55009c99e47d4a3d93bef (patch) | |
tree | c153252fee78ad705c7784737606d750b3eb9978 /NK_C_API.cc | |
parent | d0eb7e950ef6535e82ee307937f51b2d3de7d777 (diff) | |
parent | 5a56b83084d797728e5ed557cce2637b3a1e7e56 (diff) | |
download | libnitrokey-92d4621442795b83dff55009c99e47d4a3d93bef.tar.gz libnitrokey-92d4621442795b83dff55009c99e47d4a3d93bef.tar.bz2 |
Merge branch 'pr_105'
Fixes #105
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r-- | NK_C_API.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc index 64355f5..b245940 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -161,6 +161,22 @@ extern "C" { return 0; } + NK_C_API int NK_login_enum(NK_device_model device_model) { + const char *model_string; + switch (device_model) { + case NK_PRO: + model_string = "P"; + break; + case NK_STORAGE: + model_string = "S"; + break; + default: + /* no such enum value -- return error code */ + return 0; + } + return NK_login(model_string); + } + NK_C_API int NK_logout() { auto m = NitrokeyManager::instance(); return get_without_result([&]() { |