From 6eec45d9f1dfdfc14d9f5b3ef9f6de03b4277b85 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 23 Jul 2016 13:45:53 +0200 Subject: Allow setting last command status on device Signed-off-by: Szczepan Zalega --- device.cc | 3 ++- include/device.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/device.cc b/device.cc index 3075c0d..cf4b222 100644 --- a/device.cc +++ b/device.cc @@ -15,7 +15,8 @@ Device::Device() m_pid(0), m_retry_count(40), m_retry_timeout(50), - mp_devhandle(NULL) {} + mp_devhandle(NULL), + last_command_status(0){} bool Device::disconnect() { Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2); diff --git a/include/device.h b/include/device.h index 2b51812..c4e2747 100644 --- a/include/device.h +++ b/include/device.h @@ -42,6 +42,13 @@ class Device { int get_retry_count() const { return m_retry_count; }; std::chrono::milliseconds get_retry_timeout() const { return m_retry_timeout; }; + int get_last_command_status() const; + void set_last_command_status(uint8_t _err) { last_command_status = _err;} ; + bool last_command_sucessfull() const {return last_command_status == 0;}; + +private: + uint8_t last_command_status; + protected: uint16_t m_vid; uint16_t m_pid; -- cgit v1.2.3