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();
};