diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-01-14 13:37:29 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-11 15:41:38 +0100 |
commit | c551b27792774b87a1be7fd0dcfd9e209eaef5ec (patch) | |
tree | e3a0123729513084f41b9d924a222a2946a89fe3 | |
parent | 185b318b9134da163bbfb160d2d737c835927f30 (diff) | |
download | libnitrokey-c551b27792774b87a1be7fd0dcfd9e209eaef5ec.tar.gz libnitrokey-c551b27792774b87a1be7fd0dcfd9e209eaef5ec.tar.bz2 |
Method to get commands failure cause
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r-- | include/CommandFailedException.h | 8 |
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 + } + }; |