aboutsummaryrefslogtreecommitdiff
path: root/include/CommandFailedException.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-12-20 20:00:44 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 15:42:38 +0100
commitc93fdb6625ee952e5cf17e4caaeddf2975276f90 (patch)
tree00d682c674c74c0678b252030b49e3f8d24c97a9 /include/CommandFailedException.h
parentc0ee79f93a97b511661f99d45606e2c433d15344 (diff)
downloadlibnitrokey-c93fdb6625ee952e5cf17e4caaeddf2975276f90.tar.gz
libnitrokey-c93fdb6625ee952e5cf17e4caaeddf2975276f90.tar.bz2
Implement command for testing smartcard status
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/CommandFailedException.h')
-rw-r--r--include/CommandFailedException.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/CommandFailedException.h b/include/CommandFailedException.h
index 42fad73..32bd6b7 100644
--- a/include/CommandFailedException.h
+++ b/include/CommandFailedException.h
@@ -28,6 +28,7 @@
#include "command_id.h"
using cs = nitrokey::proto::stick10::command_status;
+using cs2 = nitrokey::proto::stick20::device_status;
class CommandFailedException : public std::exception {
public:
@@ -65,6 +66,10 @@ public:
return last_command_status == static_cast<uint8_t>(cs::wrong_password);
}
+ bool reason_smartcard_busy() const throw(){
+ return last_command_status == static_cast<uint8_t>(cs2::smartcard_error);
+ }
+
};