diff options
author | Robin Krahl <me@robin-krahl.de> | 2019-01-13 12:05:18 +0100 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2019-01-13 13:27:24 +0100 |
commit | 2c79c15dc9aa4ec7eca454b793bf43a9a3ba85db (patch) | |
tree | 4c8788b37e5c37d9e37c5abc954614aa9f71f877 /NK_C_API.cc | |
parent | a63968570dc99ddf193589270218e6c6df34c460 (diff) | |
download | libnitrokey-2c79c15dc9aa4ec7eca454b793bf43a9a3ba85db.tar.gz libnitrokey-2c79c15dc9aa4ec7eca454b793bf43a9a3ba85db.tar.bz2 |
Add NK_connect_with_path to C API
NK_connect_with_path corresponds to NitrokeyManager::connect_with_path.
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r-- | NK_C_API.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc index 7d0a10e..f0c23a1 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -743,6 +743,14 @@ NK_C_API char* NK_get_SD_usage_data_as_string() { }); } + NK_C_API int NK_connect_with_path(const char* path) { + auto m = NitrokeyManager::instance(); + return get_with_result([&]() { + return m->connect_with_path(path) ? 1 : 0; + }); + } + + NK_C_API int NK_wink() { auto m = NitrokeyManager::instance(); return get_without_result([&]() { |