summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NK_C_API.cc8
-rw-r--r--NK_C_API.h8
2 files changed, 16 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([&]() {
diff --git a/NK_C_API.h b/NK_C_API.h
index b1bdf1e..81da956 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -780,6 +780,14 @@ extern "C" {
NK_C_API int NK_connect_with_ID(const char* id);
/**
+ * Connects to a device with the given path. The path is a USB device
+ * path as returned by hidapi.
+ * @param path the device path
+ * @return 1 on successful connection, 0 otherwise
+ */
+ NK_C_API int NK_connect_with_path(const char* path);
+
+ /**
* Blink red and green LED alternatively and infinitely (until device is reconnected).
* @return command processing error code
*/