aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-01-15 16:01:24 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2019-01-15 16:01:24 +0100
commit3f3fdebbc795dc3805cd5be105ce994286598f16 (patch)
tree4614c7e129f842606078a9ae47e494101e623cb5 /NK_C_API.h
parent0a359ceaa7cc08d5e7069729c0501931e0dbeb82 (diff)
parent46a94679152da263e3e805ec2073359ae60ce6ab (diff)
downloadlibnitrokey-3f3fdebbc795dc3805cd5be105ce994286598f16.tar.gz
libnitrokey-3f3fdebbc795dc3805cd5be105ce994286598f16.tar.bz2
Merge branch 'pr_145' into contributions
Add NK_get_SD_usage_data function to C API Fixes #145
Diffstat (limited to 'NK_C_API.h')
-rw-r--r--NK_C_API.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/NK_C_API.h b/NK_C_API.h
index 43e5631..520d5e0 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -128,6 +128,23 @@ extern "C" {
bool stick_initialized;
};
+ /**
+ * Data about the usage of the SD card.
+ */
+ struct NK_SD_usage_data {
+ /**
+ * The minimum write level, as a percentage of the total card
+ * size.
+ */
+ uint8_t write_level_min;
+ /**
+ * The maximum write level, as a percentage of the total card
+ * size.
+ */
+ uint8_t write_level_max;
+ };
+
+
struct NK_storage_ProductionTest{
uint8_t FirmwareVersion_au8[2];
uint8_t FirmwareVersionInternal_u8;
@@ -737,6 +754,17 @@ extern "C" {
NK_C_API int NK_get_status_storage(struct NK_storage_status* out);
/**
+ * Get SD card usage attributes. Usable during hidden volumes creation.
+ * If the command was successful (return value 0), the usage data is
+ * written to the output pointer’s target. The output pointer must
+ * not be null.
+ * Storage only
+ * @param out the output pointer for the usage data
+ * @return command processing error code
+ */
+ NK_C_API int NK_get_SD_usage_data(struct NK_SD_usage_data* out);
+
+ /**
* Get SD card usage attributes as string.
* Usable during hidden volumes creation.
* Storage only