aboutsummaryrefslogtreecommitdiff
path: root/include/LongOperationInProgressException.h
diff options
context:
space:
mode:
authorszszszsz <szszszsz@users.noreply.github.com>2016-11-26 19:51:11 +0100
committerGitHub <noreply@github.com>2016-11-26 19:51:11 +0100
commitf60f2cf0144a91769a5fc00fac1314d2e00cdf0d (patch)
treead2a4513b1ad01b225a519ac10cafa3e583a26a1 /include/LongOperationInProgressException.h
parentd841239bc9ece1ce969c293783219cceb001fc67 (diff)
parentcdd16f3f184b2745094da39de3f815aea6633fdb (diff)
downloadlibnitrokey-f60f2cf0144a91769a5fc00fac1314d2e00cdf0d.tar.gz
libnitrokey-f60f2cf0144a91769a5fc00fac1314d2e00cdf0d.tar.bz2
Merge pull request #52 from Nitrokey/14-storage_commands
Support Nitrokey Storage
Diffstat (limited to 'include/LongOperationInProgressException.h')
-rw-r--r--include/LongOperationInProgressException.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/LongOperationInProgressException.h b/include/LongOperationInProgressException.h
new file mode 100644
index 0000000..7f182b0
--- /dev/null
+++ b/include/LongOperationInProgressException.h
@@ -0,0 +1,28 @@
+//
+// Created by sz on 24.10.16.
+//
+
+#ifndef LIBNITROKEY_LONGOPERATIONINPROGRESSEXCEPTION_H
+#define LIBNITROKEY_LONGOPERATIONINPROGRESSEXCEPTION_H
+
+#include "CommandFailedException.h"
+
+class LongOperationInProgressException : public CommandFailedException {
+
+public:
+ unsigned char progress_bar_value;
+
+ LongOperationInProgressException(
+ unsigned char _command_id, uint8_t last_command_status, unsigned char _progress_bar_value)
+ : CommandFailedException(_command_id, last_command_status), progress_bar_value(_progress_bar_value){
+ nitrokey::log::Log::instance()(
+ std::string("LongOperationInProgressException, progress bar status: ")+
+ std::to_string(progress_bar_value), nitrokey::log::Loglevel::DEBUG);
+ }
+ virtual const char *what() const throw() {
+ return "Device returned busy status with long operation in progress";
+ }
+};
+
+
+#endif //LIBNITROKEY_LONGOPERATIONINPROGRESSEXCEPTION_H