From e9c165399bc87e9d283845efdd2d667061b1e323 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 5 Aug 2016 19:50:46 +0200 Subject: Autodetect inserted stick and connect to it Signed-off-by: Szczepan Zalega --- NK_C_API.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'NK_C_API.h') 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,10 +17,16 @@ 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); + } -- cgit v1.2.1