Added error checking and removed some redundancy from device isOpen()

This commit is contained in:
EricLiu2000
2019-06-13 16:01:35 -04:00
parent 2806c935f1
commit 965679c370
8 changed files with 73 additions and 35 deletions
+1 -2
View File
@@ -32,6 +32,7 @@ public:
bool open();
bool close();
bool isOpen();
virtual void spawnThreads();
virtual void joinThreads();
bool rawWrite(const std::vector<uint8_t>& bytes) { return impl->write(bytes); }
@@ -62,8 +63,6 @@ protected:
std::atomic<bool> closing{false};
private:
bool isOpen = false;
std::thread readTaskThread;
void readTask();
};
+1 -1
View File
@@ -44,7 +44,7 @@ public:
virtual bool open();
virtual bool close();
virtual bool isOnline() const { return online; }
virtual bool isOpen() const { return opened; }
virtual bool isOpen() const { return com->isOpen(); }
virtual bool goOnline();
virtual bool goOffline();