aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-01-14 13:37:29 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 15:41:38 +0100
commitc551b27792774b87a1be7fd0dcfd9e209eaef5ec (patch)
treee3a0123729513084f41b9d924a222a2946a89fe3 /include
parent185b318b9134da163bbfb160d2d737c835927f30 (diff)
downloadlibnitrokey-c551b27792774b87a1be7fd0dcfd9e209eaef5ec.tar.gz
libnitrokey-c551b27792774b87a1be7fd0dcfd9e209eaef5ec.tar.bz2
Method to get commands failure cause
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include')
-rw-r--r--include/CommandFailedException.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/CommandFailedException.h b/include/CommandFailedException.h
index 8bcdcae..3753ad4 100644
--- a/include/CommandFailedException.h
+++ b/include/CommandFailedException.h
@@ -11,8 +11,8 @@
class CommandFailedException : public std::exception {
public:
- uint8_t last_command_code;
- uint8_t last_command_status;
+ const uint8_t last_command_code;
+ const uint8_t last_command_status;
CommandFailedException(uint8_t last_command_code, uint8_t last_command_status) :
last_command_code(last_command_code),
@@ -24,6 +24,10 @@ public:
return "Command execution has failed on device";
}
+ bool reason_slot_not_programmed() const throw(){
+ return last_command_status == 3; //FIXME use enum status codes
+ }
+
};