summaryrefslogtreecommitdiff
path: root/NK_C_API.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-08-05 19:50:46 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-05 20:32:45 +0200
commite9c165399bc87e9d283845efdd2d667061b1e323 (patch)
tree8ce834d70805fad5bde2ed8a2aec3b9beba3b37d /NK_C_API.h
parent2675570622b808aec77be240b4663e29598049ef (diff)
downloadlibnitrokey-e9c165399bc87e9d283845efdd2d667061b1e323.tar.gz
libnitrokey-e9c165399bc87e9d283845efdd2d667061b1e323.tar.bz2
Autodetect inserted stick and connect to it
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NK_C_API.h')
-rw-r--r--NK_C_API.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/NK_C_API.h b/NK_C_API.h
index 43a2e34..5960885 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -17,11 +17,17 @@ extern void NK_set_debug(bool state);
/**
* Connect to device of given model. Currently library can be connected only to one device at once.
* @param device_model char 'S': Nitrokey Storage, 'P': Nitrokey Pro
- * @return command processing error code
+ * @return 1 if connected, 0 if wrong model or cannot connect
*/
extern int NK_login(const char *device_model);
/**
+ * Connect to first available device, starting checking from Pro 1st to Storage 2nd.
+ * @return 1 if connected, 0 if wrong model or cannot connect
+ */
+extern int NK_login_auto();
+
+/**
* Disconnect from the device.
* @return command processing error code
*/
@@ -311,6 +317,7 @@ extern int NK_erase_password_safe_slot(uint8_t slot_number);
* @return 0 for no and 1 for yes
*/
extern int NK_is_AES_supported(const char *user_password);
+
}