From c551b27792774b87a1be7fd0dcfd9e209eaef5ec Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 14 Jan 2017 13:37:29 +0100 Subject: Method to get commands failure cause Signed-off-by: Szczepan Zalega --- include/CommandFailedException.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') 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 + } + }; -- cgit v1.2.3