aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-07-07 21:24:14 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2018-07-07 21:24:14 +0200
commit430e4b4116ec00c4875170642f8ae04bc3497d88 (patch)
treed158fe787ecf1b20cd906dda712ecee8f7285a59 /NK_C_API.h
parent4b3b21dfe6958376db3b1fbcadf6e03f53291e4f (diff)
parent601f43bfa71b479e32a289eaeec75069cbc7c26f (diff)
downloadlibnitrokey-430e4b4116ec00c4875170642f8ae04bc3497d88.tar.gz
libnitrokey-430e4b4116ec00c4875170642f8ae04bc3497d88.tar.bz2
Merge branch 'pr_116'
Allow to connect to device with model specified by enum. Fixes #116
Diffstat (limited to 'NK_C_API.h')
-rw-r--r--NK_C_API.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/NK_C_API.h b/NK_C_API.h
index 84c8296..b1bdf1e 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -43,14 +43,18 @@ extern "C" {
* The Nitrokey device models supported by the API.
*/
enum NK_device_model {
+ /**
+ * Use, if no supported device is connected
+ */
+ NK_DISCONNECTED = 0,
/**
* Nitrokey Pro.
*/
- NK_PRO,
+ NK_PRO = 1,
/**
* Nitrokey Storage.
*/
- NK_STORAGE
+ NK_STORAGE = 2
};
/**
@@ -203,6 +207,14 @@ extern "C" {
NK_C_API int NK_logout();
/**
+ * Query the model of the connected device.
+ * Returns the model of the connected device or NK_DISCONNECTED.
+ *
+ * @return true if a device is connected and the out argument has been set
+ */
+ NK_C_API enum NK_device_model NK_get_device_model();
+
+ /**
* Return the debug status string. Debug purposes.
* @return command processing error code
*/