aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-10-10 18:25:32 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-10-10 18:25:32 +0200
commit343e4b1e6d53f042df84e951209b5a33b9a617c3 (patch)
treeba771942520fe6649d6e47a223814a260b9c5f31 /NK_C_API.cc
parentfa871ecba4333ffe9a96b0a662b9d77089cf69b7 (diff)
parentbe675e293fe94a4a6926125a61e67e92e8788d8a (diff)
downloadlibnitrokey-343e4b1e6d53f042df84e951209b5a33b9a617c3.tar.gz
libnitrokey-343e4b1e6d53f042df84e951209b5a33b9a617c3.tar.bz2
Merge branch 'test_organize'
Improve test organization Disable CRC check Improve log
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r--NK_C_API.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index bac11b3..e730bae 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -90,10 +90,10 @@ uint8_t get_without_result(T func){
NK_last_command_status = libraryException.exception_id();
}
catch (const InvalidCRCReceived &invalidCRCException){
- ;;;
+ ;
}
catch (const DeviceCommunicationException &deviceException){
- NK_last_command_status = -1;
+ NK_last_command_status = 256-deviceException.getType();
}
return NK_last_command_status;
}
@@ -296,6 +296,12 @@ extern "C" {
m->set_debug(state);
}
+
+ NK_C_API void NK_set_debug_level(const int level) {
+ auto m = NitrokeyManager::instance();
+ m->set_loglevel(level);
+ }
+
NK_C_API int NK_totp_set_time(uint64_t time) {
auto m = NitrokeyManager::instance();
return get_without_result([&]() {